install_HDF5.sh 1.22 KB
Newer Older
Pietro Incardona's avatar
Pietro Incardona committed
1
2
#! /bin/bash

Pietro Incardona's avatar
Pietro Incardona committed
3
4
5
6
source script/discover_os

discover_os

Pietro Incardona's avatar
Pietro Incardona committed
7
8
# check if the directory $1/HDF5 exist

9
if [ -d "$1/HDF5" -a -f "$1/HDF5/include/hdf5.h" ]; then
10
  echo "HDF5 is already installed"
Pietro Incardona's avatar
Pietro Incardona committed
11
12
13
  exit 0
fi

14
if [ ! -d "$1/ZLIB"  -a x"$platform" != x"cygwin" ]; then
Pietro Incardona's avatar
Pietro Incardona committed
15
  rm zlib-1.2.11.tar.gz
16
  rm -rf zlib-1.2.11
Pietro Incardona's avatar
Pietro Incardona committed
17
  wget https://zlib.net/zlib-1.2.11.tar.gz
18
19
20
21
  if [ $? -ne 0 ]; then
    echo -e "\033[91;5;1m FAILED! Installation requires an Internet connection \033[0m"
    exit 1
  fi
Pietro Incardona's avatar
Pietro Incardona committed
22
  tar -xf zlib-1.2.11.tar.gz
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  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

39
### 1.8.19 does not compile on CYGWIN
Pietro Incardona's avatar
Pietro Incardona committed
40
41
wget http://ppmcore.mpi-cbg.de/upload/hdf5-1.8.19.tar.gz
tar -xf hdf5-1.8.19.tar.gz
Pietro Incardona's avatar
Pietro Incardona committed
42
cd hdf5-1.8.19
Pietro Incardona's avatar
Pietro Incardona committed
43

Pietro Incardona's avatar
Pietro Incardona committed
44
if [ x"$platform" != x"cygwin" ]; then
Pietro Incardona's avatar
Pietro Incardona committed
45
        CC=mpicc ./configure --with-zlib=$1/ZLIB --enable-parallel --prefix=$1/HDF5
46
	make -j $2
Pietro Incardona's avatar
Pietro Incardona committed
47
48
else
        CC=mpicc ./configure --enable-parallel --prefix=$1/HDF5
49
	make CFLAGS=-D_POSIX_C_SOURCE -j $2
Pietro Incardona's avatar
Pietro Incardona committed
50
fi
Pietro Incardona's avatar
Pietro Incardona committed
51
52
mkdir $1/HDF5
make install
53
54
55
56
if [ $? -ne 0 ]; then
    echo "HDF5 error installing"
    exit 0
fi
Pietro Incardona's avatar
Pietro Incardona committed
57
echo 1 > $1/HDF5/version