Skip to content

Commit b3df52c

Browse files
authored
Merge pull request #816 from GEOS-ESM/feature/v11-scm-setup-fix
v11: Fix for run scripts and spack
2 parents d6e2a49 + ae7ba6f commit b3df52c

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

gcm_regress.j

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,15 @@ setenv GEOSDIR @GEOSDIR
9090
setenv GEOSBIN @GEOSBIN
9191

9292
source $GEOSBIN/g5_modules
93-
setenv @LD_LIBRARY_PATH_CMD ${LD_LIBRARY_PATH}:${GEOSDIR}/lib
93+
94+
95+
# We only prepend to DY/LD_LIBRARY_PATH if it exists
96+
if ( $?@LD_LIBRARY_PATH_CMD ) then
97+
setenv @LD_LIBRARY_PATH_CMD "${@LD_LIBRARY_PATH_CMD}:${GEOSDIR}/lib"
98+
else
99+
setenv @LD_LIBRARY_PATH_CMD "${GEOSDIR}/lib"
100+
endif
101+
94102
# We only add BASEDIR to the @LD_LIBRARY_PATH_CMD if BASEDIR is defined (i.e., not running with Spack)
95103
if ( $?BASEDIR ) then
96104
setenv @LD_LIBRARY_PATH_CMD ${@LD_LIBRARY_PATH_CMD}:${BASEDIR}/${ARCH}/lib

gcm_run.j

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ setenv GEOSETC @GEOSETC
3333
setenv GEOSUTIL @GEOSSRC
3434

3535
source $GEOSBIN/g5_modules
36-
setenv @LD_LIBRARY_PATH_CMD "${LD_LIBRARY_PATH}:${GEOSDIR}/lib"
36+
37+
# We only prepend to DY/LD_LIBRARY_PATH if it exists
38+
if ( $?@LD_LIBRARY_PATH_CMD ) then
39+
setenv @LD_LIBRARY_PATH_CMD "${@LD_LIBRARY_PATH_CMD}:${GEOSDIR}/lib"
40+
else
41+
setenv @LD_LIBRARY_PATH_CMD "${GEOSDIR}/lib"
42+
endif
43+
3744
# We only add BASEDIR to the @LD_LIBRARY_PATH_CMD if BASEDIR is defined (i.e., not running with Spack)
3845
if ( $?BASEDIR ) then
3946
setenv @LD_LIBRARY_PATH_CMD "${@LD_LIBRARY_PATH_CMD}:${BASEDIR}/${ARCH}/lib"

scm_run.j

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ setenv GEOSETC @INSTALLDIR/etc
1515
setenv GEOSUTIL @INSTALLDIR
1616

1717
source $GEOSBIN/g5_modules
18-
setenv @LD_LIBRARY_PATH_CMD "${LD_LIBRARY_PATH}:${GEOSDIR}/lib"
18+
19+
# We only prepend to DY/LD_LIBRARY_PATH if it exists
20+
if ( $?@LD_LIBRARY_PATH_CMD ) then
21+
setenv @LD_LIBRARY_PATH_CMD "${@LD_LIBRARY_PATH_CMD}:${GEOSDIR}/lib"
22+
else
23+
setenv @LD_LIBRARY_PATH_CMD "${GEOSDIR}/lib"
24+
endif
1925
# We only add BASEDIR to the @LD_LIBRARY_PATH_CMD if BASEDIR is defined (i.e., not running with Spack)
2026
if ( $?BASEDIR ) then
21-
setenv @LD_LIBRARY_PATH_CMD "${@LD_LIBRARY_PATH_CMD}:${BASEDIR}/${ARCH}/lib"
27+
setenv @LD_LIBRARY_PATH_CMD "${@LD_LIBRARY_PATH_CMD}:${BASEDIR}/${ARCH}/lib"
2228
endif
2329

2430
setenv RUN_CMD "@RUN_CMD"

0 commit comments

Comments
 (0)