Skip to content

Commit

Permalink
Merge pull request #288 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Merge Develop into Main for Release
  • Loading branch information
mathomp4 authored Oct 27, 2022
2 parents a76c9f1 + c895451 commit 7285234
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

# Anchors to prevent forgetting to update a version
baselibs_version: &baselibs_version v7.5.0
bcs_version: &bcs_version v10.22.5
bcs_version: &bcs_version v10.23.0

orbs:
ci: geos-esm/circleci-tools@1
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/changelog-enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dangoslen/changelog-enforcer@v1.6.1
- uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: 'CHANGELOG.md'
skipLabels: 'Skip Changelog,0 diff trivial'
skipLabels: 'Skip Changelog,0 diff trivial,automatic,dependencies'
missingUpdateErrorMessage: >
No update to CHANGELOG.md found! Please add a changelog
entry to it describing your change. Please note that the
keepachangelog (https://keepachangelog.com) format is
used. If your change is very trivial not applicable for a
changelog entry, add a 'Skip Changelog' label to the pull
request to skip the changelog enforcer.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

## [3.19.0] - 2022-10-27

### Added

- Added check to `esma.cmake` to ensure `CMAKE_INSTALL_PREFIX` is writable
- Add `-save-temps` to GNU debug flags

### Changed

- Updated CI and changelog enforcer

## [3.18.0] - 2022-08-18

### Changed
Expand Down
2 changes: 1 addition & 1 deletion compiler/flags/GNU_Fortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ set (common_Fortran_fpe_flags "-ffpe-trap=zero,overflow ${TRACEBACK} ${MISMATCH}

# GEOS Debug
# ----------
set (GEOS_Fortran_Debug_Flags "${FOPT0} ${DEBINFO} -fcheck=all,no-array-temps -finit-real=snan")
set (GEOS_Fortran_Debug_Flags "${FOPT0} ${DEBINFO} -fcheck=all,no-array-temps -finit-real=snan -save-temps")
set (GEOS_Fortran_Debug_FPE_Flags "${common_Fortran_fpe_flags}")

# GEOS Release
Expand Down
32 changes: 5 additions & 27 deletions esma.cmake
Original file line number Diff line number Diff line change
@@ -1,30 +1,8 @@
# Most users of this software do not (should not?) have permissions to
# install in the cmake default of /usr/local (or equiv on other os's).
# Below, the default is changed to a directory within the build tree
# unless the user explicitly sets CMAKE_INSTALL_PREFIX in the cache.
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE )
message(STATUS "*** Setting default install prefix to ${CMAKE_INSTALL_PREFIX}.")
message(STATUS "*** Override with -DCMAKE_INSTALL_PREFIX=<path>.")
endif()
### Check install prefix

# There is an issue with CMake, make, and directories with commas
# in the path. CMake can add -Wl linker options to the makefiles and
# Wl options take comma-separated lists. Until it can be figured out
# how (or if) CMake can generate quoted arguments to -Wl, we prevent
# either build or install directories with a comma in the path
if ("${CMAKE_BINARY_DIR}" MATCHES "^.*[,].*$")
message(FATAL_ERROR
"CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}\n"
"GEOS does not allow directory paths with commas. Please change your build path"
)
endif ()
if ("${CMAKE_INSTALL_PREFIX}" MATCHES "^.*[,].*$")
message(FATAL_ERROR
"CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}\n"
"GEOS does not allow directory paths with commas. Please change your install path"
)
endif ()
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/esma_support")
include (esma_check_install_prefix)
esma_check_install_prefix()

### ecbuild Support ###

Expand Down Expand Up @@ -87,7 +65,7 @@ find_package(GitInfo)

### ESMA Support ###

list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/esma_support")
#list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/esma_support")
include (esma_support)

### Python ###
Expand Down
67 changes: 67 additions & 0 deletions esma_support/esma_check_install_prefix.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
macro(esma_check_install_prefix)

# Most users of this software do not (should not?) have permissions to
# install in the cmake default of /usr/local (or equiv on other os's).
# Below, the default is changed to a directory within the build tree
# unless the user explicitly sets CMAKE_INSTALL_PREFIX in the cache.
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE )
message(STATUS "*** Setting default install prefix to ${CMAKE_INSTALL_PREFIX}.")
message(STATUS "*** Override with -DCMAKE_INSTALL_PREFIX=<path>.")
endif()

# There is an issue with CMake, make, and directories with commas
# in the path. CMake can add -Wl linker options to the makefiles and
# Wl options take comma-separated lists. Until it can be figured out
# how (or if) CMake can generate quoted arguments to -Wl, we prevent
# either build or install directories with a comma in the path
if ("${CMAKE_BINARY_DIR}" MATCHES "^.*[,].*$")
message(FATAL_ERROR
"CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}\n"
"GEOS does not allow directory paths with commas. Please change your build path"
)
endif ()
if ("${CMAKE_INSTALL_PREFIX}" MATCHES "^.*[,].*$")
message(FATAL_ERROR
"CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}\n"
"GEOS does not allow directory paths with commas. Please change your install path"
)
endif ()

# Test to see if a user can actually write to the install directory they provided
# If not, error out and tell them to change the install path
# Set a test_file to the install path, and then try to touch a file there
set(test_file ${CMAKE_INSTALL_PREFIX}/foo})
# First check to see if CMAKE_INSTALL_PREFIX is a directory that exists
if (EXISTS ${CMAKE_INSTALL_PREFIX})
# If it exists, check to see if it is a directory
if (NOT IS_DIRECTORY ${CMAKE_INSTALL_PREFIX})
message(FATAL_ERROR
"CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}\n"
"We do not allow non-directory paths. Please change your install path"
)
endif ()
# If it is a directory, check to see if we can write to it
file(WRITE ${test_file} "test")
if (NOT EXISTS ${test_file})
message(FATAL_ERROR
"CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}\n"
"You do not have write access to the install path. Please change your install path"
)
endif ()
# If we can write to it, remove the test file
file(REMOVE ${test_file})
else ()
# If it doesn't exist, check to see if we can create it
file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX})
if (NOT EXISTS ${CMAKE_INSTALL_PREFIX})
message(FATAL_ERROR
"CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}\n"
"You do not have write access to the install path. Please change your install path"
)
endif ()
# If we can create it, remove it as the install step will create it later
file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX})
endif ()

endmacro(esma_check_install_prefix)

0 comments on commit 7285234

Please sign in to comment.