-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnetcdf-intel_install.sh
55 lines (43 loc) · 1.25 KB
/
netcdf-intel_install.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
#!/bin/bash
# Script to install netcdf 4.8.0 with zlib 1.2.11 and hdf5 1.12.0
# Written by Ghanghoon "Will" Paik (gip5038@psu.edu)
# Apr 14 2021
module purge
module load intel
if [[ ! -z "$PBS_NODEFILE" ]]; then
NP=$(wc -l $PBS_NODEFILE | awk '{print $1}')
else
NP=1;
fi
echo "Number of threads used for installation: $NP"
BASE=$PWD
mkdir -p netcdf
mkdir -p netcdf_tmp
BUILD_DIR=$PWD/netcdf
TMPDIR=$PWD/netcdf_tmp
cd $TMPDIR
# Install zlib 1.2.11
wget -nc https://zlib.net/zlib-1.2.11.tar.gz
tar -xf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=$BUILD_DIR
make -j $NP && make install
export PATH=$PATH:$BUILD_DIR/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BUILD_DIR/lib:$BUILD_DIR/lib64
export CPATH=$CPATH:$BUILD_DIR/include
cd $TMPDIR
# Install hdf5 1.12.0
wget -nc -O hdf5-1.12.0.tar.gz https://www.hdfgroup.org/package/hdf5-1-12-0-tar-gz/?wpdmdl=14582&refresh=60774c4a0b81e1618431050
tar -xf hdf5-1.12.0.tar.gz
cd hdf5-1.12.0
./configure --prefix=$BUILD_DIR
make -j $NP && make install
cd $TMPDIR
# Install netcdf 4.8.0
wget -nc https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.8.0.tar.gz
tar -xf netcdf-c-4.8.0.tar.gz
cd netcdf-c-4.8.0
./configure --prefix=$BUILD_DIR
make -j $NP && make install
cd $BASE
rm -rf $TMPDIR