Skip to content

Commit

Permalink
Merge pull request #335 from GEOS-ESM/feature/mathomp4/updates-for-milan
Browse files Browse the repository at this point in the history
Updates for SCU17
  • Loading branch information
tclune authored Oct 12, 2023
2 parents c58637c + b39f87c commit b71a7b6
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 5 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

## [3.35.0] - 2023-10-13

### Added

- Updates for supporting Milan at NCCS
- Makes f2py2 only work if python2 is available. If not, all f2py2 is disabled
- Add new `BUILT_ON_SLES15` variable since building on SLES15 means running on SLES15

### Changed

- Turn off warning 10121 with Intel Fortran as it is noise

## [3.34.0] - 2023-09-07

### Changed
Expand Down
5 changes: 4 additions & 1 deletion compiler/flags/Intel_Fortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ set (DISABLE_LONG_LINE_LENGTH_WARNING "-diag-disable 5268")
## Turn off ifort: warning #10337: option '-fno-builtin' disables '-imf*' option
set (DISABLE_10337 "-diag-disable 10337")

## Turn off ifort: command line warning #10121: overriding '-fp-model precise' with '-fp-model fast'
set (DISABLE_10121 "-diag-disable 10121")

set (NO_RANGE_CHECK "")

cmake_host_system_information(RESULT proc_description QUERY PROCESSOR_DESCRIPTION)
Expand Down Expand Up @@ -96,7 +99,7 @@ endif ()
# Common Fortran Flags
# --------------------
set (common_Fortran_flags "${TRACEBACK} ${REALLOC_LHS} ${OPTREPORT0} ${ALIGN_ALL} ${NO_ALIAS}")
set (common_Fortran_fpe_flags "${FTZ} ${NOOLD_MAXMINLOC}")
set (common_Fortran_fpe_flags "${FTZ} ${NOOLD_MAXMINLOC} ${DISABLE_10121}")

# GEOS Debug
# ----------
Expand Down
23 changes: 23 additions & 0 deletions external_libraries/DetermineSite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ set(DETECTED_SITE "UNKNOWN")

if (${BUILD_SITE} MATCHES "discover*" OR ${BUILD_SITE} MATCHES "borg*" OR ${BUILD_SITE} MATCHES "warp*")
set (DETECTED_SITE "NCCS")
# NCCS now has two OSs. We need to detect if we are on SLES 15. If so, we set a flag "BUILT_ON_SLES15"
# which we will use to make sure people building on SLES15 run on SLES15
# The commmand we use in bash is:
# grep VERSION_ID /etc/os-release | cut -d= -f2 | cut -d. -f1 | sed 's/"//g'
execute_process(
COMMAND grep VERSION_ID /etc/os-release
COMMAND cut -d= -f2
COMMAND cut -d. -f1
COMMAND sed s/\"//g
OUTPUT_VARIABLE OS_RELEASE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (OS_RELEASE STREQUAL "15")
set (BUILT_ON_SLES15 TRUE)
endif ()
elseif (${BUILD_SITE} MATCHES "pfe" OR ${BUILD_SITE} MATCHES "r[0-9]*i[0-9]*n[0-9]*" OR ${BUILD_SITE} MATCHES "r[0-9]*c[0-9]*t[0-9]*n[0-9]*")
set (DETECTED_SITE "NAS")
elseif (EXISTS /ford1/share/gmao_SIteam AND EXISTS /ford1/local AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
Expand Down Expand Up @@ -64,3 +79,11 @@ endif ()
set(GEOS_SITE ${DETECTED_SITE} CACHE STRING "Detected site for use with GEOS setup scripts")
message(STATUS "Setting GEOS_SITE to ${GEOS_SITE}")

if (DETECTED_SITE STREQUAL "NCCS")
if (BUILT_ON_SLES15)
message(STATUS "Building on SLES15 at NCCS. Can only run on Milan processors")
else ()
message(STATUS "Building on SLES12 at NCCS. Can run on Cascade Lake or Skylake processors")
endif ()
endif ()

23 changes: 19 additions & 4 deletions python/f2py2/FindF2PY2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,27 @@
# By default, the module finds the F2PY2 program associated with the installed NumPy package.
#

# It turns out that on machines where Python2 does not exist, this code will still
# find plain "f2py" and think that is f2py2. Even if you remove f2py from the find_program
# call below, it still finds that. So instead, we must disable this code if no Python2
# interpreter is found.

# Find the Python2 interpreter which must exist else we cannot find f2py2
find_package(Python2 COMPONENTS Interpreter QUIET)

# If we do not have a Python2 interpreter, we cannot find f2py2 and we are done
if(NOT Python2_FOUND)
message(WARNING "[F2PY2]: Python2 interpreter not found, we will not search for f2py2. This means f2py2 libraries will not be built. Please convert your code to Python3.")
set(F2PY2_FOUND FALSE)
return()
endif()

# Path to the f2py2 executable
find_program(F2PY2_EXECUTABLE NAMES "f2py${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}"
"f2py-${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}"
"f2py${Python2_VERSION_MAJOR}"
"f2py"
)
"f2py-${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}"
"f2py${Python2_VERSION_MAJOR}"
"f2py"
)

if(F2PY2_EXECUTABLE)
# extract the version string
Expand Down

0 comments on commit b71a7b6

Please sign in to comment.