-
Notifications
You must be signed in to change notification settings - Fork 20
/
Quickstart
57 lines (47 loc) · 2.11 KB
/
Quickstart
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
#!/bin/bash
# This script is the run-able quickstart guide for building this project. It
# assumes you are running on a recent version of Ubuntu or Debian. See the
# README file if you are using a different distribution.
# install openmpi from ubuntu package manager
sudo apt-get install -y libopenmpi-dev openmpi-bin libhdf5-openmpi-dev openmpi-common
# Add NetCDF
# 1) We need HDF
#Required for NetCDF integration; source is supported at http://www.hdfgroup.org/ftp/HDF5/current/src
HDF_VERSION="1.10.1"
# Download build and install HDF5
mkdir ~/temp
cd ~/temp
wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-${HDF_VERSION}.tar.bz2; \
tar -xjvf hdf5-${HDF_VERSION}.tar.bz2; \
cd hdf5-${HDF_VERSION}; \
./configure --enable-shared --prefix=/usr/local/hdf5; \
make; \
sudo make install; \
cd ..; \
rm -rf /hdf5-${HDF_VERSION} /hdf5-${HDF_VERSION}.tar.bz2;
# 2)
#Build netcdf
# First we need to build NetCDF C version
# (http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html)
# Download and install netcdf C
NCD_VERSION="4.3.3.1"
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-${NCD_VERSION}.tar.gz;
tar -xzvf netcdf-${NCD_VERSION}.tar.gz;
cd netcdf-${NCD_VERSION};
./configure --prefix=/usr/local/netcdf CC=gcc LDFLAGS=-L/usr/local/hdf5/lib CFLAGS=-I/usr/local/hdf5/include;
make ;
sudo make install;
cd .. ;
rm -rf netcdf-${NCD_VERSION} netcdf-${NCD_VERSION}.tar.gz
# 3) Build NetCDF fortran version
# (http://www.unidata.ucar.edu/software/netcdf/docs/building_netcdf_fortran.html)
# Download and install NetCDF fortran
NCF_VERSION="4.4.2"
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-${NCF_VERSION}.tar.gz;
tar -xzvf netcdf-fortran-${NCF_VERSION}.tar.gz;
cd netcdf-fortran-${NCF_VERSION};
./configure --prefix=/usr/local/netcdf --disable-fortran-type-check CC=gcc FC=gfortran LDFLAGS=-L/usr/local/netcdf/lib CFLAGS=-I/usr/local/netcdf/include;
make ;
sudo make install;
cd ..
rm -rf netcdf-fortran-${NCF_VERSION} netcdf-fortran-${NCF_VERSION}.tar.gz