update scripts with new cmake flag names

This commit is contained in:
Kalin Kiesling 2022-03-22 10:46:34 -05:00
parent 97bec28380
commit d24c180592
3 changed files with 20 additions and 20 deletions

View file

@ -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()

View file

@ -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 \

View file

@ -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('..')