Forked from
Sbalzarini Lab / Software / Parallel Computing / OpenFPM / openfpm_pdata
3801 commits behind the upstream repository.
-
Pietro Incardona authoredPietro Incardona authored
install 4.38 KiB
#! /bin/bash
source script/discover_os
discover_os
## Check and try to install the prerequisites
script/pre_req
## clone the dependencies
git submodule init
git submodule update
# Create config directory
mkdir src/config
## generate configure script
sh ./autogen.sh
if [ $? -ne 0 ]; then
echo -e "Configure\033[91;5;1m FAILED \033[0m"
exit 1
fi
## Take all the options with the exception of --enable-install-req
install_req=1
configure_options=""
for var in $@
do
echo $var
if [ x"$var" != x"--disable-install-req" ] ; then
configure_options="$configure_options $var"
else
install_req=0
fi
done
## call the configure script
MPI_installed=0
METIS_installed=0
BOOST_installed=0
conf_err=1
## MPI
command -v mpic++ >/dev/null 2>&1
if [ $? -eq 0 ]; then
options="CXX=mpic++"
fi
##
if [ $install_req -eq 0 ]; then
./configure $options $configure_options
else
while [ $conf_err -ne 0 ]
do
./configure $options $configure_options
conf_err=$?
echo "Configure script terminated with $conf_err"
## if MPI or METIS installation required install it
if [ $conf_err -eq 200 ]; then
echo "MPI not found try to install"
if [ $MPI_installed -eq 1 ]; then
echo "Error the installation of MPI failed"
exit 1
fi
./script/install_MPI.sh
MPI_installed=1
export PATH="$PATH:${HOME}/MPI/bin"
echo $PATH
configure_options="$configure_options CXX=mpic++ "
elif [ $conf_err -eq 201 ]; then
echo "Metis not found try to install"
if [ $METIS_installed -eq 1 ]; then
echo "Error the installation of METIS failed"
exit 1
fi
./script/install_Metis.sh
METIS_installed=1
configure_options=" $configure_options --with-metis=${HOME}/METIS "
elif [ $conf_err -eq 202 ]; then
echo "Boost not found try to install"
if [ $BOOST_installed -eq 1 ]; then
echo "Error the installation of Boost failed"
exit 1
fi
./script/install_BOOST.sh
BOOST_installed=1
configure_options=" $configure_options --with-boost=${HOME}/BOOST "
elif [ $conf_err -ne 0 ]; then
echo "I do not know how to recover from this error"
exit 1
fi
done
fi
make
if [ $? -ne 0 ]; then
conf_err=1
fi
echo ""
echo ""
if [ $conf_err -eq 0 ]; then
echo -e "Install\033[92;5;1m SUCCEED \033[0m"
else
echo -e "Install\033[91;5;1m FAILED \033[0m"
fi
echo "Command used to configure"
echo ""
echo -e "\033[1m ./configure $configure_options \033[0m "
echo ""
if [ $MPI_installed -eq 1 ]; then
echo -e "\033[1;34;5m --------------------------------------- \033[0m"
echo -e "\033[1;34;5m ----------------- MPI ----------------- \033[0m"
echo -e " MPI has been installed into: \033[1m $HOME/MPI \033[0m"
echo ""
if [ x"$platform" = x"linux" ]; then
echo -e "\033[1m export PATH=\"\$PATH:\$HOME/MPI \" \033[0m "
echo -e "\033[1m export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:\$HOME/MPI/lib\" \033[0m "
else
echo -e "\033[1m export PATH=\"\$PATH:\$HOME/MPI \" \033[0m "
echo -e "\033[1m export DYLD_LIBRARY_PATH=\"\$DYLD_LIBRARY_PATH:\$HOME/MPI/lib\" \033[0m"
fi
fi
if [ $METIS_installed -eq 1 ]; then
echo ""
echo -e "\033[1;34;5m --------------------------------------- \033[0m"
echo -e "\033[1;34;5m ---------------- METIS ---------------- \033[0m"
echo -e " METIS has been installed into: \033[1m $HOME/METIS \033[0m"
echo ""
if [ x"$platform" = x"linux" ]; then
echo -e "\033[1m export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:\$HOME/METIS/lib\" \033[0m "
else
echo -e "\033[1m export DYLD_LIBRARY_PATH=\"\$DYLD_LIBRARY_PATH:\$HOME/METIS/lib\" \033[0m"
fi
fi
if [ $BOOST_installed -eq 1 ]; then
echo ""
echo -e "\033[1;34;5m --------------------------------------- \033[0m"
echo -e "\033[1;34;5m ---------------- BOOST ---------------- \033[0m"
echo -e " BOOST has been installed into: \033[1m $HOME/BOOST \033[0m"
echo ""
if [ x"$platform" = x"linux" ]; then
echo -e "\033[1m export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:\$HOME/BOOST/lib\" \033[0m "
else
echo -e "\033[1m export DYLD_LIBRARY_PATH=\"\$DYLD_LIBRARY_PATH:\$HOME/BOOST/lib\" \033[0m"
fi
fi
echo ""
echo ""