install_Metis.sh 1.08 KB
Newer Older
incardon's avatar
incardon committed
1 2
#! /bin/bash

incardon's avatar
incardon committed
3 4
source script/discover_os

incardon's avatar
incardon committed
5
# check if the directory $1/METIS exist
incardon's avatar
incardon committed
6

incardon's avatar
incardon committed
7
if [ -d "$1/METIS" ]; then
8
  echo "METIS is already installed"
incardon's avatar
incardon committed
9 10 11
  exit 0
fi

12
## Remove old download
Pietro Incardona's avatar
Pietro Incardona committed
13
rm metis-5.1.0.tar.gz
14
rm -rf metis-5.1.0
15
wget http://ppmcore.mpi-cbg.de/upload/metis-5.1.0.tar.gz
incardon's avatar
incardon committed
16
tar -xf metis-5.1.0.tar.gz
incardon's avatar
incardon committed
17
cd metis-5.1.0
incardon's avatar
incardon committed
18 19 20 21 22 23 24

if [ x"$platform" == x"cygwin" ]; then
	shared_opt="-DSHARED=OFF"
else
	shared_opt="-DSHARED=ON"
fi

25 26 27 28 29
cputype=$(uname -m | sed "s/\\ /_/g")
systype=$(uname -s)
BUILDDIR=build/$systype-$cputype
mkdir -p $BUILDDIR
cd $BUILDDIR
incardon's avatar
incardon committed
30 31 32
if [ "$#" -eq 4  ]; then
  echo "cmake ../../. $shared_opt -DGKLIB_PATH=../../GKlib -DCMAKE_INSTALL_PREFIX=$1/METIS -DCMAKE_C_COMPILER=$2 -DCMAKE_CXX_COMPILER=$3"
  cmake ../../. $shared_opt -DGKLIB_PATH=../../GKlib  -DCMAKE_INSTALL_PREFIX=$1/METIS -DCMAKE_C_COMPILER=$2 -DCMAKE_CXX_COMPILER=$3
incardon's avatar
incardon committed
33
else
incardon's avatar
incardon committed
34 35
  echo "cmake ../../. $shared_opt -DGKLIB_PATH=../../GKlib -DCMAKE_INSTALL_PREFIX=$1/METIS"
  cmake ../../. $shared_opt -DGKLIB_PATH=../../GKlib -DCMAKE_INSTALL_PREFIX=$1/METIS
incardon's avatar
incardon committed
36
fi
incardon's avatar
incardon committed
37
make -j $4
incardon's avatar
incardon committed
38
make install
incardon's avatar
incardon committed
39

40 41 42
# Mark the installation
echo 1 > $1/METIS/version