-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_netcdf.sh
executable file
·47 lines (41 loc) · 1.31 KB
/
install_netcdf.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
#!/bin/sh
# Modificado desde el script de instalación para gmt 4.5.14 por Nestor Luna
#--------------------------------------------------------------------------------
# NETCDF SECTION
#--------------------------------------------------------------------------------
# Define variables needed in this script
GMT_cc=gcc
CC=$GMT_cc
export CC
topdir=`pwd`
NETCDF_VERSION=3.6.3
suffix="bz2"
expand="bzip2 -dc"
GMT_make=make
passive_ftp=y
GMT_delete=n
if [ -f netcdf-${NETCDF_VERSION}.tar.Z ]; then
zcat netcdf-${NETCDF_VERSION}.tar.Z | tar xvf -
elif [ -f netcdf-${NETCDF_VERSION}.tar.bz2 ]; then
$expand netcdf-${NETCDF_VERSION}.tar.$suffix | tar xvf -
elif [ -f netcdf-${NETCDF_VERSION}.tar.gz ]; then
gzip -dc netcdf-${NETCDF_VERSION}.tar.gz | tar xvf -
else
echo "?? netcdf-${NETCDF_VERSION}.tar.{Z,bz2,gz} not found - must abort !!"
exit
fi
cd netcdf-${NETCDF_VERSION}
if [ "$os" = "Interix" ]; then # Windows SFU
CC=${CC=gcc}
fi
### netcdf_path=${netcdf_path:-$topdir/netcdf-${NETCDF_VERSION}}
netcdf_path=$topdir/netcdf-${NETCDF_VERSION}
rm -f config.{cache,log,status}
./configure --prefix=$netcdf_path --enable-c-only --enable-shared
$GMT_make check || exit
$GMT_make install || exit
$GMT_make clean || exit
cd $topdir
if [ "$GMT_delete" = "y" ]; then
rm -f netcdf*.tar.Z
fi