Skip to content
Snippets Groups Projects
Commit 4c18d957 authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Installation scripts

parent d510902a
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,6 @@ git submodule init ...@@ -11,7 +11,6 @@ git submodule init
git submodule update git submodule update
cd openfpm_data cd openfpm_data
pwd
git checkout develop git checkout develop
cd .. cd ..
......
#! /bin/bash #! /bin/bash
## Check and try to install the prerequisites
script/pre_req
## clone the dependencies
git submodules init
git submodules update
## Take all the options with the exception of --enable-install-req ## Take all the options with the exception of --enable-install-req
install_req=1 install_req=1
...@@ -39,7 +48,7 @@ else ...@@ -39,7 +48,7 @@ else
echo "Error the installation of MPI failed" echo "Error the installation of MPI failed"
exit 1 exit 1
fi fi
./install_MPI.sh ./script/install_MPI.sh
MPI_installed=1 MPI_installed=1
export PATH="$PATH:${HOME}/MPI/bin" export PATH="$PATH:${HOME}/MPI/bin"
configure_options="$configure_options CXX=mpic++ " configure_options="$configure_options CXX=mpic++ "
...@@ -49,7 +58,7 @@ else ...@@ -49,7 +58,7 @@ else
echo "Error the installation of METIS failed" echo "Error the installation of METIS failed"
exit 1 exit 1
fi fi
./install_Metis.sh ./script/install_Metis.sh
METIS_installed=1 METIS_installed=1
configure_options=" $configure_options --with-metis=${HOME}/METIS " configure_options=" $configure_options --with-metis=${HOME}/METIS "
elif [ $conf_err -eq 202 ]; then elif [ $conf_err -eq 202 ]; then
...@@ -58,7 +67,7 @@ else ...@@ -58,7 +67,7 @@ else
echo "Error the installation of Boost failed" echo "Error the installation of Boost failed"
exit 1 exit 1
fi fi
./install_BOOST.sh ./script/install_BOOST.sh
BOOST_installed=1 BOOST_installed=1
configure_options=" $configure_options --with-boost=${HOME}/BOOST " configure_options=" $configure_options --with-boost=${HOME}/BOOST "
elif [ $conf_err -ne 0 ]; then elif [ $conf_err -ne 0 ]; then
......
#! /bin/bash
function discover_package_manager() {
if [ x"$1" = x"osx" ]; then
command -v brew >/dev/null
if [ $? -eq 0 ]; then
discover_package_manager_ret="brew"
if [ ! -w /usr/local ]; then
echo -e "\033[93;5mWARNING: \033[0m /usr/local is not writtable, brew require that /usr/local is writtable and /usr/local/bin is in your PATH, otherwise the solutions with brew will fail"
fi
return
fi
command -v port >/dev/null
if [ command -v port >/dev/null 2>&1 ]; then
discover_package_manager_ret="sudo port"
return
else
return
fi
elif [ x"$1" = x"linux" ]; then
command -v yum >/dev/null
if [ $? -eq 0 ]; then
discover_package_manager_ret="yum"
return
fi
command -v apt-get >/dev/null
if [ $? -eq 0 ]; then
discover_package_manager_ret="apt-get"
return
fi
command -v zypper >/dev/null
if [ command -v zypper >/dev/null -eq 0 ]; then
discover_package_manager_ret="zypper"
return
else
return
fi
fi
}
echo "$discover_package_manager_ret"
File moved
File moved
File moved
#! /bin/bash
source script/discover_package_manager
platform=unknown
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo -e "We are on\033[1;34m LINUX \033[0m"
platform=linux
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo -e "We are on\033[1;34m MAC OSX \033[0m"
platform=osx
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo -e "We are on\033[1;34m CYGWIN \033[0m"
echo "This platform is not supported"
exit 1
elif [[ "$OSTYPE" == "msys" ]]; then
echo -e "We are on\033[1;34m Microsoft Window \033[0m"
echo "This platform is not supported"
exit 1
elif [[ "$OSTYPE" == "win32" ]]; then
echo -e "We are on\033[1;34m Microsoft Window \033[0m"
echo "This platform is not supported"
exit 1
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo -e "We are on\033[1;34m FREEBSD \033[0m"
echo "This platform is not supported"
exit 1
else
echo -e "We are on an\033[1;34m unknown OS \033[0m"
echo "This platform is not supported"
exit 1
fi
discover_package_manager $platform
pcman=discover_package_manager_ret
if [ x"$platform" = x"osx" -a x"$pcman" = x"" ]; then
echo -e "\033[93;5;1m WARNING \033[0m No package manager has been found on this system"
fi
command -v git >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "git\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require git but it's not installed, searching a solution... "
script/solve_git $platform
command -v git >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "git\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "git\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "git \033[92;1m SUCCESS \033[0m"
fi
command -v autoconf >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "autoconf\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require autoconf but it's not installed, searching a solution..."
script/solve_autoconf $platform
command -v autoheader >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "autoconf\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "autoconf\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "autoconf\033[92;1m SUCCESS \033[0m"
fi
command -v automake >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "automake\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require automake but it's not installed, searching a solution..."
script/solve_automake $platform
command -v automake >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "automake\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "automake\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "automake\033[92;1m SUCCESS \033[0m"
fi
command -v libtool >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "libtool\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require libtool but it's not installed, searching a solution..."
script/solve_libtool $platform
command -v libtool >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "libtool\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "libtool\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "libtool\033[92;1m SUCCESS \033[0m"
fi
command -v g++ >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "Configure\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require g++ but it's not installed, searching a solution..."
script/solve_gpp $platform
command -v g++ >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "g++\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "g++\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "g++\033[92;1m SUCCESS \033[0m"
fi
#! /bin/bash
function possible_solutions {
sol=1
echo "Possible solutions:"
for com in "$@"
do
echo "$sol $com"
sol=`expr $sol + 1`
done
echo "$sol exit the script"
echo "Choose the solution:"
read choose
if [ x"$choose" = x"$sol" ]; then
exit 1
fi
possible_solutions_ret=`expr $choose - 1`
}
#! /bin/bash
source script/show_solutions
source script/discover_package_manager
discover_package_manager $1
pcman=$discover_package_manager_ret
if [ x"$pcman" = x"" ]; then
exit 1
fi
if [ x"$1" = x"osx" ]; then
commands[0]="$pcman install autoconf"
possible_solutions "${commands[@]}"
echo "Executing: ${command[$possible_solutions_ret]}"
eval ${commands[$possible_solutions_ret]}
elif [ x"$1" = x"linux" ]; then
commands[0]="su -c \"$pcman install autoconf\""
commands[1]="sudo $pcman install autoconf"
possible_solutions "${commands[@]}"
echo "Executing: ${command[$possible_solutions_ret]}"
eval ${commands[$possible_solutions_ret]}
fi
#! /bin/bash
source script/show_solutions
source script/discover_package_manager
discover_package_manager $1
pcman=$discover_package_manager_ret
if [ x"$pcman" = x"" ]; then
exit 1
fi
if [ x"$1" = x"osx" ]; then
commands[0]="$pcman install automake"
possible_solutions "${commands[@]}"
echo "Executing: ${command[$possible_solutions_ret]}"
eval ${commands[$possible_solutions_ret]}
elif [ x"$1" = x"linux" ]; then
commands[0]="su -c \"$pcman install automake\""
commands[1]="sudo $pcman install automake"
possible_solutions "${commands[@]}"
echo "Executing: ${command[$possible_solutions_ret]}"
eval ${commands[$possible_solutions_ret]}
fi
#! /bin/bash
source script/show_solutions
source script/discover_package_manager
discover_package_manager $1
pcman=$discover_package_manager_ret
if [ x"$pcman" = x"" ]; then
exit 1
fi
if [ x"$1" = x"osx" ]; then
commands[0]="$pcman install git"
possible_solutions "${commands[@]}"
eval ${command[possible_solutions_ret]}
elif [ x"$1" = x"linux" ]; then
commands[0]="su -c \"$pcman install git\""
commands[1]="sudo $pcman install git"
possible_solutions "${commands[@]}"
eval ${commands[$possible_solutions_ret]}
fi
#! /bin/bash
source script/show_solutions
source script/discover_package_manager
discover_package_manager $1
pcman=$discover_package_manager_ret
if [ x"$pcman" = x"" ]; then
exit 1
fi
if [ x"$1" = x"osx" ]; then
commands[0]="$pcman install libtool"
possible_solutions "${commands[@]}"
echo "Executing: ${command[$possible_solutions_ret]}"
eval ${commands[$possible_solutions_ret]}
elif [ x"$1" = x"linux" ]; then
commands[0]="su -c \"$pcman install libtool\""
commands[1]="sudo $pcman install libtool"
possible_solutions "${commands[@]}"
echo "Executing: ${command[$possible_solutions_ret]}"
eval ${commands[$possible_solutions_ret]}
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment