Skip to content

Commit

Permalink
Merge pull request #278 from mabarnes/machine-setup-julia-mpi-option
Browse files Browse the repository at this point in the history
Option to use Julia-provided MPI in machine setup
  • Loading branch information
johnomotani authored Nov 8, 2024
2 parents 57e0d1d + 12d3f7f commit 6fccead
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 184 deletions.
98 changes: 52 additions & 46 deletions machines/generic-pc/compile_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,68 @@ ARTIFACT_DIR=$PWD
# HDF5
######

# Get default response for whether to download/build HDF5
DEFAULT_BUILDHDF5=$(../../bin/julia --project ../shared/get_mk_preference.jl build_hdf5 "y")
SYSTEM_MPI=$(../../bin/julia --project ../shared/get_mk_preference.jl use_system_mpi)

if [[ $DEFAULT_BUILDHDF5 == "y" ]]; then
echo "Do you want to download, and compile a local version of HDF5 (if you do"
echo "not do this, you will be given the option to choose an HDF5 library to"
echo "link later)? [y]/n"
read -p "> " input
while [[ ! -z $input && !( $input == "y" || $input == "n" ) ]]; do
echo
echo "$input is not a valid response: y/[n]"
if [[ $SYSTEM_MPI == "y" ]]; then
# Get default response for whether to download/build HDF5
DEFAULT_BUILDHDF5=$(../../bin/julia --project ../shared/get_mk_preference.jl build_hdf5 "y")

if [[ $DEFAULT_BUILDHDF5 == "y" ]]; then
echo "Do you want to download, and compile a local version of HDF5 (if you do"
echo "not do this, you will be given the option to choose an HDF5 library to"
echo "link later)? [y]/n"
read -p "> " input
done
if [[ -z $input || $input == "y" ]]; then
BUILDHDF5="y"
while [[ ! -z $input && !( $input == "y" || $input == "n" ) ]]; do
echo
echo "$input is not a valid response: y/[n]"
read -p "> " input
done
if [[ -z $input || $input == "y" ]]; then
BUILDHDF5="y"
else
BUILDHDF5="n"
fi
else
BUILDHDF5="n"
fi
else
echo "Do you want to download, and compile a local version of HDF5 (if you do"
echo "not do this, you will be given the option to choose an HDF5 library to"
echo "link later)? y/[n]"
read -p "> " input
while [[ ! -z $input && !( $input == "y" || $input == "n" ) ]]; do
echo
echo "$input is not a valid response: y/[n]"
echo "Do you want to download, and compile a local version of HDF5 (if you do"
echo "not do this, you will be given the option to choose an HDF5 library to"
echo "link later)? y/[n]"
read -p "> " input
done
if [[ -z $input || $input == "n" ]]; then
BUILDHDF5="n"
else
BUILDHDF5="y"
while [[ ! -z $input && !( $input == "y" || $input == "n" ) ]]; do
echo
echo "$input is not a valid response: y/[n]"
read -p "> " input
done
if [[ -z $input || $input == "n" ]]; then
BUILDHDF5="n"
else
BUILDHDF5="y"
fi
fi
fi

# Save current response for whether to download/build HDF5 as default
../../bin/julia --project ../shared/set_mk_preference.jl build_hdf5 $BUILDHDF5
# Save current response for whether to download/build HDF5 as default
../../bin/julia --project ../shared/set_mk_preference.jl build_hdf5 $BUILDHDF5

if [[ $BUILDHDF5 == "y" && -d hdf5-build ]]; then
echo "HDF5 appears to have been downloaded, compiled and installed already."
echo "Do you want to download, compile and install again, overwriting the existing "
echo "version? y/[n]"
read -p "> " input
while [[ ! -z $input && !( $input == "y" || $input == "n" ) ]]; do
echo
echo "$input is not a valid response: y/[n]"
if [[ $BUILDHDF5 == "y" && -d hdf5-build ]]; then
echo "HDF5 appears to have been downloaded, compiled and installed already."
echo "Do you want to download, compile and install again, overwriting the existing "
echo "version? y/[n]"
read -p "> " input
done
if [[ -z $input || $input == "n" ]]; then
BUILDHDF5="n"
else
# Remove the install directory if it exists already
if [[ -d hdf5-build ]]; then
rm -r hdf5-build
while [[ ! -z $input && !( $input == "y" || $input == "n" ) ]]; do
echo
echo "$input is not a valid response: y/[n]"
read -p "> " input
done
if [[ -z $input || $input == "n" ]]; then
BUILDHDF5="n"
else
# Remove the install directory if it exists already
if [[ -d hdf5-build ]]; then
rm -r hdf5-build
fi
fi
fi
else
BUILD_HDF5="n"
fi

if [[ $BUILDHDF5 == "y" ]]; then
Expand Down
Loading

0 comments on commit 6fccead

Please sign in to comment.