forked from PCMDI/cmor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·85 lines (80 loc) · 1.66 KB
/
build.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
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
#
#
#
# NOTE: you might need root access to install cmor python egg /usr/local/lib (See last line)
#
# -------------------
# Obtain all packages
# -------------------
export GIT_SSL_NO_VERIFY=true
export PREFIX=$HOME/build
# -------------------
# -------------------
mkdir build
cd build
wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.17.tar
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.0.tar.gz
wget ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.2.20.tar.gz
wget http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
#
# -------------------
# Untar packages
# -------------------
tar xf hdf5-1.8.17.tar
tar xzf netcdf-4.4.0.tar.gz
tar xzf udunits-2.2.20.tar.gz
tar xzf uuid-1.6.2.tar.gz
#
# -------------------
# BUILD libuuid
# -------------------
#
cd uuid-1.6.2
./configure --prefix=$PREFIX
make
make install
#
# -------------------
# build udnits2
# -------------------
#
cd ../udunits-2.2.20
./configure --prefix=$PREFIX
make
make install
#
# -------------------
# build hdf5
# -------------------
#
cd ../hdf5-1.8.17
./configure --prefix=$PREFIX
make
make install
#
# -------------------
# build netcdf4
# -------------------
#
export CFLAGS="-I$HOME/build/include"
export LDFLAGS="-L$HOME/build/lib"
cd ../netcdf-4.4.0
./configure --prefix=$PREFIX --enable-netcdf4
make
make install
#
# -------------------
# build cmor
# -------------------
cd ..
git clone https://github.com/PCMDI/cmor.git
cd cmor
git checkout cmor3
./configure --prefix=$PREFIX --with-python --with-uuid --with-udunits --with-netcdf=$PREFIX/
make
#
# My pyhton 2.7 is located in /usr/local/lib so I need sudo
#
sudo make install
sudo make python