Skip to content

Commit 001250b

Browse files
authored
Merge branch 'master' into dev-nvhpc-support
2 parents 548116b + c417955 commit 001250b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cmake/SetBuildOptions.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ endif()
1212

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

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

2323
# Set compiler specific flags.
@@ -52,6 +52,12 @@ elseif(COMPILER STREQUAL "NVHPC")
5252
set(CMAKE_Fortran_FLAGS "-fPIC")
5353
set(CMAKE_Fortran_FLAGS_DEBUG "-g -O0")
5454
set(CMAKE_Fortran_FLAGS_RELEASE "-Ofast")
55+
elseif(COMPILER STREQUAL "LFortran")
56+
add_compile_definitions(CPRLFORTRAN)
57+
# There is an issue, some modules require --cpp as a flag in their compilation
58+
# some flat out break, if we put --cpp
59+
# For more information see https://github.com/HPSCTerrSys/eCLM/issues/98.
60+
# set(CMAKE_Fortran_FLAGS "--cpp")
5561
else()
5662
message(FATAL_ERROR "COMPILER='${COMPILER}' is not supported.")
5763
endif()

0 commit comments

Comments
 (0)