Skip to content

Commit 9415971

Browse files
committed
wip
1 parent aef0be7 commit 9415971

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

.docker/install-static-libs.sh

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BZIP2_VERSION=1.0.8
1212
LIBARCHIVE_VERSION=3.7.2
1313
FLAC_VERSION=1.4.3
1414
LIBUNWIND_VERSION=1.7.2
15-
# BENCHMARK_VERSION=1.8.2
15+
BENCHMARK_VERSION=1.8.3
1616

1717
RETRY=0
1818
while true; do
@@ -32,7 +32,7 @@ wget https://sourceware.org/pub/bzip2/bzip2-${BZIP2_VERSION}.tar.gz
3232
wget https://github.com/libarchive/libarchive/releases/download/v${LIBARCHIVE_VERSION}/libarchive-${LIBARCHIVE_VERSION}.tar.xz
3333
wget https://github.com/xiph/flac/releases/download/${FLAC_VERSION}/flac-${FLAC_VERSION}.tar.xz
3434
wget https://github.com/libunwind/libunwind/releases/download/v${LIBUNWIND_VERSION}/libunwind-${LIBUNWIND_VERSION}.tar.gz
35-
# wget https://github.com/google/benchmark/archive/refs/tags/v${BENCHMARK_VERSION}.tar.gz
35+
wget https://github.com/google/benchmark/archive/refs/tags/v${BENCHMARK_VERSION}.tar.gz
3636

3737
for COMPILER in clang gcc; do
3838
if [[ "$COMPILER" == "clang" ]]; then
@@ -85,14 +85,14 @@ for COMPILER in clang gcc; do
8585
make -j$(nproc)
8686
make install
8787

88-
# cd "$HOME/pkgs"
89-
# tar xf v${BENCHMARK_VERSION}.tar.gz
90-
# cd benchmark-${BENCHMARK_VERSION}
91-
# mkdir build
92-
# cd build
93-
# cmake .. -DBENCHMARK_DOWNLOAD_DEPENDENCIES=1 -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR"
94-
# make -j$(nproc)
95-
# make install
88+
cd "$HOME/pkgs"
89+
tar xf v${BENCHMARK_VERSION}.tar.gz
90+
cd benchmark-${BENCHMARK_VERSION}
91+
mkdir build
92+
cd build
93+
cmake .. -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR"
94+
make -j$(nproc)
95+
make install
9696
done
9797

9898
cd "$HOME"

CMakeLists.txt

+9-11
Original file line numberDiff line numberDiff line change
@@ -766,17 +766,15 @@ if(WITH_TESTS)
766766
endif()
767767

768768
if(WITH_BENCHMARKS)
769-
if(NOT STATIC_BUILD_DO_NOT_USE)
770-
find_package(benchmark 1.8)
771-
if(benchmark_FOUND)
772-
add_executable(dwarfs_benchmark test/dwarfs_benchmark.cpp)
773-
target_link_libraries(dwarfs_benchmark test_helpers benchmark::benchmark)
774-
list(APPEND BINARY_TARGETS dwarfs_benchmark)
775-
776-
add_executable(multiversioning_benchmark test/multiversioning_benchmark.cpp)
777-
target_link_libraries(multiversioning_benchmark test_helpers benchmark::benchmark)
778-
list(APPEND BINARY_TARGETS multiversioning_benchmark)
779-
endif()
769+
find_package(benchmark 1.8)
770+
if(benchmark_FOUND)
771+
add_executable(dwarfs_benchmark test/dwarfs_benchmark.cpp)
772+
target_link_libraries(dwarfs_benchmark test_helpers benchmark::benchmark)
773+
list(APPEND BINARY_TARGETS dwarfs_benchmark)
774+
775+
add_executable(multiversioning_benchmark test/multiversioning_benchmark.cpp)
776+
target_link_libraries(multiversioning_benchmark test_helpers benchmark::benchmark)
777+
list(APPEND BINARY_TARGETS multiversioning_benchmark)
780778
endif()
781779

782780
add_executable(segmenter_benchmark test/segmenter_benchmark.cpp)

ricepp/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ endif()
148148
if(WITH_BENCHMARKS)
149149
find_package(benchmark 1.8)
150150
if(benchmark_FOUND)
151+
if(STATIC_BUILD_DO_NOT_USE)
152+
add_link_options(-static -static-libgcc)
153+
endif()
154+
151155
add_executable(ricepp_benchmark ricepp_benchmark.cpp)
152156
target_link_libraries(ricepp_benchmark ricepp benchmark::benchmark)
153157

0 commit comments

Comments
 (0)