Commit 72ff931d authored by Yaser Afshar's avatar Yaser Afshar

minor correction on the script - now PETSC installation works correctly

parent c6c13f43
......@@ -10,8 +10,9 @@ source script/conf_PETSC
source script/update_openfpm
### switch to the branch
b_switch=$(cat switch_branch)
b_switch=`git rev-parse --abbrev-ref HEAD`
b_switch=
#b_switch=$(cat switch_branch)
if [ x"$b_switch" != x"" ]; then
git checkout $b_switch
echo -e "Please relaunch ./install ..."
......@@ -101,13 +102,12 @@ if [ $upgrade_openfpm -eq 1 ]; then
exit 0
fi
remove_old $i_dir
remove_old $i_dir $configure_options
## Check and try to install the prerequisites
pre_req
## clone the dependencies
git submodule init
if [ $? -ne 0 ]; then
echo -e "Configure\033[91;5;1m FAILED \033[0m"
......@@ -121,7 +121,6 @@ if [ $? -ne 0 ]; then
fi
# Create config directory in each submodule
cd openfpm_data
if [ ! -d src/config ]; then
mkdir src/config
......@@ -166,6 +165,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
## check for options
echo -e "\033[1;34;5mDEPENCENCIES INSTALLATION DIR \033[0m"
......@@ -177,7 +177,7 @@ if [ x"$configure_options" == x"" ]; then
fi
if [ $sq -eq 0 ]; then
unset commands
commands[0]="Continue"
commands[0]="continue"
possible_solutions "${commands[@]}"
fi
......@@ -363,7 +363,6 @@ else
conf_PETSC
./configure $options $configure_options "$configure_blas_option"
fi
### Create example.mk
......
......@@ -2,47 +2,47 @@
function conf_PETSC()
{
if [ -d "$i_dir/PETSC" ]; then
if [ -d "$i_dir/PETSC" ]; then
configure_options="$configure_options --with-petsc=$i_dir/PETSC "
lin_alg_dir="$lin_alg_dir -L$i_dir/PETSC/lib"
lin_alg_lib="$lin_alg_lib -lpetsc"
lin_alg_inc="$lin_alg_inc -I$i_dir/PETSC/include"
fi
if [ -d "$i_dir/HYPRE" ]; then
fi
if [ -d "$i_dir/HYPRE" ]; then
lin_alg_dir="$lin_alg_dir -L$i_dir/HYPRE/lib"
lin_alg_inc="$lin_alg_inc -I$i_dir/HYPRE/include"
fi
if [ -d "$i_dir/MUMPS" ]; then
fi
if [ -d "$i_dir/MUMPS" ]; then
lin_alg_dir="$lin_alg_dir -L$i_dir/MUMPS/lib"
lin_alg_inc="$lin_alg_inc -I$i_dir/MUMPS/include"
fi
if [ -d "$i_dir/OPENBLAS" ]; then
fi
if [ -d "$i_dir/OPENBLAS" ]; then
lin_alg_dir="$lin_alg_dir -L$i_dir/OPENBLAS/lib"
lin_alg_lib="$lin_alg_lib -lopenblas"
lin_alg_inc="$lin_alg_inc -I$i_dir/OPENBLAS/include"
configure_blas_option="--with-blas=-L$i_dir/OPENBLAS/lib -lopenblas"
fi
if [ -d "$i_dir/SCALAPACK" ]; then
fi
if [ -d "$i_dir/SCALAPACK" ]; then
lin_alg_dir="$lin_alg_dir -L$i_dir/SCALAPACK/lib"
lin_alg_inc="$lin_alg_inc -I$i_dir/SCALAPACK/include"
fi
if [ -d "$i_dir/SUPERLU_DIST" ]; then
fi
if [ -d "$i_dir/SUPERLU_DIST" ]; then
lin_alg_dir="$lin_alg_dir -L$i_dir/SUPERLU_DIST/lib"
lin_alg_inc="$lin_alg_inc -I$i_dir/SUPERLU_DIST/include"
fi
if [ -d "$i_dir/TRILINOS" ]; then
fi
if [ -d "$i_dir/TRILINOS" ]; then
lin_alg_dir="$lin_alg_dir -L$i_dir/TRILINOS/lib"
lin_alg_inc="$lin_alg_inc -I$i_dir/TRILINOS/include"
fi
if [ -d "$i_dir/SUITESPARSE" ]; then
fi
if [ -d "$i_dir/SUITESPARSE" ]; then
lin_alg_dir="$lin_alg_dir -L$i_dir/SUITESPARSE/lib"
lin_alg_inc="$lin_alg_inc -I$i_dir/SUITESPARSE/include"
lin_alg_lib="$lin_alg_lib -lumfpack -lamd -lbtf -lcamd -lccolamd -lcholmod -lcolamd -lcxsparse -lklu -ldl -lrbio -lspqr -lsuitesparseconfig"
configure_options="$configure_options --with-suitesparse=$i_dir/SUITESPARSE "
fi
if [ -d "$i_dir/EIGEN" ]; then
fi
if [ -d "$i_dir/EIGEN" ]; then
configure_options=" $configure_options --with-eigen=$i_dir/EIGEN "
lin_alg_inc="$lin_alg_inc -I$i_dir/EIGEN"
fi
fi
}
#! /bin/bash
function haveProg() {
[ -x "$(command -v $1)" ]
}
function gpp_clang()
{
if [ x"$dgc_compiler" == x"g++" ]; then
......@@ -15,22 +19,19 @@ function gpp_clang()
fi
}
function detect_compiler()
{
gpp_found=0
icpc_found=0
dgc_ret=0
# First we try to understand if g++ command line is linked to clang
if haveProg g++; then
g++ --version | grep "Apple LLVM"
g++ --version | grep "Apple LLVM" >/dev/null 2>&1
if [ $? == 0 ]; then
echo "Apple LLVM based g++"
echo "Apple LLVM based g++"
# we try the detect the version
major=$(g++ --version | grep LLVM | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*(clang.*/\1/g')
......@@ -70,8 +71,8 @@ function detect_compiler()
fi
fi
g++ --version | grep g++
if [ $? == 0 -a x"g++" == x"g++" ]; then
g++ --version | grep "g++" > /dev/null 2>&1
if [ $? == 0 ]; then
dgc_major=$(g++ --version | grep g++ | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/g')
dgc_middle=$(g++ --version | grep g++ | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/g')
dgc_minor=$(g++ --version | grep g++ | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/g')
......@@ -106,8 +107,8 @@ function detect_compiler()
fi
fi
g++ --version | grep g++
if [ $? == 0 -a x"g++" == x"clang" ]; then
g++ --version | grep "clang" > /dev/null 2>&1
if [ $? == 0 ]; then
dgc_major=$(g++ --version | grep g++ | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/g')
dgc_middle=$(g++ --version | grep g++ | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/g')
dgc_minor=$(g++ --version | grep g++ | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/g')
......@@ -137,9 +138,11 @@ function detect_compiler()
gpp_found=0
fi
fi
fi
icpc --version | grep icpc
if [ $? == 0 -a x"icpc" == x"icpc" ]; then
if haveProg icpc; then
icpc --version | grep icpc > /dev/null 2>&1
if [ $? == 0 ]; then
dgc_major=$(icpc --version | grep icpc | sed 's/.*\([0-9][0-9]\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/g')
dgc_middle=$(icpc --version | grep icpc | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/g')
dgc_minor=$(icpc --version | grep icpc | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/g')
......@@ -165,9 +168,9 @@ function detect_compiler()
icpc_found=1
fi
fi
fi
### If we detect more than one valid compiler ask to choose
if [ $icpc_found -eq 1 -a $gpp_found -eq 1 ]; then
echo "Two different valid compilers has been found please choose one"
commands[0]="icpc"
......
#! /bin/bash
function haveProg() {
[ -x "$(command -v $1)" ]
}
function discover_package_manager() {
if [ x"$1" = x"osx" ]; then
command -v brew >/dev/null
if [ $? -eq 0 ]; then
if [ x"$1" == x"osx" ]; then
if haveProg brew; then
discover_package_manager_ret="brew"
brew_idir=$(brew --prefix)
brew_path=$(which brew)
brew_user=$(stat -f '%Su' $brew_path)
if [ x$"brew_user" == root ]; then
discover_package_ret="sudo brew"
echo 'Package Manager: '"$discover_package_manager_ret"
return
else
if [ ! -w $brew_idir ]; then
......@@ -22,36 +26,38 @@ function discover_package_manager() {
echo -e "\033[43,33;5mWARNING: \033[0m $brew_idir is not writtable, brew require that $brew_idir is writtable and $brew_idir/bin is in your PATH, otherwise it will be not possible to install with brew"
sleep 10
fi
echo echo 'Package Manager: '"$discover_package_manager_ret"
return
fi
command -v port >/dev/null
if [ $? -eq 0 ]; then
if haveProg port; then
discover_package_manager_ret="sudo port"
echo 'Package Manager: '"$discover_package_manager_ret"
return
else
discover_package_manager_ret=""
echo 'Package Manager: '"$discover_package_manager_ret"
return
fi
elif [ x"$1" = x"linux" ]; then
command -v yum >/dev/null
if [ $? -eq 0 ]; then
elif [ x"$1" == x"linux" ]; then
if haveProg yum; then
discover_package_manager_ret="yum"
echo 'Package Manager: '"$discover_package_manager_ret"
return
fi
command -v apt-get >/dev/null
if [ $? -eq 0 ]; then
if haveProg apt-get; then
discover_package_manager_ret="apt-get"
echo 'Package Manager: '"$discover_package_manager_ret"
return
fi
command -v zypper >/dev/null
if [ $? -eq 0 ]; then
if haveProg zypper; then
discover_package_manager_ret="zypper"
echo 'Package Manager: '"$discover_package_manager_ret"
return
else
discover_package_manager_ret=""
echo 'Package Manager: '"$discover_package_manager_ret"
return
fi
fi
fi
}
echo "$discover_package_manager_ret"
......@@ -3,7 +3,7 @@
# check if the directory $1/EIGEN exist
if [ -d "$1/EIGEN" ]; then
echo "EIGEN already installed"
echo "EIGEN is already installed"
exit 0
fi
......
......@@ -3,14 +3,39 @@
# check if the directory $1/HDF5 exist
if [ -d "$1/HDF5" ]; then
echo "HDF5 already installed"
echo "HDF5 is already installed"
exit 0
fi
if [ ! -d "$1/ZLIB" ]; then
rm zlib1211.zip
rm -rf zlib-1.2.11
wget https://zlib.net/zlib1211.zip
if [ $? -ne 0 ]; then
echo -e "\033[91;5;1m FAILED! Installation requires an Internet connection \033[0m"
exit 1
fi
unzip zlib1211.zip
cd zlib-1.2.11
CC=mpicc ./configure --prefix=$1/ZLIB
make -j $2
if [ $? -eq 0 ]; then
make check install
else
echo -e "\033[91;5;1m ZLIB Installation FAILED \033[0m"
exit 1
fi
else
echo "ZLIB is already installed"
fi
wget http://ppmcore.mpi-cbg.de/upload/hdf5-1.8.16.tar.bz2
tar -xf hdf5-1.8.16.tar.bz2
cd hdf5-1.8.16
CC=mpicc ./configure --enable-parallel --prefix=$1/HDF5
CC=mpicc ./configure --with-zlib=$1/ZLIB --enable-parallel --prefix=$1/HDF5
make -j $2
mkdir $1/HDF5
make install
......@@ -3,7 +3,7 @@
# check if the directory $1/METIS exist
if [ -d "$1/METIS" ]; then
echo "METIS already installed"
echo "METIS is already installed"
exit 0
fi
......
......@@ -3,7 +3,7 @@
# check if the directory $1/OPENBLAS exist
if [ -d "$1/OPENBLAS" ]; then
echo "OPENBLAS already installed"
echo "OPENBLAS is already installed"
exit 0
fi
......
......@@ -8,7 +8,7 @@ F77=$5
FC=$6
if [ -d "$1/PETSC" ]; then
echo "PETSC already installed"
echo "PETSC is already installed"
exit 0
fi
......@@ -45,7 +45,7 @@ configure_options_hypre=""
if [ -d "$1/PARMETIS" ]; then
configure_options="$configure_options --with-parmetis=yes --with-parmetis-dir=$1/PARMETIS/ "
configure_options="$configure_options --with-parmetis=yes --with-parmetis-dir=$1/PARMETIS "
configure_options_superlu="-DTPL_PARMETIS_INCLUDE_DIRS=$1/PARMETIS/include;$1/METIS/include -DTPL_PARMETIS_LIBRARIES=$1/PARMETIS/lib/libparmetis.a;$1/METIS/lib/libmetis.so $configure_options_superlu"
fi
......@@ -53,10 +53,6 @@ if [ -d "$1/METIS" ]; then
configure_options="$configure_options --with-metis=yes --with-metis-dir=$1/METIS "
fi
#if [ -d "$1/HDF5" ]; then
# configure_options="$configure_options --with-hdf5=yes --with-hdf5-dir=$1/HDF5 "
#fi
if [ -d "$1/BOOST" ]; then
configure_options="$configure_options --with-boost=yes --with-boost-dir=$1/BOOST "
configure_trilinos_options="$configure_trilinos_options -D TPL_ENABLE_Boost=ON -D TPL_ENABLE_BoostLib=ON -D Boost_INCLUDE_DIRS=$1/BOOST/include -D BoostLib_LIBRARY_DIRS=$1/BOOST/lib -D BoostLib_INCLUDE_DIRS=$1/BOOST/include"
......@@ -99,12 +95,48 @@ else
configure_options="$configure_options --with-suitesparse=yes --with-suitesparse-dir=$1/SUITESPARSE "
fi
# Install NETCFD
if [ -d "$1/NETCDF" ]; then
echo "NETCDF is already installed"
configure_options="$configure_options --with-netcdf=yes -with-netcdf-dir=$1/NETCDF --with-hdf5=yes --with-hdf5-dir=$1/HDF5 "
else
if [ -d "$1/HDF5" ]; then
configure_options="$configure_options --with-hdf5=yes --with-hdf5-dir=$1/HDF5 "
else
./script/install_HDF5.sh $1 $2
if [ $? -eq 0 ]; then
configure_options="$configure_options --with-hdf5=yes --with-hdf5-dir=$1/HDF5 "
fi
fi
rm netcdf-4.4.1.1.tar.gz
rm -rf netcdf-4.4.1.1
wget http://ppmcore.mpi-cbg.de/upload/netcdf-4.4.1.1.tar.gz
if [ $? -ne 0 ]; then
echo -e "\033[91;5;1m FAILED! Installation requires an Internet connection \033[0m"
exit 1
fi
tar -xf netcdf-4.4.1.1.tar.gz
cd netcdf-4.4.1.1
./configure CC=mpicc CPPFLAGS="-I$1/HDF5/include -I$1/ZLIB/include " LDFLAGS="-L$1/HDF5/lib -L$1/ZLIB/lib" --disable-dap --disable-shared --prefix=$1/NETCDF
make -j $2
if [ $? -eq 0 ]; then
make install
configure_options="$configure_options --with-netcdf=yes -with-netcdf-dir=$1/NETCDF "
else
echo -e "\033[91;5;1m FAILED! NETCDF Installation \033[0m"
exit 1
fi
fi
if [ ! -d "$1/TRILINOS" ]; then
rm trilinos-12.10.1-Source.tar.bz2
rm -rf trilinos-12.10.1-Source
wget http://ppmcore.mpi-cbg.de/upload/trilinos-12.10.1-Source.tar.bz2
if [ $? -ne 0 ]; then
echo -e "\033[91;5;1m FAILED Installation require an Internet connection \033[0m"
echo -e "\033[91;5;1m FAILED! Installation requires an Internet connection \033[0m"
exit 1
fi
tar -xf trilinos-12.10.1-Source.tar.bz2
......@@ -134,7 +166,7 @@ if [ ! -d "$1/TRILINOS" ]; then
configure_options="$configure_options --with-trilinos=yes -with-trilinos-dir=$1/TRILINOS"
fi
else
echo "Trilinos already installed"
echo "Trilinos is already installed"
configure_options="$configure_options --with-trilinos=yes -with-trilinos-dir=$1/TRILINOS"
fi
......@@ -145,7 +177,7 @@ if [ ! -d "$1/SCALAPACK" ]; then
rm -rf scalapack-2.0.2
wget http://ppmcore.mpi-cbg.de/upload/scalapack-2.0.2.tgz
if [ $? -ne 0 ]; then
echo -e "\033[91;5;1m FAILED Installation require an Internet connection \033[0m"
echo -e "\033[91;5;1m FAILED! Installation requires an Internet connection \033[0m"
exit 1
fi
tar -xf scalapack-2.0.2.tgz
......@@ -160,20 +192,18 @@ if [ ! -d "$1/SCALAPACK" ]; then
configure_options="$configure_options --with-scalapack=yes -with-scalapack-dir=$1/SCALAPACK"
fi
else
echo "Scalapack already installed"
echo "Scalapack is already installed"
configure_options="$configure_options --with-scalapack=yes -with-scalapack-dir=$1/SCALAPACK"
fi
### MUMPS installation
if [ x"$CXX" != x"icpc" ]; then
if [ ! -d "$1/MUMPS" ]; then
rm MUMPS_5.0.1.tar.gz
rm -rf MUMPS_5.0.1
wget http://ppmcore.mpi-cbg.de/upload/MUMPS_5.0.1.tar.gz
if [ $? -ne 0 ]; then
echo -e "\033[91;5;1m FAILED Installation require an Internet connection \033[0m"
echo -e "\033[91;5;1m FAILED! Installation requires an Internet connection \033[0m"
exit 1
fi
tar -xf MUMPS_5.0.1.tar.gz
......@@ -199,7 +229,6 @@ if [ x"$CXX" != x"icpc" ]; then
$sed_command -i "/LIBPAR\s\+=\s\$(SCALAP)\s\-L\/usr\/lib\s\-lmpi/c\LIBPAR = \$(SCALAP)" Makefile.inc
make -j $2
if [ $? -eq 0 ]; then
## Copy LIB and include in the target directory
......@@ -207,13 +236,13 @@ if [ x"$CXX" != x"icpc" ]; then
cp -r include $1/MUMPS
cp -r lib $1/MUMPS
MUMPS_extra_lib="$1/MUMPS/lib/libdmumps.a $1/MUMPS/lib/libmumps_common.a $1/MUMPS/lib/libpord.a -pthread "
MUMPS_extra_lib="-L$1/MUMPS/lib -ldmumps -lmumps_common -lpord -pthread "
configure_options="$configure_options --with-mumps=yes --with-mumps-include=$1/MUMPS/include"
fi
else
echo "MUMPS already installed"
MUMPS_extra_lib="$1/MUMPS/lib/libdmumps.a $1/MUMPS/lib/libmumps_common.a $1/MUMPS/lib/libpord.a -pthread "
echo "MUMPS is already installed"
MUMPS_extra_lib="-L$1/MUMPS/lib -ldmumps -lmumps_common -lpord -pthread "
configure_options="$configure_options --with-mumps=yes --with-mumps-include=$1/MUMPS/include"
fi
fi
......@@ -225,7 +254,7 @@ if [ ! -d "$1/SUPERLU_DIST" ]; then
rm -rf SuperLU_DIST_5.1.3
wget http://ppmcore.mpi-cbg.de/upload/superlu_dist_5.1.3.tar.gz
if [ $? -ne 0 ]; then
echo -e "\033[91;5;1m FAILED Installation require an Internet connection \033[0m"
echo -e "\033[91;5;1m FAILED! Installation requires an Internet connection \033[0m"
exit 1
fi
tar -xf superlu_dist_5.1.3.tar.gz
......@@ -258,9 +287,7 @@ if [ ! -d "$1/SUPERLU_DIST" ]; then
# $sed_command -i "/\s\$(I_PARMETIS)\s-DDEBUGlevel=0\s-DPRNTlevel=0\s-DPROFlevel=0\s\\\/c\ " make.inc
make
if [ $? -eq 0 ]; then
make install
echo 1 > $1/SUPERLU_DIST/version
......@@ -276,7 +303,7 @@ if [ ! -d "$1/SUPERLU_DIST" ]; then
fi
else
echo "SUPERLU already installed"
echo "SUPERLU is already installed"
if [ x"$CXX" == x"icpc" ]; then
configure_options="$configure_options"
else
......@@ -291,7 +318,7 @@ if [ ! -d "$1/HYPRE" ]; then
rm -rf hypre-2.11.2
wget http://ppmcore.mpi-cbg.de/upload/hypre-2.11.2.tar.gz
if [ $? -ne 0 ]; then
echo -e "\033[91;5;1m FAILED Installation require an Internet connection \033[0m"
echo -e "\033[91;5;1m FAILED! Installation requires an Internet connection \033[0m"
exit 1
fi
tar -xf hypre-2.11.2.tar.gz
......@@ -301,7 +328,6 @@ if [ ! -d "$1/HYPRE" ]; then
./configure CC=mpicc CXX=mpic++ CFLAGS=-fpic $configure_options_hypre --prefix=$1/HYPRE
make -j $2
if [ $? -eq 0 ]; then
make install
echo 1 > $1/HYPRE/version
......@@ -309,41 +335,15 @@ if [ ! -d "$1/HYPRE" ]; then
fi
else
echo "HYPRE already installed"
echo "HYPRE is already installed"
configure_options="$configure_options --with-hypre=yes -with-hypre-dir=$1/HYPRE"
fi
# Install NETCFD
if [ ! -d "$1/NETCDF" ]; then
rm netcdf-4.4.1.1.tar.gz
rm -rf netcdf-4.4.1.1
wget http://ppmcore.mpi-cbg.de/upload/netcdf-4.4.1.1.tar.gz
if [ $? -ne 0 ]; then
echo -e "\033[91;5;1m FAILED Installation require an Internet connection \033[0m"
exit 1
fi
tar -xf netcdf-4.4.1.1.tar.gz
cd netcdf-4.4.1.1
./configure CC=mpicc CPPFLAGS=-I$1/HDF5/include LDFLAGS=-L$1/HDF5/lib --disable-dap --disable-shared --prefix=$1/NETCDF
make -j $2
if [ $? -eq 0 ]; then
make install
configure_options="$configure_options --with-netcdf=yes -with-netcdf-dir=$1/NETCDF --with-hdf5=yes --with-hdf5-dir=$1/HDF5"
fi
else
echo "NETCDF already installed"
configure_options="$configure_options --with-netcdf=yes -with-netcdf-dir=$1/NETCDF --with-hdf5=yes --with-hdf5-dir=$1/HDF5"
fi
rm petsc-lite-3.7.6.tar.gz
rm -rf petsc-3.7.6
wget http://ppmcore.mpi-cbg.de/upload/petsc-lite-3.7.6.tar.gz
if [ $? -ne 0 ]; then
echo -e "\033[91;5;1m FAILED Installation require an Internet connection \033[0m"
echo -e "\033[91;5;1m FAILED! Installation requires an Internet connection \033[0m"
exit 1
fi
tar -xf petsc-lite-3.7.6.tar.gz
......@@ -351,11 +351,14 @@ cd petsc-3.7.6
echo "./configure COPTFLAGS="-O3 -g" CXXOPTFLAGS="-O3 -g" FOPTFLAGS="-O3 -g" $ldflags_petsc --with-cxx-dialect=C++11 $petsc_openmp --with-mpi-dir=$mpi_dir $configure_options --with-mumps-lib="$MUMPS_extra_lib" --prefix=$1/PETSC --with-debugging=0"
python_command=python
# if python2 exist use python2
command -v python2 >/dev/null
if [ $? -eq 0 ]; then
function haveProg() {
[ -x "$(command -v $1)" ]
}
if haveProg python2; then
python_command=python2
else
python_command=python
fi
$python_command configure COPTFLAGS="-O3 -g" CXXOPTFLAGS="-O3 -g" FOPTFLAGS="-O3 -g" $ldflags_petsc --with-cxx-dialect=C++11 $petsc_openmp --with-mpi-dir=$mpi_dir $configure_options --with-mumps-lib="$MUMPS_extra_lib" --prefix=$1/PETSC --with-debugging=0
......
......@@ -6,7 +6,7 @@ discover_os
# check if the directory $1/PARMETIS exist
if [ -d "$1/PARMETIS" ]; then
echo "PARMETIS already installed"
echo "PARMETIS is already installed"
exit 0
fi
......
......@@ -8,7 +8,7 @@ discover_os
# check if the directory $1/SUITESPARSE exist
if [ -d "$1/SUITESPARSE" ]; then
echo "SUITESPARSE already installed"
echo "SUITESPARSE is already installed"
exit 0
fi
......@@ -16,7 +16,7 @@ wget http://ppmcore.mpi-cbg.de/upload/SuiteSparse-4.5.5.tar.gz
rm -rf SuiteSparse
tar -xf SuiteSparse-4.5.5.tar.gz
if [ $? != 0 ]; then
echo "Fail to download SuiteSparse"
echo "Failed to download SuiteSparse"
exit 1
fi
cd SuiteSparse
......@@ -57,7 +57,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$1/OPENBLAS/lib"
echo "Compiling SuiteSparse without CUDA (old variable $CUDA)"
make "CUDA=no" "BLAS=-L$1/OPENBLAS/lib -lopenblas" "LAPACK="
if [ $? != 0 ]; then
echo "Fail to compile SuiteSparse"
echo "Failed to compile SuiteSparse"
exit 1
fi
make install "CUDA=no" "INSTALL=$1/SUITESPARSE" "INSTALL_LIB=$1/SUITESPARSE/lib" "INSTALL_INCLUDE=$1/SUITESPARSE/include" "BLAS=-L$1/OPENBLAS/lib -lopenblas" "LAPACK="
......
#! /bin/bash
function haveProg() {
[ -x "$(command -v $1)" ]
}
function pre_req()
{
source script/discover_package_manager
......@@ -72,127 +76,132 @@ fi
#### if we are on OSX we install gnu-sed
if [ x"$platform" == x"osx" ]; then
command -v gsed >/dev/null 2>&1
if [ $? -ne 0 ]; then
if haveProg gsed; then
echo -e "gsed\033[92;1m SUCCESS \033[0m"
else
echo >&2
echo -e "gsed\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require gnu-sed but it's not installed, searching a solution... "
solve_gsed $platform
command -v gsed >/dev/null 2>&1
if [ $? -ne 0 ]; then