Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ jobs:
run: |
lcov --capture --directory build \
--rc geninfo_unexecuted_blocks=1 \
--ignore-errors mismatch,inconsistent,unsupported,format \
--ignore-errors mismatch,mismatch,inconsistent,inconsistent,unsupported,format,format \
--output-file coverage.info
lcov --remove coverage.info "/opt/homebrew/*" "/Applications/Xcode_*.app/*" \
"/Users/runner/work/trx-cpp/trx-cpp/third_party/*" \
--ignore-errors mismatch,inconsistent,unsupported,format \
"/Users/runner/work/trx-cpp/trx-cpp/examples/*" \
"/Users/runner/work/trx-cpp/trx-cpp/bench/*" \
--ignore-errors mismatch,mismatch,inconsistent,inconsistent,unsupported,format,format,unused \
--output-file coverage.info
lcov --summary coverage.info --ignore-errors mismatch,inconsistent,unsupported,format
lcov --summary coverage.info --ignore-errors mismatch,mismatch,inconsistent,inconsistent,unsupported,format,format

- name: Upload coverage to Codecov (macOS)
if: runner.os == 'macOS'
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/trx-cpp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ jobs:
run: |
lcov --capture --directory build \
--rc geninfo_unexecuted_blocks=1 \
--ignore-errors mismatch \
--ignore-errors mismatch,mismatch,inconsistent,inconsistent,unsupported,format,format \
--output-file coverage.info
lcov --summary coverage.info
lcov --remove coverage.info \
"*/third_party/*" \
"*/examples/*" \
"*/bench/*" \
--ignore-errors mismatch,mismatch,inconsistent,inconsistent,unsupported,format,format,unused \
--output-file coverage.info
lcov --summary coverage.info --ignore-errors mismatch,mismatch,inconsistent,inconsistent,unsupported,format,format

- name: Upload to Codecov
uses: codecov/codecov-action@v4
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**/*.cmake
**/Makefile
**/build
**build-release
**/bin
**/load_trx
**/tests/memmap
Expand All @@ -15,6 +16,8 @@ test_package/CMakeUserPresets.json
syntax.log
docs/_build/
docs/api/

.DS_Store
test_package/build
test_package/CMakeUserPresets.json
test_package/CMakeUserPresets.json
test-data/*
bench/results*
22 changes: 21 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ endif()
option(TRX_USE_CONAN "Should Conan package manager be used?" OFF)
option(TRX_BUILD_TESTS "Build trx tests" OFF)
option(TRX_BUILD_EXAMPLES "Build trx example commandline programs" ON)
option(TRX_BUILD_BENCHMARKS "Build trx benchmarks" OFF)
option(TRX_ENABLE_CLANG_TIDY "Run clang-tidy during builds" OFF)
option(TRX_ENABLE_INSTALL "Install trx-cpp targets" ${TRX_IS_TOP_LEVEL})
option(TRX_BUILD_DOCS "Build API documentation with Doxygen/Sphinx" OFF)
Expand Down Expand Up @@ -68,7 +69,11 @@ elseif(TARGET zip::zip)
else()
message(FATAL_ERROR "No suitable libzip target (expected libzip::libzip or zip::zip)")
endif()
find_package(Eigen3 CONFIG QUIET)
# Prefer Eigen3_ROOT so -DEigen3_ROOT=/path/to/eigen-3.4 is used over system Eigen
if(Eigen3_ROOT)
list(PREPEND CMAKE_PREFIX_PATH "${Eigen3_ROOT}")
endif()
find_package(Eigen3 3.4 CONFIG QUIET)
if (NOT Eigen3_FOUND)
find_package(Eigen3 REQUIRED) # try module mode
endif()
Expand Down Expand Up @@ -148,6 +153,21 @@ if(TRX_BUILD_TESTS)
endif()
endif()

if(TRX_BUILD_BENCHMARKS)
find_package(benchmark CONFIG QUIET)
if(NOT benchmark_FOUND)
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark tests" FORCE)
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable benchmark gtest" FORCE)
FetchContent_Declare(
benchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.8.3
)
FetchContent_MakeAvailable(benchmark)
endif()
add_subdirectory(bench)
endif()

if(TRX_ENABLE_NIFTI)
find_package(ZLIB REQUIRED)
add_library(trx-nifti
Expand Down
3 changes: 3 additions & 0 deletions bench/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_executable(bench_trx_realdata bench_trx_realdata.cpp)
target_link_libraries(bench_trx_realdata PRIVATE trx benchmark::benchmark)
target_compile_features(bench_trx_realdata PRIVATE cxx_std_17)
Loading
Loading