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
13 changes: 9 additions & 4 deletions multi_physics/QED/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ option(PXRMP_QED_TABLEGEN "Enable table generation (needs Boost)" ON)
option(PXRMP_QED_TEST "Build PICSAR QED tests " ${IS_TOPLEVEL})
option(PXRMP_QED_TOOLS "Build PICSAR QED tools " ${IS_TOPLEVEL})
option(PXRMP_QED_PYTHON_BINDINGS "Build PICSAR QED python bindings " ${IS_TOPLEVEL})
option(PXRMP_BOOST_TEST_DYN_LINK "Link against the Boost Unit Test Framework shared library" ON)
option(PXRMP_DPCPP_FIX "Use sycl::floor sycl::floorf on device" OFF)
option(PXRMP_KOKKOS_EXAMPLE "Build examples using Kokkos" OFF)

Expand All @@ -41,12 +40,18 @@ if(PXRMP_QED_OMP)
endif()

if(PXRMP_QED_TABLEGEN)
find_package(Boost 1.66.0)
find_package(Boost 1.71 CONFIG)
if(Boost_FOUND)
target_link_libraries(PXRMP_QED INTERFACE Boost::boost)
target_link_libraries(PXRMP_QED INTERFACE Boost::headers)
target_compile_definitions(PXRMP_QED INTERFACE PXRMP_HAS_BOOST=1)
else()
message( FATAL_ERROR "Table generation (PXRMP_QED_TABLEGEN) requires Boost (>= 1.66)!" )
message( FATAL_ERROR
"Table generation (PXRMP_QED_TABLEGEN) requires Boost (>= 1.71) "
"including its CMake config package (BoostConfig.cmake). "
"Examples: conda-forge 'libboost-devel' (not 'libboost-headers'), "
"Spack 'boost', Debian/Ubuntu 'libboost-dev', Homebrew 'boost', "
"or a Boost installed via 'b2 install'. "
"Point CMake to it via Boost_DIR or CMAKE_PREFIX_PATH if needed." )
endif()
endif()

Expand Down
9 changes: 6 additions & 3 deletions multi_physics/QED/QED_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Check if unit_test package is available
find_package(Boost 1.66.0 REQUIRED COMPONENTS unit_test_framework)
find_package(Boost 1.71 CONFIG REQUIRED COMPONENTS unit_test_framework)

# Boost.Test needs BOOST_TEST_DYN_LINK if linked as a shared library
get_target_property(_pxrmp_boost_utf_type Boost::unit_test_framework TYPE)

set(TEST_NAMES
picsar_algo
Expand Down Expand Up @@ -41,8 +44,8 @@ foreach(name ${TEST_NAMES})

# link to Boost libraries AND your targets and dependencies
target_link_libraries(${name} PRIVATE PXRMP_QED)
target_link_libraries(${name} PRIVATE Boost::boost Boost::unit_test_framework)
if(PXRMP_BOOST_TEST_DYN)
target_link_libraries(${name} PRIVATE Boost::headers Boost::unit_test_framework)
if(_pxrmp_boost_utf_type STREQUAL "SHARED_LIBRARY")
target_compile_definitions(${name} PRIVATE BOOST_TEST_DYN_LINK)
endif()

Expand Down
2 changes: 1 addition & 1 deletion multi_physics/QED/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## PICSAR MULTIPHYSICS

### Library
The QED library is a header only library. Its only external dependency is Boost (a recent version is needed). Boost is absolutely necessary to generate lookup tables, but it's not needed at runtime if lookup tables have been previously generated.
The QED library is a header only library. Its only external dependency is Boost (version 1.71 or newer). Boost is absolutely necessary to generate lookup tables, but it's not needed at runtime if lookup tables have been previously generated.

C++20 standard is followed. The core functions of the library can be included in GPU kernels, provided that the user sets the `PXRMP_GPU` before including any file of the library (e.g. `#define PXRMP_GPU __host__ __device__`).

Expand Down
Loading