Skip to content

Commit

Permalink
Merge branch 'improvement.cmake.libraries' into 'master.dev'
Browse files Browse the repository at this point in the history
[improvement.cmake.libraries] Detect libraries present on the system, set CMake defaults accordingly

See merge request piclas/piclas!922
  • Loading branch information
kopperp committed Mar 23, 2024
2 parents d55cef4 + 35810da commit 31d376e
Show file tree
Hide file tree
Showing 11 changed files with 350 additions and 195 deletions.
94 changes: 68 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# =========================================================================
# CMake configuration
# =========================================================================
MESSAGE(STATUS "Generating with [cmake] (${CMAKE_VERSION})")
# NOTE: use minimum CMake version required
CMAKE_MINIMUM_REQUIRED(VERSION 3.6.3)
# Policies (see https://cmake.org/cmake/help/v3.13/manual/cmake-policies.7.html)
Expand Down Expand Up @@ -63,32 +64,72 @@ INCLUDE(CMakeDependentOption)
OPTION(PICLAS_PERFORMANCE "Enable performance optimizations (e.g. PGO for GNU)" OFF)

# =========================================================================
# Check gold support
# =========================================================================
EXECUTE_PROCESS(COMMAND ld.gold --version COMMAND grep "^GNU gold" COMMAND sed "s/^.* //g" OUTPUT_VARIABLE GNU_GOLD_VERSION)
IF (DEFINED GNU_GOLD_VERSION AND NOT "${GNU_GOLD_VERSION}" STREQUAL "")
STRING(STRIP "${GNU_GOLD_VERSION}" GNU_GOLD_VERSION)
MESSAGE(STATUS "Setting linker to [gold] (v${GNU_GOLD_VERSION})")
# Shift responsibility of driving the final stages of compilation from collect2 to gold via the linker plugin
# More information at: https://gcc.gnu.org/wiki/LinkTimeOptimization
IF(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
ADD_LINK_OPTIONS("-fuse-ld=gold")
# Make it abundantly clear we want to use gold
FIND_PROGRAM(CMAKE_GOLD_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld.gold${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
SET (CMAKE_LINKER "${CMAKE_GOLD_LINKER}" CACHE FILEPATH "" FORCE)
MARK_AS_ADVANCED(FORCE CMAKE_GOLD_LINKER)
# Check lld / gold support
# =========================================================================
# EXECUTE_PROCESS(COMMAND ld.lld --version COMMAND grep "^LLD" COMMAND grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" OUTPUT_VARIABLE LLD_VERSION)
# # lld should be faster than gold
# IF (DEFINED LLD_VERSION AND NOT "${LLD_VERSION}" STREQUAL "")
# STRING(STRIP "${LLD_VERSION}" LLD_VERSION)
# MESSAGE(STATUS "Setting linker to [lld] (v${LLD_VERSION})")
# # Shift responsibility of driving the final stages of compilation from collect2 to gold via the linker plugin
# # More information at: https://gcc.gnu.org/wiki/LinkTimeOptimization
# IF(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
# ADD_LINK_OPTIONS("-fuse-ld=lld")
# # Make it abundantly clear we want to use lld
# FIND_PROGRAM(LLD_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld.lld${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
# SET (CMAKE_LINKER "${LLD_LINKER}" CACHE FILEPATH "" FORCE)
# MARK_AS_ADVANCED(FORCE LLD_LINKER)
# ELSE()
# SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")
# SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld")
# SET (CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fuse-ld=lld")
# SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=lld")
# # Make it abundantly clear we want to use lld
# FIND_PROGRAM(LLD_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld.lld${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
# SET (CMAKE_LINKER "${LLD_LINKER}" CACHE FILEPATH "" FORCE)
# MARK_AS_ADVANCED(FORCE LLD_LINKER)
# ENDIF()
# # gold should be faster than GNU ld
# ELSE()
EXECUTE_PROCESS(COMMAND ld.gold --version COMMAND grep "^GNU gold" COMMAND sed "s/^.* //g" OUTPUT_VARIABLE GNU_GOLD_VERSION)
IF (DEFINED GNU_GOLD_VERSION AND NOT "${GNU_GOLD_VERSION}" STREQUAL "")
STRING(STRIP "${GNU_GOLD_VERSION}" GNU_GOLD_VERSION)
MESSAGE(STATUS "Linking with [gold] (v${GNU_GOLD_VERSION})")
# Shift responsibility of driving the final stages of compilation from collect2 to gold via the linker plugin
# More information at: https://gcc.gnu.org/wiki/LinkTimeOptimization
IF(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
ADD_LINK_OPTIONS("-fuse-ld=gold")
# Make it abundantly clear we want to use gold
FIND_PROGRAM(CMAKE_GOLD_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld.gold${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
SET (CMAKE_LINKER "${CMAKE_GOLD_LINKER}" CACHE FILEPATH "" FORCE)
MARK_AS_ADVANCED(FORCE CMAKE_GOLD_LINKER)
ELSE()
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold")
# This currently breaks ar (binutils archiver)
# SET (CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fuse-ld=gold")
SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=gold")
# Make it abundantly clear we want to use gold
FIND_PROGRAM(CMAKE_GOLD_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld.gold${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
SET (CMAKE_LINKER "${CMAKE_GOLD_LINKER}" CACHE FILEPATH "" FORCE)
MARK_AS_ADVANCED(FORCE CMAKE_GOLD_LINKER)
ENDIF()
# Found neither lld nor gold, output GNU ld
ELSE()
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold")
# This currently breaks ar (binutils archiver)
# SET (CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fuse-ld=gold")
SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=gold")
# Make it abundantly clear we want to use gold
FIND_PROGRAM(CMAKE_GOLD_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld.gold${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
SET (CMAKE_LINKER "${CMAKE_GOLD_LINKER}" CACHE FILEPATH "" FORCE)
MARK_AS_ADVANCED(FORCE CMAKE_GOLD_LINKER)
EXECUTE_PROCESS(COMMAND ld --version OUTPUT_VARIABLE GNU_LD_STRING)
# Check if we actually got GNU ld
IF (GNU_LD_STRING MATCHES "^GNU ld")
EXECUTE_PROCESS(COMMAND ld --version COMMAND grep "^GNU ld" COMMAND sed "s/^.* //g" OUTPUT_VARIABLE GNU_LD_VERSION)
STRING(STRIP "${GNU_LD_VERSION}" GNU_LD_VERSION)
MESSAGE(STATUS "Linking with [ld] (v${GNU_LD_VERSION})")
# ... or if we are running mold
ELSEIF (GNU_LD_STRING MATCHES "^mold")
EXECUTE_PROCESS(COMMAND ld --version COMMAND grep "^mold" COMMAND grep -Eo "[0-9]+\.[0-9]+\.[0-9]+ " OUTPUT_VARIABLE GNU_MOLD_VERSION)
STRING(STRIP "${GNU_MOLD_VERSION}" GNU_MOLD_VERSION)
MESSAGE(STATUS "Linking with [mold] (v${GNU_MOLD_VERSION})")
ENDIF()
ENDIF()
ENDIF()
# ENDIF()

# =========================================================================
# code development
Expand Down Expand Up @@ -212,6 +253,7 @@ ELSE()
ENDIF()
ENDIF()
ENDIF()
MESSAGE(STATUS "Compiling with [${BUILD_TYPE_LC}] build type")

# =========================================================================
# Location of binary and filenames
Expand Down Expand Up @@ -248,12 +290,12 @@ endfunction()
# A function to get all user defined variables with a specified prefix
SET(configuration ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/configuration.cmake)
FILE(WRITE ${configuration} "")
GETLISTOFVARSSTARTINGWITH("PICLAS_" piclasVars)
GETLISTOFVARSSTARTINGWITH("PICLAS_" piclasVars1)
GETLISTOFVARSSTARTINGWITH("HDF5_" piclasVars2)
GETLISTOFVARSSTARTINGWITH("CMAKE_" piclasVars3)
GETLISTOFVARSSTARTINGWITH("POSTI_" piclasVars4)
GETLISTOFVARSSTARTINGWITH("LIBS_" piclasVars5)
FOREACH (_var IN LISTS piclasVars piclasVars2 piclasVars3 piclasVars4 piclasVars5)
FOREACH (_var IN LISTS piclasVars1 piclasVars2 piclasVars3 piclasVars4 piclasVars5)
GET_PROPERTY(currentHelpString CACHE "${_var}" PROPERTY HELPSTRING)
# Skip empty variables
IF(NOT ${${_var}} STREQUAL "")
Expand Down
138 changes: 97 additions & 41 deletions CMakeListsLib.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,19 @@ ENDIF()
# =========================================================================
# MPI
# =========================================================================
OPTION(LIBS_USE_MPI "Compile SINGLE or MPI version" ON)
# Try to find system MPI
SET(MPI_DETERMINE_LIBRARY_VERSION TRUE)
FIND_PACKAGE(MPI QUIET)
IF (MPI_FOUND)
MESSAGE (STATUS "[MPI] found in system libraries")
OPTION(LIBS_USE_MPI "Compile SINGLE or MPI version" ON)
ELSE()
MESSAGE (STATUS "[MPI] not found in system libraries")
OPTION(LIBS_USE_MPI "Compile SINGLE or MPI version" OFF)
ENDIF()

IF(LIBS_USE_MPI)
# If library is specifically requested, it is required
SET(MPI_DETERMINE_LIBRARY_VERSION TRUE)
FIND_PACKAGE(MPI REQUIRED)

Expand Down Expand Up @@ -89,6 +100,13 @@ IF(LIBS_USE_MPI)

MESSAGE(STATUS "Compiling with [${LIBS_MPI_NAME}] (v${MPI_C_LIBRARY_VERSION})")
ADD_DEFINITIONS(-DUSE_MPI=1)

# LUMI needs even more help here
IF("${CMAKE_FQDN_HOST}" MATCHES ".can")
SET(MPI_C_COMPILER cc)
SET(MPI_CXX_COMPILER CC)
SET(MPI_Fortran_COMPILER ftn)
ENDIF()
ELSE()
ADD_DEFINITIONS(-DUSE_MPI=0)
ENDIF()
Expand All @@ -97,7 +115,28 @@ ENDIF()
# =========================================================================
# HDF5 library
# =========================================================================
SET(LIBS_BUILD_HDF5 OFF CACHE BOOL "Compile and build HDF5 library")
# Try to find system HDF5 using CMake
SET(LIBS_HDF5_CMAKE TRUE)
FIND_PACKAGE(HDF5 NAMES hdf5 COMPONENTS C Fortran ${SEARCH_TYPE} QUIET PATH_SUFFIXES share/cmake)
# Try to find the configure version
SET(LIBS_HDF5_CMAKE FALSE)
FIND_PACKAGE(HDF5 COMPONENTS C Fortran QUIET)
# Hide all the HDF5 libs paths
MARK_AS_ADVANCED(FORCE HDF5_DIR)
# CMake version found
IF (HDF5_FOUND)
IF(${CMAKE_VERSION} VERSION_LESS "3.10.0")
MESSAGE (WARNING "HDF5 built with CMake was found! This feature is only supported for CMake 3.10+ and HDF5 1.10.2+!")
ENDIF()
MESSAGE (STATUS "HDF5 C libs:${HDF5_FOUND} static:${HDF5_static_C_FOUND} and shared:${HDF5_shared_C_FOUND}")
MESSAGE (STATUS "HDF5 Fortran libs: static:${HDF5_static_Fortran_FOUND} and shared:${HDF5_shared_Fortran_FOUND}")
MESSAGE (STATUS "h5diff found:${HDF5_DIFF_EXECUTABLE}")
MESSAGE (STATUS "[HDF5] found in system libraries")
SET(LIBS_BUILD_HDF5 OFF CACHE BOOL "Compile and build HDF5 library")
ELSE()
MESSAGE (STATUS "[HDF5] not found in system libraries")
SET(LIBS_BUILD_HDF5 ON CACHE BOOL "Compile and build HDF5 library")
ENDIF()

# Set type of library to look up, STATIC/SHARED
SET(LIB_TYPE STATIC)
Expand Down Expand Up @@ -134,7 +173,7 @@ IF(NOT LIBS_BUILD_HDF5)
# In case CMake did not find HDF5 here, it will generate an error by itself
ENDIF()
# Hide all the HDF5 libs paths
MARK_AS_ADVANCED(FORCE HDF5_DIR)
# MARK_AS_ADVANCED(FORCE HDF5_DIR)
MARK_AS_ADVANCED(FORCE HDF5_C_LIBRARY_dl)
MARK_AS_ADVANCED(FORCE HDF5_C_LIBRARY_hdf5)
MARK_AS_ADVANCED(FORCE HDF5_C_LIBRARY_m)
Expand All @@ -147,6 +186,7 @@ IF(NOT LIBS_BUILD_HDF5)
MARK_AS_ADVANCED(FORCE HDF5_Fortran_LIBRARY_sz)
MARK_AS_ADVANCED(FORCE HDF5_Fortran_LIBRARY_z)

SET(HDF5_BUILD_STATUS "system")
# Build HDF5 in PICLas
ELSE()
# Origin pointing to Github
Expand Down Expand Up @@ -179,11 +219,11 @@ ELSE()
SET (HDF5_TAG "hdf5-1_10_6" CACHE STRING "HDF5 version tag")
SET (HDF5_VERSION "1.10" CACHE INTERNAL "HDF5 version number")
ENDIF()
MESSAGE (STATUS "Setting HDF5 to tag ${HDF5_TAG} to be compatible with detected [${LIBS_MPI_NAME}] (v${MPI_C_LIBRARY_VERSION})")
MESSAGE (STATUS "Setting [HDF5] to tag ${HDF5_TAG} to be compatible with detected [${LIBS_MPI_NAME}] (v${MPI_C_LIBRARY_VERSION})")
ELSE()
SET (HDF5_TAG "hdf5-1_12_0" CACHE STRING "HDF5 version tag")
SET (HDF5_VERSION "1.12" CACHE INTERNAL "HDF5 version number")
MESSAGE (STATUS "Setting HDF5 to tag ${HDF5_TAG} as no MPI support was requested")
MESSAGE (STATUS "Setting [HDF5] to tag ${HDF5_TAG} as no MPI support was requested")
ENDIF()
MARK_AS_ADVANCED(FORCE HDF5_TAG)

Expand Down Expand Up @@ -269,6 +309,8 @@ ELSE()
# Add ZLIB to include paths for HDF5 data compression
FIND_LIBRARY(HDF5_z_LIBRARY_RELEASE z)
LIST(APPEND HDF5_LIBRARIES ${HDF5_hdf5_fortran_LIBRARY_RELEASE} ${HDF5_hdf5_LIBRARY_RELEASE} ${HDF5_z_LIBRARY_RELEASE} -ldl)

SET(HDF5_BUILD_STATUS "self-built")
ENDIF()

# HDF5 1.14 references build directory
Expand All @@ -286,9 +328,9 @@ IF(LIBS_HDF5_CMAKE)
ELSE()
INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR_FORTRAN} ${HDF5_INCLUDE_DIR})
IF(${HDF5_IS_PARALLEL})
MESSAGE(STATUS "Compiling with [HDF5] (v${HDF5_VERSION}) with parallel support")
MESSAGE(STATUS "Compiling with ${HDF5_BUILD_STATUS} [HDF5] (v${HDF5_VERSION}) with parallel support")
ELSE()
MESSAGE(STATUS "Compiling with [HDF5] (v${HDF5_VERSION}) without parallel support")
MESSAGE(STATUS "Compiling with ${HDF5_BUILD_STATUS} [HDF5] (v${HDF5_VERSION}) without parallel support")
ENDIF()
LIST(APPEND linkedlibs ${HDF5_LIBRARIES} )
ENDIF()
Expand All @@ -297,36 +339,39 @@ ENDIF()
# =========================================================================
# Math libary
# =========================================================================
SET(LIBS_BUILD_MATH_LIB OFF CACHE BOOL "Compile and build math library")
# Try to find system LAPACK/OpenBLAS
FIND_PACKAGE(LAPACK QUIET)
IF (LAPACK_FOUND)
LIST(APPEND linkedlibs ${LAPACK_LIBRARIES})
MESSAGE (STATUS "[BLAS/Lapack] found in system libraries")
SET(LIBS_BUILD_MATH_LIB OFF CACHE BOOL "Compile and build math library")
ELSE()
MESSAGE (STATUS "[BLAS/Lapack] not found in system libraries")
SET(LIBS_BUILD_MATH_LIB ON CACHE BOOL "Compile and build math library")
ENDIF()

# Check if Intel MKL is requested instead of BLAS/LAPACK
CMAKE_DEPENDENT_OPTION(LIBS_USE_MKL "Use system MKL libraries instead of system BLAS/LAPACK" OFF
"NOT LIBS_BUILD_MATH_LIB" OFF)
# CMAKE_DEPENDENT_OPTION(LIBS_USE_MKL "Use system MKL libraries instead of system BLAS/LAPACK" OFF
# "NOT LIBS_BUILD_MATH_LIB" OFF)

# Use system LAPACK/MKL
IF(NOT LIBS_BUILD_MATH_LIB)
IF (LIBS_USE_MKL)
SET(BLA_VENDOR "Intel10_64lp") #search only for Intel BLAS (=MKL)
ENDIF()
# IF (LIBS_USE_MKL)
# SET(BLA_VENDOR "Intel10_64lp") #search only for Intel BLAS (=MKL)
# ENDIF()

# Use Lapack/Blas for GNU
# If library is specifically requested, it is required
FIND_PACKAGE(LAPACK REQUIRED)
IF (LAPACK_FOUND)
LIST(APPEND linkedlibs ${LAPACK_LIBRARIES})
MESSAGE(STATUS "Compiling with system [BLAS/Lapack]")
ENDIF()

# VDM inverse, replace lapack with analytical solution
# HLRS HAWK / SuperMUC + DEBUG
IF (CMAKE_BUILD_TYPE MATCHES "Debug" AND "${CMAKE_HOSTNAME}" MATCHES "login")
# HAWK and SuperMUC name their login nodes identically, so use the Fully Qualified Domain Name (FQDN) to identify
CMAKE_HOST_SYSTEM_INFORMATION(RESULT FQDN QUERY FQDN)
MARK_AS_ADVANCED(FORCE FQDN)
# HLRS HAWK
IF ("${FQDN}" MATCHES "hawk.hww.hlrs.de")
MESSAGE(STATUS "Compiling PICLas in debug mode on Hawk with system math lib. Setting VDM inverse to analytical solution")
ADD_DEFINITIONS(-DVDM_ANALYTICAL)
ENDIF()
IF (CMAKE_BUILD_TYPE MATCHES "Debug" AND CMAKE_FQDN_HOST MATCHES "hawk\.hww\.hlrs\.de$")
MESSAGE(STATUS "Compiling PICLas in debug mode on Hawk with system math lib. Setting VDM inverse to analytical solution")
ADD_DEFINITIONS(-DVDM_ANALYTICAL)
ENDIF()

# Build LAPACK/OpenBLAS in FLEXI
Expand Down Expand Up @@ -554,24 +599,35 @@ ENDIF()
# ENDIF()


# # =========================================================================
# # OPENMP library
# # =========================================================================
# OPTION(LIBS_USE_OPENMP "Enable OpenMP" OFF)
# IF(LIBS_USE_OPENMP)
# IF ("${CMAKE_VERSION}" VERSION_LESS 3.1.0)
# MESSAGE(WARNING "For finding OpenMP Fortran flags at least CMake version 3.1.0 is required. Please specify flags manually or use newer CMake version.")
# ENDIF()
# FIND_PACKAGE(OpenMP REQUIRED)
# SET (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${OpenMP_Fortran_FLAGS}")
# SET (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${OpenMP_Fortran_FLAGS}")
# SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${OpenMP_CXX_FLAGS}")
# SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OpenMP_CXX_FLAGS}")
# SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
# ADD_DEFINITIONS(-DUSE_OPENMP=1)
# ELSE()
# ADD_DEFINITIONS(-DUSE_OPENMP=0)
# ENDIF()
# # =========================================================================
# # OPENMP library
# # =========================================================================
# # Try to find system OpenMP
# FIND_PACKAGE(OpenMP QUIET)
# IF (OpenMP_FOUND)
# MESSAGE (STATUS "[OpenMP] found in system libraries")
# OPTION(LIBS_USE_OPENMP "Enable OpenMP" ON)
# ELSE()
# MESSAGE (STATUS "[OpenMP] not found in system libraries")
# OPTION(LIBS_USE_OPENMP "Enable OpenMP" OFF)
# ENDIF()
#
# IF(LIBS_USE_OPENMP)
# IF ("${CMAKE_VERSION}" VERSION_LESS 3.1.0)
# MESSAGE(WARNING "For finding OpenMP Fortran flags at least CMake version 3.1.0 is # required. Please specify flags manually or use newer CMake version.")
# ENDIF()
# # If library is specifically requested, it is required
# FIND_PACKAGE(OpenMP REQUIRED)
# SET (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${OpenMP_Fortran_FLAGS}")
# SET (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${OpenMP_Fortran_FLAGS}")
# SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${OpenMP_CXX_FLAGS}")
# SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OpenMP_CXX_FLAGS}")
# SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
# ADD_DEFINITIONS(-DUSE_OPENMP=1)
# MESSAGE(STATUS "Compiling with [OpenMP] (v${OpenMP_Fortran_VERSION})")
# ELSE()
# ADD_DEFINITIONS(-DUSE_OPENMP=0)
# # ENDIF()

#=========================================================================
# PETSc
Expand Down
Loading

0 comments on commit 31d376e

Please sign in to comment.