From d24c1805927254d7964f614c48f8bdb182da7bc3 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Tue, 22 Mar 2022 10:46:34 -0500 Subject: [PATCH] update scripts with new cmake flag names --- CMakeLists.txt | 24 ++++++++++++------------ Dockerfile | 8 ++++---- tools/ci/gha-install.py | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a0066dc659..168309de863 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,11 +25,11 @@ endif() # Command line options #=============================================================================== -option(openmp "Enable shared-memory parallelism with OpenMP" ON) -option(profile "Compile with profiling flags" OFF) -option(coverage "Compile with coverage analysis flags" OFF) -option(dagmc "Enable support for DAGMC (CAD) geometry" OFF) -option(libmesh "Enable support for libMesh unstructured mesh tallies" OFF) +option(OPENMC_ENABLE_PROFILE "Enable shared-memory parallelism with OpenMP" ON) +option(OPENMC_ENABLE_COVERAGE "Compile with profiling flags" OFF) +option(OPENMC_USE_OPENMP "Compile with coverage analysis flags" OFF) +option(OPENMC_USE_DAGMC "Enable support for DAGMC (CAD) geometry" OFF) +option(OPENMC_USE_LIBMESH "Enable support for libMesh unstructured mesh tallies" OFF) #=============================================================================== # Set build configuration to Release if not set @@ -66,7 +66,7 @@ endmacro() # DAGMC Geometry Support - need DAGMC/MOAB #=============================================================================== -if(dagmc) +if(OPENMC_USE_DAGMC) find_package(DAGMC REQUIRED PATH_SUFFIXES lib/cmake) if (${DAGMC_VERSION} VERSION_LESS 3.2.0) message(FATAL_ERROR "Discovered DAGMC Version: ${DAGMC_VERSION}. \ @@ -78,7 +78,7 @@ endif() # libMesh Unstructured Mesh Support #=============================================================================== -if(libmesh) +if(OPENMC_USE_LIBMESH) find_package(LIBMESH REQUIRED) endif() @@ -129,7 +129,7 @@ endif() # Skip for Visual Studio which has its own configurations through GUI if(NOT MSVC) -if(openmp) +if(OPENMC_USE_OPENMP) find_package(OpenMP) if(OPENMP_FOUND) # In CMake 3.9+, can use the OpenMP::OpenMP_CXX imported target @@ -140,10 +140,10 @@ endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) -if(profile) +if(OPENMC_ENABLE_PROFILE) list(APPEND cxxflags -g -fno-omit-frame-pointer) endif() -if(coverage) +if(OPENMC_ENABLE_COVERAGE) list(APPEND cxxflags --coverage) list(APPEND ldflags --coverage) endif() @@ -433,12 +433,12 @@ else() target_link_libraries(libopenmc pugixml) endif() -if(dagmc) +if(OPENMC_USE_DAGMC) target_compile_definitions(libopenmc PRIVATE DAGMC) target_link_libraries(libopenmc dagmc-shared uwuw-shared) endif() -if(libmesh) +if(OPENMC_USE_LIBMESH) target_compile_definitions(libopenmc PRIVATE LIBMESH) target_link_libraries(libopenmc PkgConfig::LIBMESH) endif() diff --git a/Dockerfile b/Dockerfile index dc7d25f6c3c..6a9b8900911 100644 --- a/Dockerfile +++ b/Dockerfile @@ -180,20 +180,20 @@ RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC \ if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "on" ]; then \ cmake ../openmc \ -DHDF5_PREFER_PARALLEL=on \ - -Ddagmc=on \ - -Dlibmesh=on \ + -DOPENMC_USE_DAGMC=on \ + -DOPENMC_USE_LIBMESH=on \ -DCMAKE_PREFIX_PATH="${DAGMC_INSTALL_DIR};${LIBMESH_INSTALL_DIR}" ; \ fi ; \ if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "off" ]; then \ cmake ../openmc \ -DHDF5_PREFER_PARALLEL=on \ - -Ddagmc=ON \ + -DOPENMC_USE_DAGMC=ON \ -DCMAKE_PREFIX_PATH=${DAGMC_INSTALL_DIR} ; \ fi ; \ if [ ${build_dagmc} = "off" ] && [ ${build_libmesh} = "on" ]; then \ cmake ../openmc \ -DHDF5_PREFER_PARALLEL=on \ - -Dlibmesh=on \ + -DOPENMC_USE_LIBMESH=on \ -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR} ; \ fi ; \ if [ ${build_dagmc} = "off" ] && [ ${build_libmesh} = "off" ]; then \ diff --git a/tools/ci/gha-install.py b/tools/ci/gha-install.py index f22a74410a8..4cc85671d92 100644 --- a/tools/ci/gha-install.py +++ b/tools/ci/gha-install.py @@ -30,7 +30,7 @@ def install(omp=False, mpi=False, phdf5=False, dagmc=False, libmesh=False): # Turn off OpenMP if specified if not omp: - cmake_cmd.append('-Dopenmp=off') + cmake_cmd.append('-DOPENMC_USE_OPENMP=off') # Use MPI wrappers when building in parallel if mpi: @@ -46,16 +46,16 @@ def install(omp=False, mpi=False, phdf5=False, dagmc=False, libmesh=False): cmake_cmd.append('-DHDF5_PREFER_PARALLEL=OFF') if dagmc: - cmake_cmd.append('-Ddagmc=ON') + cmake_cmd.append('-DOPENMC_USE_DAGMC=ON') cmake_cmd.append('-DCMAKE_PREFIX_PATH=~/DAGMC') if libmesh: - cmake_cmd.append('-Dlibmesh=ON') + cmake_cmd.append('-DOPENMC_USE_LIBMESH=ON') libmesh_path = os.environ.get('HOME') + '/LIBMESH' cmake_cmd.append('-DCMAKE_PREFIX_PATH=' + libmesh_path) # Build in coverage mode for coverage testing - cmake_cmd.append('-Dcoverage=on') + cmake_cmd.append('-DOPENMC_ENABLE_COVERAGE=on') # Build and install cmake_cmd.append('..')