source: BOL/script_install/install_netcdf4_hdf5.bash @ 4405

Last change on this file since 4405 was 4405, checked in by fhourdin, 16 months ago

Mise à jour de l'installation sur ~lmdz/pub

Nettoyage du répertoire ~/lmdz/pub
on met tous les scripts dans le répertoir script_install
géré sous svn sous "BOL".
pub/script_install devient donc le résultat d'un svn checkout.
On peut y faire directement des svn update.
Les scripts d'installationdes ordinateurs et de netcdf sont
maintenant gérés au même endroit.
Le script install_lmdz et modifié en conséquence et la gestion
de l'installation de netcdf dans ce script grandement allégée.

  • Property svn:executable set to *
File size: 6.0 KB
Line 
1#!/bin/bash
2#########################################################################
3# Defaults
4#########################################################################
5install_dir=$(pwd)
6c_compiler=gcc
7f_compiler=gfortran
8cxx_compiler=g++
9mpi_home="/usr/lib64/openmpi"
10#########################################################################
11#  Options
12#########################################################################
13while (($# > 0))
14   do
15   case $1 in
16     "-h") cat <<........fin
17    $0 [ -prefix path ]       where (path) to install
18                              (default: $install_dir)
19       [ -CC compiler ]       C compiler to use
20                              (default: $c_compiler)
21       [ -FC compiler ]       Fortran compiler to use
22                              (default: $f_compiler)
23       [ -CXX compiler ]      C++ compiler to use
24                              (default: $cxx_compiler)
25       [ -MPI path ]          top directory of the MPI library
26                              (default: $mpi_home)
27........fin
28     exit ;;
29     "-prefix") install_dir=$2 ; shift ; shift ;;
30     "-CC") c_compiler=$2 ; shift ; shift ;;
31     "-FC") f_compiler=$2 ; shift ; shift ;;
32     "-CXX") cxx_compiler=$2 ; shift ; shift ;;
33     "-MPI") mpi_home=$2 ; shift ; shift ;;
34     *) echo "Error, bad argument $1" ; $0 -h ; exit
35   esac
36done
37
38# Install directory (get full path)
39mkdir -p $install_dir
40install_dir=$(cd $install_dir ; pwd -P )
41
42# Install location for packages
43mkdir -p $install_dir/src
44
45# CURL
46APP=curl-7.26.0
47CURL_PATH=$install_dir/$APP
48rm -rf $CURL_PATH 
49cd $install_dir/src
50rm -rf curl-7.26.0*
51#wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/curl-7.26.0.tar.gz
52wget -nv --no-check-certificate http://lmdz.lmd.jussieu.fr/pub/src_archives/curl-7.26.0.tar.gz
53tar xvf curl-7.26.0.tar.gz ; cd curl-7.26.0
54export CC=$c_compiler
55./configure \
56--prefix=$install_dir | tee $APP.config.log
57make 2>&1 | tee $APP.make.log
58make install 2>&1 | tee $APP.install.log
59
60# ZLIB
61APP=zlib-1.2.8
62ZLIB_PATH=$install_dir/$APP 
63rm -rf $ZLIB_PATH 
64cd $install_dir/src
65rm -rf zlib-1.2.8*
66#wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/zlib-1.2.8.tar.gz
67wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/Distrib/zlib-1.2.8.tar.gz
68tar zxf zlib-1.2.8.tar.gz ; cd zlib-1.2.8
69export CC=$c_compiler
70export FC=$f_compiler
71export CXX=$cxx_compiler 
72./configure \
73--prefix=$install_dir | tee $APP.config.log
74make 2>&1 | tee $APP.make.log
75make check 2>&1 | tee $APP.make_check.log
76make install 2>&1 | tee $APP.install.log
77
78# HDF5
79APP=hdf5-1.10.7
80HDF5_PATH=$install_dir/$APP 
81rm -rf $HDF5_PATH 
82cd $install_dir/src
83rm -rf ${APP}*
84#wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/hdf5-1.8.13.tar.gz
85wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/Distrib/$APP.tar.gz
86tar xzf $APP.tar.gz ; cd $APP
87export PATH=$mpi_home/bin:$PATH
88if [[ ${LD_LIBRARY_PATH} == '' ]]
89then
90  export LD_LIBRARY_PATH=$mpi_home/lib
91else
92  export LD_LIBRARY_PATH=$mpi_home/lib:${LD_LIBRARY_PATH}
93fi
94export CFLAGS="-I$mpi_home/include -m64"
95export LDFLAGS="-L$mpi_home/lib -lmpi"
96export MPI_BIN=$mpi_home/bin
97export MPI_SYSCONFIG=$mpi_home/etc
98export MPI_FORTRAN_MOD_DIR=$mpi_home/lib
99export MPI_INCLUDE=$mpi_home/include
100export MPI_LIB=$mpi_home/lib
101export MPI_HOME=$mpi_home
102export CC=mpicc
103export FC=mpif90
104export CXX=mpiCC
105./configure \
106--prefix=$install_dir \
107--enable-fortran \
108--enable-parallel \
109--with-zlib=$install_dir  \
110--with-pic 2>&1 | tee $APP.config.log
111make 2>&1 | tee $APP.make.log
112#make check 2>&1 | tee $APP.make_check.log
113make install 2>&1 | tee $APP.install.log
114
115# NetCDF4
116APP=netcdf-4.3.3.1
117NETCDF4_PATH=$install_dir/$APP
118rm -rf $NETCDF4_PATH 
119cd $install_dir/src
120rm -rf netcdf-4.3.3.1*
121#wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.3.3.1.tar.gz
122wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/Distrib/netcdf-4.3.3.1.tar.gz
123tar xzf netcdf-4.3.3.1.tar.gz ; cd netcdf-4.3.3.1
124export LDFLAGS="-L${install_dir}/lib -L${mpi_home}/lib -lmpi"
125export CFLAGS="-I${install_dir}/include/curl -I${install_dir}/include"
126export LD_LIBRARY_PATH="${install_dir}/lib:${LD_LIBRARY_PATH}"
127CC=mpicc ./configure \
128--prefix=${install_dir} \
129--enable-static \
130--enable-shared \
131--enable-netcdf4 \
132--enable-dap \
133--with-pic 2>&1 | tee $APP.config.log
134make 2>&1 | tee $APP.make.log
135make check 2>&1 | tee $APP.make_check.log
136make install 2>&1 | tee $APP.install.log
137
138# NetCDF4-Fortran
139APP=netcdf-fortran-4.4.2
140NETCDF4_FORTRAN_PATH=${install_dir}/$APP
141rm -rf $NETCDF4_FORTRAN_PATH
142cd ${install_dir}/src
143rm -rf netcdf-fortran-4.4.2*
144#wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.4.2.tar.gz
145wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/Distrib/netcdf-fortran-4.4.2.tar.gz
146tar xzf netcdf-fortran-4.4.2.tar.gz ; cd netcdf-fortran-4.4.2
147#export LD_LIBRARY_PATH=${install_dir}/lib:${LD_LIBRARY_PATH}
148export LDFLAGS="-L${install_dir}/lib -L${install_dir}/lib -L${mpi_home}/lib -lmpi"
149export CPPFLAGS="-I${install_dir}/include/curl -I${install_dir}/include"
150export CC=mpicc
151export FC=mpif90
152export F77=mpif77
153export LDFLAGS=-L${install_dir}/lib
154./configure \
155--prefix=${install_dir} 2>&1 | tee $APP.config.log
156make 2>&1 | tee $APP.make.log
157make check 2>&1 | tee $APP.make_check.log
158make install 2>&1 | tee $APP.install.log
159
160# NetCDF4-C++
161APP=netcdf-cxx4-4.2.1
162NETCDF4_CXX_PATH=${install_dir}/$APP
163rm -rf $NETCDF4_CXX_PATH
164cd ${install_dir}/src
165rm -rf netcdf-cxx4-4.2.1*
166#wget https://github.com/Unidata/netcdf-cxx4/archive/v4.2.1.tar.gz
167#mv v4.2.1.tar.gz netcdf-cxx4-4.2.1.tar.gz
168wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/Distrib/netcdf-cxx4-4.2.1.tar.gz
169tar xzf netcdf-cxx4-4.2.1.tar.gz ; cd netcdf-cxx4-4.2.1
170#export LD_LIBRARY_PATH=${install_dir}/lib:${LD_LIBRARY_PATH}
171export LDFLAGS="-L${install_dir}/lib -L${mpi_home}/lib -lmpi"
172export CPPFLAGS="-I${install_dir}/include/curl -I${install_dir}/include"
173export CC=mpicc
174export CXX=mpiCC
175export LDFLAGS=-L${install_dir}/lib
176./configure \
177--prefix=${install_dir} 2>&1 | tee $APP.config.log
178make 2>&1 | tee $APP.make.log
179make check 2>&1 | tee $APP.make_check.log
180make install 2>&1 | tee $APP.install.log
Note: See TracBrowser for help on using the repository browser.