Skip to content

Commit

Permalink
Merge (#1727): Always enable nlohmann_json with examples
Browse files Browse the repository at this point in the history
Always enable nlohmann_json with examples

Related PR: #1727
  • Loading branch information
pratikvn authored Nov 25, 2024
2 parents 681caa0 + 5a8b590 commit 8fa7bc5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ endif()
if(GINKGO_BUILD_BENCHMARKS)
find_package(gflags 2.2.2 QUIET)
endif()
if(GINKGO_BUILD_TESTS OR GINKGO_BUILD_BENCHMARKS)
if(GINKGO_BUILD_TESTS OR GINKGO_BUILD_BENCHMARKS OR GINKGO_BUILD_EXAMPLES)
find_package(nlohmann_json 3.9.1 QUIET)
endif()

Expand Down
17 changes: 8 additions & 9 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,15 @@ if(GINKGO_BUILD_TESTS)
foreach(config IN LISTS config_list)
get_filename_component(config_name "${config}" NAME_WE)
foreach(executor IN LISTS executors)
add_test(NAME example_file-config-solver_${config_name}_${executor}
COMMAND
"$<TARGET_FILE:file-config-solver>"
"${executor}" "${CMAKE_CURRENT_SOURCE_DIR}/file-config-solver/config/${config_name}.json"
"${CMAKE_CURRENT_SOURCE_DIR}/file-config-solver/data/A.mtx"
WORKING_DIRECTORY
"$<TARGET_FILE_DIR:ginkgo>")
add_test(NAME example_file-config-solver_${config_name}_${executor}
COMMAND
"$<TARGET_FILE:file-config-solver>"
"${executor}" "${CMAKE_CURRENT_SOURCE_DIR}/file-config-solver/config/${config_name}.json"
"${CMAKE_CURRENT_SOURCE_DIR}/file-config-solver/data/A.mtx"
WORKING_DIRECTORY
"$<TARGET_FILE_DIR:ginkgo>")
# Prevent performance issues with high core counts
set_property(TEST example_file-config-solver_${config_name}_${executor} PROPERTY ENVIRONMENT OMP_NUM_THREADS=4)
endforeach()
endforeach()
endforeach()

endif()
2 changes: 1 addition & 1 deletion third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(GINKGO_BUILD_BENCHMARKS)
endif()
endif()

if(GINKGO_BUILD_TESTS OR GINKGO_BUILD_BENCHMARKS)
if(GINKGO_BUILD_TESTS OR GINKGO_BUILD_BENCHMARKS OR GINKGO_BUILD_EXAMPLES)
if (NOT nlohmann_json_FOUND)
add_subdirectory(nlohmann_json)
endif()
Expand Down

0 comments on commit 8fa7bc5

Please sign in to comment.