Skip to content

Commit

Permalink
CONFIG: Check for existance of nc-config before accessing [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Nov 8, 2022
1 parent 5fcfc90 commit 7790d5a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
20 changes: 13 additions & 7 deletions cmake-config
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,19 @@ PARMETIS_PATH=${PARMETIS_PATH:-${INSTALL_PATH}}
### Set to ON for parallel compile; otherwise OFF for serial (default)
if [ "${MPI}" = "" ]
then
netcdf_parallel=$($NETCDF_PATH/bin/nc-config --has-parallel)
if [ "${netcdf_parallel}" == "yes" ]
then
MPI=YES
else
MPI=NO
fi
if [[ -f "$NETCDF_PATH/bin/nc-config" ]]; then
netcdf_parallel=$($NETCDF_PATH/bin/nc-config --has-parallel)
if [ "${netcdf_parallel}" == "yes" ]
then
MPI=YES
else
MPI=NO
fi
else
echo "Unable to determine whether netCDF is parallel or serial. Assuming serial"
echo "Set either `NETCDF_PATH` or `MPI` manually if the assumption is incorrect."
MPI=NO
fi
fi

MPI=$(check_valid MPI)
Expand Down
20 changes: 13 additions & 7 deletions cmake-exodus
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,19 @@ HDF5_PATH=${HDF5_PATH:-${INSTALL_PATH}}
### Set to ON for parallel compile; otherwise OFF for serial (default)
if [ "${MPI}" = "" ]
then
netcdf_parallel=$($NETCDF_PATH/bin/nc-config --has-parallel)
if [ "${netcdf_parallel}" == "yes" ]
then
MPI=YES
else
MPI=NO
fi
if [[ -f "$NETCDF_PATH/bin/nc-config" ]]; then
netcdf_parallel=$($NETCDF_PATH/bin/nc-config --has-parallel)
if [ "${netcdf_parallel}" == "yes" ]
then
MPI=YES
else
MPI=NO
fi
else
echo "Unable to determine whether netCDF is parallel or serial. Assuming serial"
echo "Set either `NETCDF_PATH` or `MPI` manually if the assumption is incorrect."
MPI=NO
fi
fi

MPI=$(check_valid MPI)
Expand Down

0 comments on commit 7790d5a

Please sign in to comment.