Skip to content

Commit 0e53a9d

Browse files
committed
Updates to build SCM with Intel ifx compiler on Derecho. There are a number of tweaks needed, warning messages are used to clarify the changes
1 parent 189f8ce commit 0e53a9d

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

scm/etc/modules/derecho_intel_spack_stack_1.9.3.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ load("w3emc/2.10.0")
2626
load("py-f90nml")
2727
load("py-netcdf4/1.7.1.post2")
2828

29+
load("intel-oneapi")
30+
2931
setenv("CMAKE_C_COMPILER","cc")
3032
setenv("CMAKE_CXX_COMPILER","CC")
3133
setenv("CMAKE_Fortran_COMPILER","ftn")
3234
setenv("CMAKE_Platform","derecho.intel")
35+
36+
if mode() == "load" then
37+
local red = "\27[31m"
38+
local reset = "\27[0m"
39+
LmodMessage(red .. "WARNING: " .. reset .. "Login node on Derecho does not have enough memory to build SCM, use interactive node")
40+
LmodMessage(red .. "WARNING: " .. reset .. "Debug mode currently broken on Derecho, don't use '-g'")
41+
end

scm/src/CMakeLists.txt

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
174174
set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
175175
set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
176176
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
177-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -sox -align array64byte -qno-opt-dynamic-align")
177+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -traceback -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -align array64byte -qno-opt-dynamic-align")
178178
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qno-opt-dynamic-align -sox -fp-model source")
179179

180180
if(NOT 32BIT)
@@ -188,27 +188,31 @@ elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
188188
if(32BIT)
189189
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2 -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3")
190190
else()
191-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2 -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3 -no-prec-div -no-prec-sqrt")
191+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2 -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3 -no-prec-div")
192192
endif()
193193
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -debug minimal")
194194
set(FAST "-fast-transcendentals")
195-
if(AVX2)
196-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -march=core-avx2")
197-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=core-avx2")
198-
elseif(SIMDMULTIARCH)
199-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -axSSE4.2,CORE-AVX2")
200-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -axSSE4.2,CORE-AVX2")
201-
elseif(AVX)
202-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -march=core-avx-i")
203-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=core-avx-i")
204-
endif()
205195
endif()
206196

207197
set(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
208198
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
209199
set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
210200
set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
211201

202+
if(DEFINED ENV{CMAKE_Platform} AND
203+
"$ENV{CMAKE_Platform}" MATCHES "derecho.intel")
204+
set(CMAKE_Fortran_FLAGS "-O0 -fPIC")
205+
set(CMAKE_C_FLAGS "-O0 -fPIC")
206+
set(CMAKE_Fortran_FLAGS_RELEASE "")
207+
set(CMAKE_C_FLAGS_RELEASE "")
208+
set(CMAKE_Fortran_FLAGS_DEBUG "")
209+
set(CMAKE_C_FLAGS_DEBUG "")
210+
if(NOT 32BIT)
211+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64")
212+
endif()
213+
message(WARNING "Building on Derecho, only using CMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS}")
214+
endif()
215+
212216
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "NVHPC")
213217
if(ENABLE_NVIDIA_OPENACC MATCHES "true")
214218
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -acc -Minfo=accel")

0 commit comments

Comments
 (0)