Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 6 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,11 @@ 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a comment that shows the link to #98

# some flat out break, if we put --cpp
# set(CMAKE_Fortran_FLAGS "--cpp")
else()
message(FATAL_ERROR "COMPILER='${COMPILER}' is not supported.")
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/externals/gptl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SET(TIMING_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
CACHE STRING "")
INCLUDE_DIRECTORIES(${TIMING_INCLUDE_DIRS})

ADD_DEFINITIONS(-DINCLUDE_CMAKE_FCI -DHAVE_MPI)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to remove -DHAVE_MPI to make LFortran work? This option might be used by other compilers.

ADD_DEFINITIONS(-DINCLUDE_CMAKE_FCI)

SET(SRCS_C GPTLget_memusage.c
GPTLprint_memusage.c
Expand Down
1 change: 0 additions & 1 deletion src/externals/gptl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ ifeq ($(strip $(MPILIB)), mpi-serial)
else
CC := $(MPICC)
FC := $(MPIFC)
CPPDEFS += -DHAVE_MPI
endif
ifdef CPRE
FPPDEFS := $(patsubst -D%,$(CPRE)%,$(CPPDEFS))
Expand Down
3 changes: 0 additions & 3 deletions src/externals/gptl/perf_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ SUBROUTINE shr_sys_flush(unit)
call flush(unit)
#endif
#endif
#if (defined AIX)
call flush_(unit)
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest keeping AIX if it's not required to make LFortran work


END SUBROUTINE shr_sys_flush

Expand Down