2018-06-20 16:09:24 -05:00
|
|
|
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
|
2017-02-24 15:19:31 -06:00
|
|
|
project(openmc Fortran C CXX)
|
2013-11-29 13:36:06 -05:00
|
|
|
|
2013-12-01 22:09:35 -05:00
|
|
|
# Setup output directories
|
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
|
2015-08-31 11:13:21 +07:00
|
|
|
# Set module path
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
|
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Command line options
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2017-04-10 07:32:51 -05:00
|
|
|
option(openmp "Enable shared-memory parallelism with OpenMP" ON)
|
2013-11-29 13:36:06 -05:00
|
|
|
option(profile "Compile with profiling flags" OFF)
|
|
|
|
|
option(debug "Compile with debug flags" OFF)
|
|
|
|
|
option(optimize "Turn on all compiler optimization flags" OFF)
|
2015-07-06 08:12:34 +07:00
|
|
|
option(coverage "Compile with coverage analysis flags" OFF)
|
2015-04-17 17:19:34 -05:00
|
|
|
option(mpif08 "Use Fortran 2008 MPI interface" OFF)
|
2018-09-21 15:48:50 -04:00
|
|
|
option(dagmc "Enable support for DAGMC (CAD) geometry" OFF)
|
2018-02-23 01:31:26 -06:00
|
|
|
|
|
|
|
|
# Maximum number of nested coordinates levels
|
2015-07-06 07:45:21 +07:00
|
|
|
set(maxcoord 10 CACHE STRING "Maximum number of nested coordinate levels")
|
|
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
2015-08-31 11:13:21 +07:00
|
|
|
# MPI for distributed-memory parallelism
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
|
2014-02-24 18:06:14 -05:00
|
|
|
set(MPI_ENABLED FALSE)
|
2017-12-01 10:58:52 -06:00
|
|
|
if($ENV{FC} MATCHES "(mpi[^/]*|ftn)$")
|
2015-08-31 11:13:21 +07:00
|
|
|
message("-- Detected MPI wrapper: $ENV{FC}")
|
2014-02-24 18:06:14 -05:00
|
|
|
set(MPI_ENABLED TRUE)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
|
2015-04-17 17:19:34 -05:00
|
|
|
# Check for Fortran 2008 MPI interface
|
|
|
|
|
if(MPI_ENABLED AND mpif08)
|
2015-07-06 14:30:29 +07:00
|
|
|
message("-- Using Fortran 2008 MPI bindings")
|
2015-04-17 17:19:34 -05:00
|
|
|
endif()
|
|
|
|
|
|
2018-02-23 00:26:31 -06:00
|
|
|
#===============================================================================
|
2018-09-21 15:48:50 -04:00
|
|
|
# DAGMC Geometry Support - need DAGMC/MOAB
|
2018-02-23 00:26:31 -06:00
|
|
|
#===============================================================================
|
2018-09-21 15:48:50 -04:00
|
|
|
if(dagmc)
|
2018-02-23 00:26:31 -06:00
|
|
|
find_package(DAGMC REQUIRED)
|
|
|
|
|
if(NOT DAGMC_FOUND)
|
|
|
|
|
message(FATAL_ERROR "Could not find DAGMC installation")
|
|
|
|
|
endif()
|
2018-02-28 10:03:59 -06:00
|
|
|
link_directories(${DAGMC_LIBRARY_DIRS})
|
2018-02-23 00:26:31 -06:00
|
|
|
endif()
|
|
|
|
|
|
2015-08-31 11:13:21 +07:00
|
|
|
#===============================================================================
|
|
|
|
|
# HDF5 for binary output
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2018-09-12 23:38:16 -05:00
|
|
|
# Allow user to specify HDF5_ROOT
|
2018-09-24 15:15:38 -05:00
|
|
|
if (NOT (CMAKE_VERSION VERSION_LESS 3.12))
|
2018-09-12 23:38:16 -05:00
|
|
|
cmake_policy(SET CMP0074 NEW)
|
|
|
|
|
endif()
|
|
|
|
|
|
2015-08-31 11:13:21 +07:00
|
|
|
# Unfortunately FindHDF5.cmake will always prefer a serial HDF5 installation
|
|
|
|
|
# over a parallel installation if both appear on the user's PATH. To get around
|
|
|
|
|
# this, we check for the environment variable HDF5_ROOT and if it exists, use it
|
|
|
|
|
# to check whether its a parallel version.
|
|
|
|
|
|
2017-07-10 14:55:16 -05:00
|
|
|
if(NOT DEFINED HDF5_PREFER_PARALLEL)
|
|
|
|
|
if(DEFINED ENV{HDF5_ROOT} AND EXISTS $ENV{HDF5_ROOT}/bin/h5pcc)
|
|
|
|
|
set(HDF5_PREFER_PARALLEL TRUE)
|
|
|
|
|
else()
|
|
|
|
|
set(HDF5_PREFER_PARALLEL FALSE)
|
|
|
|
|
endif()
|
2015-08-31 11:13:21 +07:00
|
|
|
endif()
|
|
|
|
|
|
2018-04-24 23:03:21 -05:00
|
|
|
find_package(HDF5 COMPONENTS HL)
|
2015-08-31 11:13:21 +07:00
|
|
|
if(NOT HDF5_FOUND)
|
|
|
|
|
message(FATAL_ERROR "Could not find HDF5")
|
|
|
|
|
endif()
|
|
|
|
|
if(HDF5_IS_PARALLEL)
|
|
|
|
|
if(NOT MPI_ENABLED)
|
|
|
|
|
message(FATAL_ERROR "Parallel HDF5 must be used with MPI.")
|
|
|
|
|
endif()
|
|
|
|
|
message("-- Using parallel HDF5")
|
|
|
|
|
endif()
|
|
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Set compile/link flags based on which compiler is being used
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2018-06-20 13:14:21 -05:00
|
|
|
if(openmp)
|
2018-06-20 16:09:24 -05:00
|
|
|
# Requires CMake 3.1+
|
2018-06-20 13:14:21 -05:00
|
|
|
find_package(OpenMP)
|
|
|
|
|
if(OPENMP_FOUND)
|
|
|
|
|
list(APPEND f90flags ${OpenMP_Fortran_FLAGS})
|
|
|
|
|
list(APPEND cxxflags ${OpenMP_CXX_FLAGS})
|
|
|
|
|
list(APPEND ldflags ${OpenMP_Fortran_FLAGS})
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
2015-08-29 16:32:02 +07:00
|
|
|
|
2017-06-08 20:17:07 -05:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
|
2015-08-29 16:32:02 +07:00
|
|
|
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
|
2015-05-13 15:41:48 +07:00
|
|
|
# Make sure version is sufficient
|
|
|
|
|
execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -dumpversion
|
|
|
|
|
OUTPUT_VARIABLE GCC_VERSION)
|
2018-08-08 23:06:10 -05:00
|
|
|
if(GCC_VERSION VERSION_LESS 4.9)
|
|
|
|
|
message(FATAL_ERROR "gcc version must be 4.9 or higher")
|
2015-05-13 15:41:48 +07:00
|
|
|
endif()
|
|
|
|
|
|
2016-02-01 12:27:51 -06:00
|
|
|
# GCC compiler options
|
2018-01-15 16:44:18 -06:00
|
|
|
list(APPEND f90flags -cpp -std=f2008ts -fbacktrace -O2 -fstack-arrays)
|
2013-11-29 13:36:06 -05:00
|
|
|
if(debug)
|
2018-01-15 16:44:18 -06:00
|
|
|
list(REMOVE_ITEM f90flags -O2 -fstack-arrays)
|
2017-08-24 11:39:50 -05:00
|
|
|
list(APPEND f90flags -g -Wall -Wno-unused-dummy-argument -pedantic
|
|
|
|
|
-fbounds-check -ffpe-trap=invalid,overflow,underflow)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND ldflags -g)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
if(profile)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -pg)
|
|
|
|
|
list(APPEND ldflags -pg)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
if(optimize)
|
2017-04-06 13:14:23 -05:00
|
|
|
list(REMOVE_ITEM f90flags -O2)
|
2016-07-21 09:52:47 -05:00
|
|
|
list(APPEND f90flags -O3)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
2014-03-06 16:46:19 -05:00
|
|
|
if(coverage)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -coverage)
|
|
|
|
|
list(APPEND ldflags -coverage)
|
2014-03-06 16:46:19 -05:00
|
|
|
endif()
|
2013-11-29 13:36:06 -05:00
|
|
|
|
2015-08-29 16:32:02 +07:00
|
|
|
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
|
2016-02-01 12:27:51 -06:00
|
|
|
# Intel compiler options
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -fpp -std08 -assume byterecl -traceback)
|
2013-11-29 13:36:06 -05:00
|
|
|
if(debug)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -g -warn -ftrapuv -fp-stack-check
|
2017-04-07 12:08:10 -05:00
|
|
|
"-check all" -fpe0 -O0)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND ldflags -g)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
if(profile)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -pg)
|
|
|
|
|
list(APPEND ldflags -pg)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
if(optimize)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -O3)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
|
2015-08-29 16:32:02 +07:00
|
|
|
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL PGI)
|
2013-11-29 13:36:06 -05:00
|
|
|
# PGI Fortran compiler options
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -Mpreprocess -Minform=inform -traceback)
|
2013-11-29 13:36:06 -05:00
|
|
|
add_definitions(-DNO_F2008)
|
|
|
|
|
if(debug)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -g -Mbounds -Mchkptr -Mchkstk)
|
|
|
|
|
list(APPEND ldflags -g)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
if(profile)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -pg)
|
|
|
|
|
list(APPEND ldflags -pg)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
if(optimize)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -fast -Mipa)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
|
2015-08-29 16:32:02 +07:00
|
|
|
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
|
2013-11-29 13:36:06 -05:00
|
|
|
# IBM XL compiler options
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -O2)
|
2015-04-26 10:03:53 +00:00
|
|
|
add_definitions(-DNO_F2008)
|
2013-11-29 13:36:06 -05:00
|
|
|
if(debug)
|
2017-04-07 12:08:10 -05:00
|
|
|
list(REMOVE_ITEM f90flags -O2)
|
|
|
|
|
list(APPEND f90flags -g -C -qflag=i:i -u -O0)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND ldflags -g)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
if(profile)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -p)
|
|
|
|
|
list(APPEND ldflags -p)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
if(optimize)
|
2017-04-06 13:14:23 -05:00
|
|
|
list(REMOVE_ITEM f90flags -O2)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -O3)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
|
2015-08-29 16:32:02 +07:00
|
|
|
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Cray)
|
2013-11-29 13:36:06 -05:00
|
|
|
# Cray Fortran compiler options
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -e Z -m 0)
|
2013-11-29 13:36:06 -05:00
|
|
|
if(debug)
|
2015-08-29 16:32:02 +07:00
|
|
|
list(APPEND f90flags -g -R abcnsp -O0)
|
|
|
|
|
list(APPEND ldflags -g)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
2017-06-13 07:31:21 -05:00
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL GNU)
|
|
|
|
|
# GCC compiler options
|
2018-06-20 16:25:45 -05:00
|
|
|
list(APPEND cflags -O2)
|
2017-06-13 07:31:21 -05:00
|
|
|
if(debug)
|
|
|
|
|
list(REMOVE_ITEM cflags -O2)
|
|
|
|
|
list(APPEND cflags -g -Wall -pedantic -fbounds-check)
|
|
|
|
|
endif()
|
|
|
|
|
if(profile)
|
|
|
|
|
list(APPEND cflags -pg)
|
|
|
|
|
endif()
|
|
|
|
|
if(optimize)
|
|
|
|
|
list(REMOVE_ITEM cflags -O2)
|
|
|
|
|
list(APPEND cflags -O3)
|
|
|
|
|
endif()
|
|
|
|
|
if(coverage)
|
|
|
|
|
list(APPEND cflags -coverage)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
elseif(CMAKE_C_COMPILER_ID STREQUAL Intel)
|
|
|
|
|
# Intel compiler options
|
|
|
|
|
if(debug)
|
|
|
|
|
list(APPEND cflags -g -w3 -ftrapuv -fp-stack-check -O0)
|
|
|
|
|
endif()
|
|
|
|
|
if(profile)
|
|
|
|
|
list(APPEND cflags -pg)
|
|
|
|
|
endif()
|
|
|
|
|
if(optimize)
|
|
|
|
|
list(APPEND cflags -O3)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
elseif(CMAKE_C_COMPILER_ID MATCHES Clang)
|
|
|
|
|
# Clang options
|
|
|
|
|
if(debug)
|
|
|
|
|
list(APPEND cflags -g -O0 -ftrapv)
|
|
|
|
|
endif()
|
|
|
|
|
if(optimize)
|
|
|
|
|
list(APPEND cflags -O3)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
2018-07-06 10:49:24 -05:00
|
|
|
list(APPEND cxxflags -std=c++14 -O2)
|
2017-12-01 16:45:28 -05:00
|
|
|
if(debug)
|
|
|
|
|
list(REMOVE_ITEM cxxflags -O2)
|
|
|
|
|
list(APPEND cxxflags -g -O0)
|
|
|
|
|
endif()
|
|
|
|
|
if(profile)
|
|
|
|
|
list(APPEND cxxflags -pg)
|
|
|
|
|
endif()
|
|
|
|
|
if(optimize)
|
|
|
|
|
list(REMOVE_ITEM cxxflags -O2)
|
|
|
|
|
list(APPEND cxxflags -O3)
|
|
|
|
|
endif()
|
|
|
|
|
|
2017-04-10 07:26:48 -05:00
|
|
|
# Show flags being used
|
|
|
|
|
message(STATUS "Fortran flags: ${f90flags}")
|
|
|
|
|
message(STATUS "C flags: ${cflags}")
|
2017-12-11 15:31:31 -05:00
|
|
|
message(STATUS "C++ flags: ${cxxflags}")
|
2017-04-10 07:26:48 -05:00
|
|
|
message(STATUS "Linker flags: ${ldflags}")
|
|
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
2017-02-24 15:19:31 -06:00
|
|
|
# pugixml library
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
|
2018-06-20 10:56:28 -05:00
|
|
|
add_library(pugixml vendor/pugixml/pugixml.cpp)
|
|
|
|
|
target_include_directories(pugixml PUBLIC vendor/pugixml/)
|
2013-11-29 13:36:06 -05:00
|
|
|
|
2018-07-06 10:49:24 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# xtensor header-only library
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
|
|
add_subdirectory(vendor/xtl)
|
|
|
|
|
add_subdirectory(vendor/xtensor)
|
|
|
|
|
target_link_libraries(xtensor INTERFACE xtl)
|
|
|
|
|
|
2015-12-04 21:39:00 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# RPATH information
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2017-11-22 07:33:11 -06:00
|
|
|
# This block of code ensures that dynamic libraries can be found via the RPATH
|
|
|
|
|
# whether the executable is the original one from the build directory or the
|
|
|
|
|
# installed one in CMAKE_INSTALL_PREFIX. Ref:
|
2018-06-20 16:09:24 -05:00
|
|
|
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
|
2017-11-22 07:33:11 -06:00
|
|
|
|
|
|
|
|
# use, i.e. don't skip the full RPATH for the build tree
|
|
|
|
|
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
|
|
|
|
|
|
|
|
|
# when building, don't use the install RPATH already
|
|
|
|
|
# (but later on when installing)
|
|
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
|
|
|
|
|
2015-12-04 21:39:00 -05:00
|
|
|
# add the automatically determined parts of the RPATH
|
|
|
|
|
# which point to directories outside the build tree to the install RPATH
|
|
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
|
|
2017-11-22 07:33:11 -06:00
|
|
|
# the RPATH to be used when installing, but only if it's not a system directory
|
|
|
|
|
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
|
|
|
|
if("${isSystemDir}" STREQUAL "-1")
|
|
|
|
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
|
|
|
|
endif()
|
|
|
|
|
|
2016-02-01 12:27:51 -06:00
|
|
|
#===============================================================================
|
2018-06-20 12:36:33 -05:00
|
|
|
# faddeeva library
|
2016-02-01 12:27:51 -06:00
|
|
|
#===============================================================================
|
|
|
|
|
|
2018-06-20 07:27:59 -05:00
|
|
|
add_library(faddeeva STATIC vendor/faddeeva/Faddeeva.c)
|
|
|
|
|
target_compile_options(faddeeva PRIVATE ${cflags})
|
2018-06-20 16:25:45 -05:00
|
|
|
set_target_properties(faddeeva PROPERTIES
|
|
|
|
|
C_STANDARD 99
|
|
|
|
|
C_STANDARD_REQUIRED ON)
|
2016-02-01 12:27:51 -06:00
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
2018-06-20 12:36:33 -05:00
|
|
|
# libopenmc
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
|
2018-06-20 16:09:24 -05:00
|
|
|
add_library(libopenmc SHARED
|
2017-01-16 19:58:15 -06:00
|
|
|
src/algorithm.F90
|
|
|
|
|
src/bank_header.F90
|
2017-06-14 15:28:07 -05:00
|
|
|
src/api.F90
|
2018-09-21 15:48:50 -04:00
|
|
|
src/dagmc_header.F90
|
2017-01-16 19:58:15 -06:00
|
|
|
src/cmfd_data.F90
|
|
|
|
|
src/cmfd_execute.F90
|
|
|
|
|
src/cmfd_header.F90
|
|
|
|
|
src/cmfd_input.F90
|
|
|
|
|
src/cmfd_loss_operator.F90
|
|
|
|
|
src/cmfd_prod_operator.F90
|
|
|
|
|
src/cmfd_solver.F90
|
|
|
|
|
src/constants.F90
|
|
|
|
|
src/dict_header.F90
|
|
|
|
|
src/eigenvalue.F90
|
|
|
|
|
src/endf.F90
|
|
|
|
|
src/endf_header.F90
|
|
|
|
|
src/error.F90
|
|
|
|
|
src/geometry.F90
|
|
|
|
|
src/geometry_header.F90
|
|
|
|
|
src/hdf5_interface.F90
|
|
|
|
|
src/initialize.F90
|
|
|
|
|
src/input_xml.F90
|
|
|
|
|
src/list_header.F90
|
|
|
|
|
src/material_header.F90
|
|
|
|
|
src/math.F90
|
|
|
|
|
src/matrix_header.F90
|
|
|
|
|
src/mesh_header.F90
|
|
|
|
|
src/message_passing.F90
|
|
|
|
|
src/mgxs_data.F90
|
2018-06-13 20:22:51 -04:00
|
|
|
src/mgxs_interface.F90
|
2017-01-16 19:58:15 -06:00
|
|
|
src/multipole_header.F90
|
|
|
|
|
src/nuclide_header.F90
|
|
|
|
|
src/output.F90
|
|
|
|
|
src/particle_header.F90
|
|
|
|
|
src/particle_restart.F90
|
2017-06-27 21:36:33 -05:00
|
|
|
src/photon_header.F90
|
2017-06-28 14:32:03 -05:00
|
|
|
src/photon_physics.F90
|
2017-01-16 19:58:15 -06:00
|
|
|
src/physics_common.F90
|
|
|
|
|
src/physics.F90
|
|
|
|
|
src/physics_mg.F90
|
|
|
|
|
src/plot.F90
|
|
|
|
|
src/plot_header.F90
|
|
|
|
|
src/progress_header.F90
|
2018-06-20 10:56:28 -05:00
|
|
|
src/pugixml/pugixml_f.F90
|
2017-01-16 19:58:15 -06:00
|
|
|
src/random_lcg.F90
|
|
|
|
|
src/reaction_header.F90
|
|
|
|
|
src/relaxng
|
|
|
|
|
src/sab_header.F90
|
|
|
|
|
src/set_header.F90
|
2017-08-17 16:18:55 -05:00
|
|
|
src/settings.F90
|
2017-08-24 12:20:59 -05:00
|
|
|
src/simulation_header.F90
|
2017-01-16 19:58:15 -06:00
|
|
|
src/simulation.F90
|
|
|
|
|
src/state_point.F90
|
|
|
|
|
src/stl_vector.F90
|
|
|
|
|
src/string.F90
|
|
|
|
|
src/summary.F90
|
|
|
|
|
src/surface_header.F90
|
|
|
|
|
src/timer_header.F90
|
|
|
|
|
src/tracking.F90
|
|
|
|
|
src/track_output.F90
|
|
|
|
|
src/urr_header.F90
|
|
|
|
|
src/vector_header.F90
|
|
|
|
|
src/volume_calc.F90
|
|
|
|
|
src/volume_header.F90
|
2017-08-09 10:57:36 -05:00
|
|
|
src/xml_interface.F90
|
|
|
|
|
src/tallies/tally.F90
|
2017-09-01 14:59:15 -05:00
|
|
|
src/tallies/tally_derivative_header.F90
|
2017-08-09 10:57:36 -05:00
|
|
|
src/tallies/tally_filter.F90
|
|
|
|
|
src/tallies/tally_filter_header.F90
|
2017-08-24 11:39:50 -05:00
|
|
|
src/tallies/tally_filter_azimuthal.F90
|
|
|
|
|
src/tallies/tally_filter_cell.F90
|
|
|
|
|
src/tallies/tally_filter_cellborn.F90
|
|
|
|
|
src/tallies/tally_filter_cellfrom.F90
|
|
|
|
|
src/tallies/tally_filter_delayedgroup.F90
|
2017-08-17 11:58:57 -05:00
|
|
|
src/tallies/tally_filter_distribcell.F90
|
2017-08-10 11:08:13 -05:00
|
|
|
src/tallies/tally_filter_energy.F90
|
2017-08-24 11:39:50 -05:00
|
|
|
src/tallies/tally_filter_energyfunc.F90
|
2017-09-05 10:14:46 -05:00
|
|
|
src/tallies/tally_filter_legendre.F90
|
2017-08-16 10:39:14 -05:00
|
|
|
src/tallies/tally_filter_material.F90
|
2017-08-09 11:30:17 -05:00
|
|
|
src/tallies/tally_filter_mesh.F90
|
2018-03-15 14:07:42 -05:00
|
|
|
src/tallies/tally_filter_meshsurface.F90
|
2017-08-24 11:39:50 -05:00
|
|
|
src/tallies/tally_filter_mu.F90
|
2017-11-11 14:28:38 -06:00
|
|
|
src/tallies/tally_filter_particle.F90
|
2017-08-24 11:39:50 -05:00
|
|
|
src/tallies/tally_filter_polar.F90
|
2017-09-05 14:12:39 -05:00
|
|
|
src/tallies/tally_filter_sph_harm.F90
|
2018-01-04 15:28:15 -06:00
|
|
|
src/tallies/tally_filter_sptl_legendre.F90
|
2017-08-24 11:39:50 -05:00
|
|
|
src/tallies/tally_filter_surface.F90
|
|
|
|
|
src/tallies/tally_filter_universe.F90
|
2018-01-09 22:35:37 -06:00
|
|
|
src/tallies/tally_filter_zernike.F90
|
2017-08-09 10:57:36 -05:00
|
|
|
src/tallies/tally_header.F90
|
|
|
|
|
src/tallies/trigger.F90
|
|
|
|
|
src/tallies/trigger_header.F90
|
2018-09-21 15:48:50 -04:00
|
|
|
src/dagmc.cpp
|
2018-02-03 16:27:33 -05:00
|
|
|
src/cell.cpp
|
2018-09-05 06:35:38 -05:00
|
|
|
src/cmfd_execute.cpp
|
2018-07-02 22:10:38 -05:00
|
|
|
src/distribution.cpp
|
2018-07-09 17:04:48 -05:00
|
|
|
src/distribution_angle.cpp
|
2018-07-09 14:47:08 -05:00
|
|
|
src/distribution_energy.cpp
|
2018-07-05 07:01:19 -05:00
|
|
|
src/distribution_multi.cpp
|
|
|
|
|
src/distribution_spatial.cpp
|
2018-08-30 14:22:55 -05:00
|
|
|
src/eigenvalue.cpp
|
2018-07-09 09:27:34 -05:00
|
|
|
src/endf.cpp
|
2018-04-20 06:38:16 -05:00
|
|
|
src/initialize.cpp
|
2018-04-26 07:03:40 -05:00
|
|
|
src/finalize.cpp
|
2018-08-14 16:22:40 -04:00
|
|
|
src/geometry.cpp
|
2018-05-11 17:20:25 -04:00
|
|
|
src/geometry_aux.cpp
|
2018-04-17 14:08:59 -05:00
|
|
|
src/hdf5_interface.cpp
|
2018-02-04 23:15:32 -05:00
|
|
|
src/lattice.cpp
|
2018-08-15 16:08:32 -04:00
|
|
|
src/material.cpp
|
2018-04-30 15:33:36 -04:00
|
|
|
src/math_functions.cpp
|
2018-08-28 06:59:39 -05:00
|
|
|
src/mesh.cpp
|
2018-04-20 07:02:59 -05:00
|
|
|
src/message_passing.cpp
|
2018-06-08 16:18:37 -04:00
|
|
|
src/mgxs.cpp
|
2018-06-13 20:22:51 -04:00
|
|
|
src/mgxs_interface.cpp
|
2018-07-17 06:43:35 -05:00
|
|
|
src/nuclide.cpp
|
2018-08-14 19:04:05 -04:00
|
|
|
src/output.cpp
|
2018-07-06 06:36:05 -05:00
|
|
|
src/particle.cpp
|
2018-04-24 22:42:04 -05:00
|
|
|
src/plot.cpp
|
2018-08-08 13:36:42 -05:00
|
|
|
src/position.cpp
|
2018-06-20 10:56:28 -05:00
|
|
|
src/pugixml/pugixml_c.cpp
|
2017-08-08 18:10:53 -04:00
|
|
|
src/random_lcg.cpp
|
2018-07-11 07:01:54 -05:00
|
|
|
src/reaction.cpp
|
2018-07-10 22:49:37 -05:00
|
|
|
src/reaction_product.cpp
|
2018-07-10 15:32:18 -05:00
|
|
|
src/secondary_correlated.cpp
|
2018-07-10 07:36:46 -05:00
|
|
|
src/secondary_kalbach.cpp
|
2018-07-09 23:26:05 -05:00
|
|
|
src/secondary_nbody.cpp
|
2018-07-09 23:02:27 -05:00
|
|
|
src/secondary_uncorrelated.cpp
|
2018-06-08 16:18:37 -04:00
|
|
|
src/scattdata.cpp
|
2018-08-06 21:31:30 -05:00
|
|
|
src/settings.cpp
|
2018-04-12 07:45:47 -05:00
|
|
|
src/simulation.cpp
|
2018-07-17 06:43:35 -05:00
|
|
|
src/source.cpp
|
2018-04-20 11:03:40 -05:00
|
|
|
src/state_point.cpp
|
2018-06-13 20:22:51 -04:00
|
|
|
src/string_functions.cpp
|
2018-08-24 19:06:04 -04:00
|
|
|
src/summary.cpp
|
2018-01-23 22:26:48 -05:00
|
|
|
src/surface.cpp
|
2018-09-07 17:26:57 -04:00
|
|
|
src/tallies/tally_filter.cpp
|
2018-08-14 22:21:41 -05:00
|
|
|
src/thermal.cpp
|
2018-04-20 07:25:35 -05:00
|
|
|
src/xml_interface.cpp
|
2018-06-20 10:56:28 -05:00
|
|
|
src/xsdata.cpp)
|
2018-02-23 10:40:43 -06:00
|
|
|
|
2018-04-24 06:42:43 -05:00
|
|
|
set_target_properties(libopenmc PROPERTIES
|
|
|
|
|
OUTPUT_NAME openmc
|
2018-06-20 12:22:48 -05:00
|
|
|
LINKER_LANGUAGE Fortran)
|
2015-08-29 16:32:02 +07:00
|
|
|
|
2018-06-20 12:36:33 -05:00
|
|
|
target_include_directories(libopenmc
|
|
|
|
|
PUBLIC include
|
|
|
|
|
PRIVATE ${HDF5_INCLUDE_DIRS})
|
2015-09-14 20:36:51 +07:00
|
|
|
|
2017-12-01 16:45:28 -05:00
|
|
|
# The libopenmc library has both F90 and C++ so the compile flags must be set
|
2018-06-20 16:09:24 -05:00
|
|
|
# differently depending on the language. The $<COMPILE_LANGUAGE> generator
|
|
|
|
|
# expression was added in CMake 3.3
|
|
|
|
|
target_compile_options(libopenmc PRIVATE
|
|
|
|
|
$<$<COMPILE_LANGUAGE:Fortran>:${f90flags}>
|
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:${cxxflags}>)
|
2017-12-01 16:45:28 -05:00
|
|
|
|
2018-06-20 12:36:33 -05:00
|
|
|
target_compile_definitions(libopenmc PRIVATE -DMAX_COORD=${maxcoord})
|
|
|
|
|
if (UNIX)
|
|
|
|
|
# Used in progress_header.F90 for calling check_isatty
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE -DUNIX)
|
|
|
|
|
endif()
|
|
|
|
|
if (HDF5_IS_PARALLEL)
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE -DPHDF5)
|
|
|
|
|
endif()
|
|
|
|
|
if (MPI_ENABLED)
|
|
|
|
|
target_compile_definitions(libopenmc PUBLIC -DOPENMC_MPI)
|
|
|
|
|
if (mpif08)
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE -DOPENMC_MPIF08)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
2015-08-29 16:32:02 +07:00
|
|
|
|
2018-06-20 13:08:05 -05:00
|
|
|
# Set git SHA1 hash as a compile definition
|
|
|
|
|
execute_process(COMMAND git rev-parse HEAD
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
RESULT_VARIABLE GIT_SHA1_SUCCESS
|
|
|
|
|
OUTPUT_VARIABLE GIT_SHA1
|
|
|
|
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
if(GIT_SHA1_SUCCESS EQUAL 0)
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE -DGIT_SHA1="${GIT_SHA1}")
|
|
|
|
|
endif()
|
2015-08-29 16:32:02 +07:00
|
|
|
|
|
|
|
|
# target_link_libraries treats any arguments starting with - but not -l as
|
|
|
|
|
# linker flags. Thus, we can pass both linker flags and libraries together.
|
2018-06-20 10:56:28 -05:00
|
|
|
target_link_libraries(libopenmc ${ldflags} ${HDF5_LIBRARIES} pugixml
|
2018-07-06 10:49:24 -05:00
|
|
|
faddeeva xtensor)
|
2018-06-20 12:22:48 -05:00
|
|
|
|
2018-09-25 21:57:12 -05:00
|
|
|
if(dagmc)
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE DAGMC)
|
|
|
|
|
target_link_libraries(libopenmc ${DAGMC_LIBRARIES})
|
|
|
|
|
target_include_directories(libopenmc PRIVATE ${DAGMC_INCLUDE_DIRS})
|
|
|
|
|
endif()
|
2018-06-20 12:22:48 -05:00
|
|
|
|
|
|
|
|
#===============================================================================
|
|
|
|
|
# openmc executable
|
|
|
|
|
#===============================================================================
|
|
|
|
|
add_executable(openmc src/main.cpp)
|
2018-06-20 12:36:33 -05:00
|
|
|
target_compile_options(openmc PRIVATE ${cxxflags})
|
2018-06-20 12:22:48 -05:00
|
|
|
target_link_libraries(openmc libopenmc)
|
2013-12-05 23:32:08 -05:00
|
|
|
|
2017-06-09 11:58:14 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Python package
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
|
|
add_custom_command(TARGET libopenmc POST_BUILD
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
|
|
|
$<TARGET_FILE:libopenmc>
|
2017-09-14 12:52:37 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/openmc/capi/$<TARGET_FILE_NAME:libopenmc>
|
2017-06-09 11:58:14 -05:00
|
|
|
COMMENT "Copying libopenmc to Python module directory")
|
|
|
|
|
|
2013-12-05 23:32:08 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Install executable, scripts, manpage, license
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2018-06-20 12:01:51 -05:00
|
|
|
install(TARGETS openmc libopenmc
|
2017-11-22 07:33:11 -06:00
|
|
|
RUNTIME DESTINATION bin
|
2018-02-23 14:59:13 -06:00
|
|
|
LIBRARY DESTINATION lib
|
2018-04-24 06:42:43 -05:00
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
|
)
|
2015-05-31 15:22:30 +07:00
|
|
|
install(DIRECTORY src/relaxng DESTINATION share/openmc)
|
2015-05-22 13:43:29 +07:00
|
|
|
install(FILES man/man1/openmc.1 DESTINATION share/man/man1)
|
2018-06-20 12:01:51 -05:00
|
|
|
install(FILES LICENSE DESTINATION "share/doc/openmc" RENAME copyright)
|
2018-08-20 14:55:25 -05:00
|
|
|
install(DIRECTORY include/ DESTINATION include)
|