Skip to content

Commit 34ec1b4

Browse files
committed
Fix up gcm_run and gcm_regress
1 parent b6a7a6c commit 34ec1b4

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
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"

0 commit comments

Comments
 (0)