Skip to content

Commit d6339eb

Browse files
committed
Add LFortran as compiler to build options
Provides the necessary changes to use LFortran as the compiler for this project to the extend that it currently can. Please note the corresponding issue to gain further information on how to use this. It provides a compilation script and references the required mpi wrapper library.
1 parent e1781ed commit d6339eb

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.
@@ -44,6 +44,12 @@ elseif(COMPILER STREQUAL "Intel" OR COMPILER STREQUAL "IntelLLVM")
4444
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -fpe0 -check all")
4545
endif()
4646
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -debug minimal")
47+
elseif(COMPILER STREQUAL "LFortran")
48+
add_compile_definitions(CPRLFORTRAN)
49+
# There is an issue, some modules require --cpp as a flag in their compilation
50+
# some flat out break, if we put --cpp
51+
# For more information see https://github.com/HPSCTerrSys/eCLM/issues/98.
52+
# set(CMAKE_Fortran_FLAGS "--cpp")
4753
else()
4854
message(FATAL_ERROR "COMPILER='${COMPILER}' is not supported.")
4955
endif()

0 commit comments

Comments
 (0)