From d40f2ec468515a475a5d34224d94a578717f7a8e Mon Sep 17 00:00:00 2001 From: Suzan Manasreh <75396711+suzanmanasreh@users.noreply.github.com> Date: Sat, 6 Jul 2024 08:17:11 -0400 Subject: [PATCH] error handling --- install/install-ice.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/install/install-ice.sh b/install/install-ice.sh index babd209..3f0b604 100644 --- a/install/install-ice.sh +++ b/install/install-ice.sh @@ -3,7 +3,7 @@ # salloc a node before you run this because petsc configure uses srun ml gcc/12.3.0 mvapich2/2.3.7-1 intel-oneapi-mkl/2023.1.0 python/3.10.10 fftw/3.3.10-mva2 cmake -# building and installing petsc 3.19.6 in packages directory +# build and install netcdf-c in packages/NETCDF_INST rm -fr packages mkdir packages cd packages @@ -30,8 +30,17 @@ export FFLAGS="-O -w" export BIN=Linux2_x86_64gfort ./configure --prefix=${INSNCDF} --disable-netcdf-4 --disable-dap +if (($?)); then + echo "[install-ice.sh] Error: NETCDF-C configure failed." + exit 1 +fi make all check install +if (($?)); then + echo "[install-ice.sh] Error: NETCDF-C tests or install failed." + exit 1 +fi +# build and install netcdf-fortran in packages/NETCDF_INST cd ../netcdf-fortran-4.6.1 export NCDIR=${INSNCDF} export NFDIR=${INSNCDF} @@ -49,15 +58,23 @@ rm -f netcdf.F90 cp ../../../../install/scripts/module_netcdf_nc_data.F90 ./ cp ../../../../install/scripts/module_typesizes.F90 ./ cp ../../../../install/scripts/netcdf.F90 ./ -cp ../../../../install/scripts/typesizes.mod ./ cd .. ./configure --prefix=${INSNCDF} +if (($?)); then + echo "[install-ice.sh] Error: NETCDF-Fortran configure failed." + exit 1 +fi make check +if (($?)); then + echo "[install-ice.sh] Error: NETCDF-Fortran tests failed." + exit 1 +fi make install cd ../.. +# building and installing petsc 3.19.6 in packages directory wget https://ftp.mcs.anl.gov/pub/petsc/petsc-3.19.tar.gz tar -xf petsc-3.19.tar.gz @@ -91,4 +108,4 @@ git clone https://github.com/comp-physics/spherepack3.2.git cd spherepack3.2 make -j 8 -echo "Done installing RBC3D!" \ No newline at end of file +echo "Done installing RBC3D!"