Skip to content

Commit b20bf92

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 b20bf92

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

cmake/SetBuildOptions.cmake

Lines changed: 6 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,11 @@ 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+
# set(CMAKE_Fortran_FLAGS "--cpp")
4752
else()
4853
message(FATAL_ERROR "COMPILER='${COMPILER}' is not supported.")
4954
endif()

src/externals/gptl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SET(TIMING_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
99
CACHE STRING "")
1010
INCLUDE_DIRECTORIES(${TIMING_INCLUDE_DIRS})
1111

12-
ADD_DEFINITIONS(-DINCLUDE_CMAKE_FCI -DHAVE_MPI)
12+
ADD_DEFINITIONS(-DINCLUDE_CMAKE_FCI)
1313

1414
SET(SRCS_C GPTLget_memusage.c
1515
GPTLprint_memusage.c

src/externals/gptl/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ ifeq ($(strip $(MPILIB)), mpi-serial)
3232
else
3333
CC := $(MPICC)
3434
FC := $(MPIFC)
35-
CPPDEFS += -DHAVE_MPI
3635
endif
3736
ifdef CPRE
3837
FPPDEFS := $(patsubst -D%,$(CPRE)%,$(CPPDEFS))

src/externals/gptl/perf_utils.F90

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ SUBROUTINE shr_sys_flush(unit)
164164
call flush(unit)
165165
#endif
166166
#endif
167-
#if (defined AIX)
168-
call flush_(unit)
169-
#endif
170167

171168
END SUBROUTINE shr_sys_flush
172169

0 commit comments

Comments
 (0)