diff --git a/.github/workflows/capgen_unit_tests.yaml b/.github/workflows/capgen_unit_tests.yaml index 04ca790b..7247100f 100644 --- a/.github/workflows/capgen_unit_tests.yaml +++ b/.github/workflows/capgen_unit_tests.yaml @@ -29,7 +29,7 @@ jobs: - name: Build the framework run: | - cmake -S. -B./build -DCCPP_FRAMEWORK_ENABLE_TESTS=ON + cmake -S. -B./build -DOPENMP=ON -DCCPP_FRAMEWORK_ENABLE_TESTS=ON cd build make diff --git a/.gitignore b/.gitignore index c2eb493d..bcdbc365 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ # All compiled Python modules *.pyc +# CMake build directory +build/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index acf8bc76..e0316793 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,15 +11,28 @@ include(cmake/ccpp_capgen.cmake) set(PACKAGE "ccpp-framework") string(TIMESTAMP YEAR "%Y") +option(OPENMP "Enable OpenMP support for the framework" OFF) +option(BUILD_SHARED_LIBS "Build using shared libraries" ON) option(CCPP_FRAMEWORK_BUILD_DOCUMENTATION "Create and install the HTML documentation (requires Doxygen)" OFF) -option(OPENMP "Enable OpenMP support for the framework" OFF) -option(CCPP_FRAMEWORK_ENABLE_TESTS "Enable building/running CCPP regression tests" OFF) +option(CCPP_FRAMEWORK_ENABLE_TESTS "Enable building/running CCPP regression tests" OFF) option(CCPP_RUN_ADVECTION_TEST "Enable advection regression test" OFF) option(CCPP_RUN_CAPGEN_TEST "Enable capgen regression test" OFF) option(CCPP_RUN_DDT_HOST_TEST "Enable ddt host regression test" OFF) option(CCPP_RUN_VAR_COMPATIBILITY_TEST "Enable variable compatibility regression test" OFF) -option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + +message("") +message("OPENMP .............................. ${OPENMP}") +message("BUILD_SHARED_LIBS ................... ${BUILD_SHARED_LIBS}") +message("") +message("CCPP_FRAMEWORK_BUILD_DOCUMENTATION ...${CCPP_FRAMEWORK_BUILD_DOCUMENTATION}") +message("CCPP_FRAMEWORK_ENABLE_TESTS ......... ${CCPP_FRAMEWORK_ENABLE_TESTS}") +message("CCPP_RUN_ADVECTION_TEST ............. ${CCPP_RUN_ADVECTION_TEST}") +message("CCPP_RUN_CAPGEN_TEST ................ ${CCPP_RUN_CAPGEN_TEST}") +message("CCPP_RUN_DDT_HOST_TEST .............. ${CCPP_RUN_DDT_HOST_TEST}") +message("CCPP_RUN_VAR_COMPATIBILITY_TEST ..... ${CCPP_RUN_VAR_COMPATIBILITY_TEST}") +message("") + set(CCPP_VERBOSITY "0" CACHE STRING "Verbosity level of output (default: 0)") # Warn user on conflicting test options diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d88c5497..a7428a77 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,6 +12,9 @@ set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_I # Define the executable and what to link add_library(ccpp_framework STATIC ${SOURCES_F90}) target_link_libraries(ccpp_framework PUBLIC MPI::MPI_Fortran) +if(OPENMP) + target_link_libraries(ccpp_framework PUBLIC OpenMP::OpenMP_Fortran) +endif() set_target_properties(ccpp_framework PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})