Skip to content

Commit 1ed021e

Browse files
Add recursive flag to the default in the CMakelists.txt; Remove recursive flags from the build of zchkee.o
1 parent 6281084 commit 1ed021e

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,40 @@ configure_file(
9292
include(PreventInSourceBuilds)
9393
include(PreventInBuildInstalls)
9494

95+
# # Following nomenclature from here:
96+
# # https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
97+
# if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
98+
# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive")
99+
# # elseif(CMAKE_Fortran_COMPILER_ID MATCHES "G95")
100+
# # set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive")
101+
# elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
102+
# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive")
103+
# elseif(CMAKE_Fortran_COMPILER_ID MATCHES "IntelLLVM")
104+
# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive")
105+
# elseif(CMAKE_Fortran_COMPILER_ID MATCHES "NVIDIA")
106+
# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive")
107+
# elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI")
108+
# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive")
109+
# endif()
110+
111+
# Check if recursive flag exists
112+
include(CheckFortranCompilerFlag)
113+
check_fortran_compiler_flag("-recursive" _recursiveFlag)
114+
check_fortran_compiler_flag("-frecursive" _frecursiveFlag)
115+
check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
116+
117+
# Add recursive flag
118+
if(_recursiveFlag)
119+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive")
120+
# message(STATUS ${CMAKE_Fortran_FLAGS})
121+
elseif(_frecursiveFlag)
122+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive")
123+
# message(STATUS ${CMAKE_Fortran_FLAGS})
124+
elseif(_MrecursiveFlag)
125+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive")
126+
# message(STATUS ${CMAKE_Fortran_FLAGS})
127+
endif()
128+
95129
if(UNIX)
96130
if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
97131
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict")

TESTING/EIG/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,13 @@ cleanobj:
157157
cleanexe:
158158
rm -f xeigtst*
159159

160+
FFLAGS_DRV_NORECURSIVE := $(filter-out -frecursive -Mrecursive,$(FFLAGS_DRV))
161+
160162
schkee.o: schkee.f
161163
$(FC) $(FFLAGS_DRV) -c -o $@ $<
162164
dchkee.o: dchkee.f
163165
$(FC) $(FFLAGS_DRV) -c -o $@ $<
164166
cchkee.o: cchkee.f
165167
$(FC) $(FFLAGS_DRV) -c -o $@ $<
166168
zchkee.o: zchkee.f
167-
$(FC) $(FFLAGS_DRV) -c -o $@ $<
169+
$(FC) $(FFLAGS_DRV_NORECURSIVE) -c -o $@ $<

0 commit comments

Comments
 (0)