From 44955183faf39ca147b0bc197ca35143aabae5a3 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Sat, 30 Nov 2024 00:41:47 -0800 Subject: [PATCH] fix(setup.sh): add LC_RPATH to run-fpm.sh --- demo/app/train-cloud-microphysics.F90 | 2 +- demo/setup.sh | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/demo/app/train-cloud-microphysics.F90 b/demo/app/train-cloud-microphysics.F90 index 23428c857..5efe5c40c 100644 --- a/demo/app/train-cloud-microphysics.F90 +++ b/demo/app/train-cloud-microphysics.F90 @@ -1,7 +1,7 @@ ! Copyright (c), The Regents of the University of California ! Terms of use are as specified in LICENSE.txt -# include "assert_macros.h" +#include "assert_macros.h" program train_cloud_microphysics !! Train a neural network to represent a cloud microphysics model from diff --git a/demo/setup.sh b/demo/setup.sh index 46ce5b05d..e70e88506 100755 --- a/demo/setup.sh +++ b/demo/setup.sh @@ -53,6 +53,10 @@ if [ $(uname) = "Darwin" ]; then echo "$FPM_CC appears to be an Apple compiler. Please set FPM_CC to the location of LLVM clang." exit 1 fi + if [[ -z ${LC_RPATH:-} ]]; then + printf "Please set LC_RPATH=\$DYLD_LIBRARY_PATH path and restart this script.\n\n" + exit 1 + fi else cat <<'EOF' @@ -72,11 +76,16 @@ elif [ $(uname) = "Linux" ]; then fi if [[ -z ${NETCDFF_LIB_PATH:-} ]]; then printf "Please set NETCDFF_LIB_PATH to the NetCDF-Fortran library path and restart this script.\n\n" - exit 1 + exit 1 + fi + if [[ -z ${LC_RPATH:-} ]]; then + printf "Please set LC_RPATH=\$LD_LIBRARY_PATH path and restart this script.\n\n" + exit 1 fi fi -FPM_LD_FLAG=" -L$NETCDF_LIB_PATH -L$HDF5_LIB_PATH -L$NETCDFF_LIB_PATH" + +FPM_LD_FLAG=" -L$NETCDF_LIB_PATH -L$HDF5_LIB_PATH -L$NETCDFF_LIB_PATH -rpath $LC_RPATH" PREFIX=`realpath $PREFIX`