Skip to content

Commit

Permalink
update scripts with new cmake flag names
Browse files Browse the repository at this point in the history
  • Loading branch information
kkiesling committed Mar 22, 2022
1 parent 97bec28 commit d24c180
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}. \
Expand All @@ -78,7 +78,7 @@ endif()
# libMesh Unstructured Mesh Support
#===============================================================================

if(libmesh)
if(OPENMC_USE_LIBMESH)
find_package(LIBMESH REQUIRED)
endif()

Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
8 changes: 4 additions & 4 deletions tools/ci/gha-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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('..')
Expand Down

0 comments on commit d24c180

Please sign in to comment.