-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-titan.sh
executable file
·72 lines (66 loc) · 2.16 KB
/
install-titan.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#! /bin/bash
## check for MPI installation
MPCC=
MPCC=$(which mpicc 2> /dev/null)
MPCPP=
MPCPP=`which mpiCC 2> /dev/null` || MPCPP=`which mpicxx 2> /dev/null`
mpi_home=
if [ "x$MPCPP" == x ]; then
echo '-----------------------------------------------------------'
echo ' MPI installtion not found. MPI is required to build titan'
echo '-----------------------------------------------------------'
echo 'Enter absolute path to MPI installtion directory if installed in non-standard place.'
echo '[ctrl-c to quit]'
read mpi_home
fi
## check for HDF5
hdf5_dir=
hcc=`which h5cc`
tempdir=`$hcc -showconfig | fgrep 'Installation point' | awk '{print $3}'`
echo $tempdir
header='include/hdf5.h'
if [ -f $tempdir/$header ]; then
hdf5_dir=$tempdir
#look for hdf5 in some usual places
elif [ -f /usr/$header ]; then
hdf5_dir=/usr
elif [ -f /usr/local/$header ]; then
hdf5_dir=/usr/local
# ${HOME}
elif [ -f ${HOME}/$header ]; then
hdf5_dir=${HOME}
# /opt
elif [ -f /opt/$header ]; then
hdf5_dir=/opt
elif
if [[ "x$hdf5_dir" == x ]]; then
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+ Unable to locate HDF5 installtion. It might not be installed +"
echo "+ or installed in unusual path. PARAVIEW support needs hdf5 +"
echo "+ Please provide absolute path to hdf5 installtion. +"
echo "+ HDF5 is freely downloadle from http://hdf.ncsa.uiuc.edu/HDF5/ +"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Continue without HDF5? (yes/no) [no]"
read response
if [[ "x$response" != xyes ]]; then
echo "If HDF5 is installed in non-standard path, "
echo " provide /full/path/to/hdf5 ...(ctrl-c to QUIT)"
read hdf5_dir
if [ ! -f $hdf5_dir/$header ]; then
echo "ERROR: Could not find hdf5.h in $hdf5_dir"
exit 1;
fi
hdf5_flags='-D H5_USE_16_API'
else
hdf5_dir=no
fi
fi
# run configure
MPI=
if test -n "$MPCPP"; then
MPI="CC=$MPCC CXX=$MPCPP"
else
MPI="--with-mpi=$mpi_home"
fi
./configure $MPI --with-hdf5=$hdf5_dir CPPFLAGS=$hdf5_flags
make && make install