Skip to content

Commit

Permalink
Merge pull request #106 from GEOS-ESM/feature/mathomp4/fix-build-install
Browse files Browse the repository at this point in the history
Fix issue with passing in build and installdirs
  • Loading branch information
mathomp4 committed Oct 26, 2023
2 parents 94c9e19 + 6a659da commit 7429c60
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
### Added

## [4.20.5] - 2023-10-26

### Fixed

- Fix issue with passing in build and install dirs

## [4.20.4] - 2023-10-25

### Fixed
Expand Down
17 changes: 14 additions & 3 deletions build.csh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ if (! $?slurm_constraint) setenv slurm_constraint ""
if (! $?cmake_build_type) setenv cmake_build_type "Release"
if (! $?EXTRA_CMAKE_FLAGS) setenv EXTRA_CMAKE_FLAGS ""
if (! $?FORTRAN_COMPILER) setenv FORTRAN_COMPILER ""
if (! $?BUILDDIR_PASSED) setenv BUILDDIR_PASSED "NO"
if (! $?INSTALLDIR_PASSED) setenv INSTALLDIR_PASSED "NO"

# Detect if on compute node already
# ---------------------------------
Expand Down Expand Up @@ -150,13 +152,15 @@ while ($#argv)
if ("$1" == "-builddir") then
shift; if (! $#argv) goto usage
setenv BUILDDIR $1
setenv BUILDDIR_PASSED "YES"
endif

# set INSTALLDIR
#---------------
if ("$1" == "-installdir") then
shift; if (! $#argv) goto usage
setenv INSTALLDIR $1
setenv INSTALLDIR_PASSED "YES"
endif

# set GMI_MECHANISM
Expand Down Expand Up @@ -430,12 +434,12 @@ if ($SITE == NCCS) then
endif
endif
# We also check if we already appended SLES
if (! $?BUILDDIR) then
if (! $?BUILDDIR && "$BUILDDIR_PASSED" == "NO") then
if ($Pbuild_build_directory !~ "*-SLES${OS_VERSION}") then
setenv Pbuild_build_directory ${Pbuild_build_directory}-SLES${OS_VERSION}
endif
endif
if (! $?INSTALLDIR) then
if (! $?INSTALLDIR && "$INSTALLDIR_PASSED" == "NO") then
if ($Pbuild_install_directory !~ "*-SLES${OS_VERSION}") then
setenv Pbuild_install_directory ${Pbuild_install_directory}-SLES${OS_VERSION}
endif
Expand Down Expand Up @@ -502,6 +506,8 @@ if ($ddb) then
echo "FORTRAN_COMPILER = $FORTRAN_COMPILER"
echo "INSTALL_SOURCE_TARFILE = $INSTALL_SOURCE_TARFILE"
echo "GMI_MECHANISM_FLAG = $GMI_MECHANISM_FLAG"
echo "BUILDDIR_PASSED = $BUILDDIR_PASSED"
echo "INSTALLDIR_PASSED = $INSTALLDIR_PASSED"
exit
endif

Expand Down Expand Up @@ -769,7 +775,7 @@ else if ( $SITE == NCCS ) then
--nodes=1 \
--ntasks=${numjobs} \
--time=$walltime \
--export ESMADIR=${ESMADIR},cmake_build_type=${cmake_build_type},EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS},FORTRAN_COMPILER=${FORTRAN_COMPILER},INSTALL_SOURCE_TARFILE=${INSTALL_SOURCE_TARFILE},verbose=${verbose},GMI_MECHANISM_FLAG=${GMI_MECHANISM_FLAG},Pbuild_build_directory=${Pbuild_build_directory},Pbuild_install_directory=${Pbuild_install_directory},usegnu=${usegnu},notar=${notar},tmpdir=${tmpdir},docmake=${docmake},debug=${debug},aggressive=${aggressive} \
--export ESMADIR=${ESMADIR},cmake_build_type=${cmake_build_type},EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS},FORTRAN_COMPILER=${FORTRAN_COMPILER},INSTALL_SOURCE_TARFILE=${INSTALL_SOURCE_TARFILE},verbose=${verbose},GMI_MECHANISM_FLAG=${GMI_MECHANISM_FLAG},Pbuild_build_directory=${Pbuild_build_directory},Pbuild_install_directory=${Pbuild_install_directory},usegnu=${usegnu},notar=${notar},tmpdir=${tmpdir},docmake=${docmake},debug=${debug},aggressive=${aggressive},BUILDDIR_PASSED=${BUILDDIR_PASSED},INSTALLDIR_PASSED=${INSTALLDIR_PASSED},queue=${queue},partition=${partition} \
$waitflag \
$0
unset echo
Expand Down Expand Up @@ -867,8 +873,13 @@ endif
if ("$queue" != "") then
echo1 "queue: $queue"
endif
if ("$partition" != "") then
echo1 "partition: $partition"
endif
if ("$account" != "") then
echo1 "account: $account"
echo1 "Pbuild_build_directory: $Pbuild_build_directory"
echo1 "Pbuild_install_directory: $Pbuild_install_directory"
endif

echo1 "======================================"
Expand Down

0 comments on commit 7429c60

Please sign in to comment.