Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmake/SetBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ endif()

# Check if MPI is present. This should succeed if
# the compilers were set to mpifort and mpicc.
find_package(MPI REQUIRED)

# Set default compiler = GNU if none was specified.
if(NOT COMPILER)
set(COMPILER "${CMAKE_Fortran_COMPILER_ID}" CACHE STRING "Choose compiler toolchain." FORCE)
set_property(CACHE COMPILER PROPERTY STRINGS "GNU" "Intel")
set_property(CACHE COMPILER PROPERTY STRINGS "GNU" "Intel" "LFortran")
endif()

# Set compiler specific flags.
Expand All @@ -44,6 +44,12 @@ elseif(COMPILER STREQUAL "Intel" OR COMPILER STREQUAL "IntelLLVM")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -fpe0 -check all")
endif()
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -debug minimal")
elseif(COMPILER STREQUAL "LFortran")
add_compile_definitions(CPRLFORTRAN)
# There is an issue, some modules require --cpp as a flag in their compilation
# some flat out break, if we put --cpp
# For more information see https://github.com/HPSCTerrSys/eCLM/issues/98.
# set(CMAKE_Fortran_FLAGS "--cpp")
else()
message(FATAL_ERROR "COMPILER='${COMPILER}' is not supported.")
endif()
Expand Down