Skip to content

Commit

Permalink
remove the USE_LOCAL_TBB option, rely on CMake; fix issues with yam…
Browse files Browse the repository at this point in the history
…l-cpp linking (when not fetched)
  • Loading branch information
schuhmaj committed Oct 15, 2024
1 parent 32057e1 commit daac112
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ set(POLYHEDRAL_GRAVITY_PARALLELIZATION "CPP" CACHE STRING "Host parallelization
(CPP= Serial, OMP = OpenMP, TBB = Intel Threading Building Blocks")
set_property(CACHE POLYHEDRAL_GRAVITY_PARALLELIZATION PROPERTY STRINGS CPP, OMP, TBB)

# Enforce to use an already installed tbb library instead of compiling from source
option(USE_LOCAL_TBB "Uses the local tbb installation rather than on using the automatically fetched version from
GitHub via CMake (Default: OFF)" OFF)

# Set the Logging Level
set(LOGGING_LEVEL_LIST "TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL" "OFF")
set(LOGGING_LEVEL "INFO" CACHE STRING "Set the Logging level, default (INFO), available options: TRACE, DEBUG, INFO, WARN, ERROR, CRITICAL, OFF")
Expand Down Expand Up @@ -77,9 +73,9 @@ include(clang_format)
# Get a version of tbb from the github repository, simplifies compilation for the user since tbb does not need to be
# preinstalled but rather gets automatically set up via CMake
# Nevertheless, there is still the option to enforce to use a local installation if one exists
if (NOT USE_LOCAL_TBB AND ${POLYHEDRAL_GRAVITY_PARALLELIZATION} STREQUAL "TBB")
if (${POLYHEDRAL_GRAVITY_PARALLELIZATION} STREQUAL "TBB")
include(tbb)
thrust_set_TBB_target(tbb)
thrust_set_TBB_target(TBB::tbb)
endif ()

# Thrust set-up i.e. the parallelization library, create targets according to the users specification
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ you have a C++17 capable compiler and CMake installed.
The project uses the following dependencies,
all of them are **automatically** set-up via CMake:

- GoogleTest (1.13.0 or compatible), only required for testing
- GoogleTest (1.15.2 or compatible), only required for testing
- spdlog (1.13.0 or compatible), required for logging
- tetgen (1.6 or compatible), required for I/O
- yaml-cpp (0.8.0 or compatible), required for I/O
Expand Down Expand Up @@ -309,7 +309,6 @@ The following options are available:
|-------------------------------------------:|:--------------------------------------------------------------------------------------------|
| POLYHEDRAL_GRAVITY_PARALLELIZATION (`CPP`) | `CPP` = Serial Execution / `OMP` or `TBB` = Parallel Execution with OpenMP or Intel\'s TBB |
| LOGGING_LEVEL (`INFO`) | `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `CRITICAL`, `OFF` |
| USE_LOCAL_TBB (`OFF`) | Use a local installation of `TBB` instead of setting it up via `CMake` |
| BUILD_POLYHEDRAL_GRAVITY_DOCS (`OFF`) | Build this documentation |
| BUILD_POLYHEDRAL_GRAVITY_TESTS (`ON`) | Build the Tests |
| BUILD_POLYHEDRAL_PYTHON_INTERFACE (`ON`) | Build the Python interface |
Expand Down
3 changes: 1 addition & 2 deletions docs/quickstart/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ Name (Default) Options
================================================ ===================================================================================================================================
POLYHEDRAL_GRAVITY_PARALLELIZATION (:code:`CPP`) :code:`CPP` = Serial Execution / :code:`OMP` or :code:`TBB` = Parallel Execution with OpenMP or Intel's TBB
LOGGING_LEVEL (:code:`INFO`) :code:`TRACE`, :code:`DEBUG`, :code:`INFO`, :code:`WARN`, :code:`ERROR`, :code:`CRITICAL`, :code:`OFF`
USE_LOCAL_TBB (:code:`OFF`) Use a local installation of :code:`TBB` instead of setting it up via :code:`CMake`
BUILD_POLYHEDRAL_GRAVITY_DOCS (:code:`OFF`) Build this documentation
BUILD_POLYHEDRAL_GRAVITY_TESTS (:code:`ON`) Build the Tests
BUILD_POLYHEDRAL_PYTHON_INTERFACE (:code:`ON`) Build the Python interface
Expand All @@ -104,7 +103,7 @@ Dependencies (automatically set-up)

Dependencies (all of them are automatically set-up via :code:`CMake`):

- GoogleTest (1.13.0 or compatible), only required for testing
- GoogleTest (1.15.2 or compatible), only required for testing
- spdlog (1.13.0 or compatible), required for logging
- tetgen (1.6 or compatible), required for I/O
- yaml-cpp (0.8.0 or compatible), required for I/O
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
"POLYHEDRAL_GRAVITY_PARALLELIZATION": "TBB",
# Default value (INFO=2)
"LOGGING_LEVEL": "INFO",
# Default value (OFF)
"USE_LOCAL_TBB": "OFF",
# Not required for the python interface (--> OFF)
"BUILD_POLYHEDRAL_GRAVITY_DOCS": "OFF",
# Not required for the python interface (--> OFF)
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (BUILD_POLYHEDRAL_GRAVITY_LIBRARY)
# Link libraries needed in all targets
target_link_libraries(${PROJECT_NAME}_lib
spdlog::spdlog
yaml-cpp
yaml-cpp::yaml-cpp
tetgen
xsimd
Thrust
Expand Down
5 changes: 3 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ add_executable(${PROJECT_NAME}_test ${TEST_SRC})

# Links target breakupModelTest against gtest_main (entry point, so no own main method is required)
target_link_libraries(${PROJECT_NAME}_test
gtest_main
gmock
GTest::gtest_main
GTest::gtest
GTest::gmock
${PROJECT_NAME}_lib
)

Expand Down

0 comments on commit daac112

Please sign in to comment.