-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_netcdf.sh
executable file
·70 lines (59 loc) · 1.87 KB
/
build_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
set -e
cd "$(dirname $0)" || exit 1
# spack load [email protected]
# spack load [email protected]/xbteted
# spack load [email protected]
# spack load [email protected]
# spack load libxml2/q66mtbb
# spack load curl
# # spack load hdf5 ~shared
# spack load hdf5/fxhrrhv
# export CC=mpiicx
# export FC=mpiifort
# export F77=mpiifort
source ./env.sh
export CC=mpiicx
export FC=mpiifort
export F77=mpiifort
# export H5DIR=$(spack location -i hdf5 ~shared)
export H5DIR=$(spack location -i hdf5)
export CURLDIR=$(spack location -i curl)
export XML2DIR=$(spack location -i libxml2)
(
cd gmcore
netcdf_dir="netcdf"
mkdir -p "$netcdf_dir"
cd "$netcdf_dir"
if [ x"$(ls -A .)" = x"" ]; then
# wget https://downloads.unidata.ucar.edu/netcdf-c/4.9.2/netcdf-c-4.9.2.tar.gz
# wget https://downloads.unidata.ucar.edu/netcdf-fortran/4.6.1/netcdf-fortran-4.6.1.tar.gz
# tar -zxvf netcdf-c-4.9.2.tar.gz
# tar -zxvf netcdf-fortran-4.6.1.tar.gz
cp -r /data/gomars_data/netcdf/netcdf-c-4.9.2/ .
cp -r /data/gomars_data/netcdf/netcdf-fortran-4.6.1/ .
fi
)
cd ./gmcore/netcdf/
CDIR=$(pwd)
NCDIR=$(pwd)
NFDIR=$(pwd)
(
cd ./netcdf-c-4.9.2
[ -f Makefile ] || [ -f makefile ] && make clean
CPPFLAGS="-I${H5DIR}/include -I${CURLDIR}/include -I${XML2DIR}/include " \
LDFLAGS="-L${H5DIR}/lib -L${CURLDIR}/lib -L${XML2DIR}/lib" \
./configure --prefix=${CDIR} --enable-parallel-tests
make install -j64
)
export LD_LIBRARY_PATH=${NCDIR}/lib:${LD_LIBRARY_PATH}
(
cd ./netcdf-fortran-4.6.1
[ -f Makefile ] || [ -f makefile ] && make clean
CPPFLAGS="-I${NCDIR}/include -I${H5DIR}/include -I${CURLDIR}/include -I${XML2DIR}/include" \
LDFLAGS="-L${NCDIR}/lib -L${H5DIR}/lib -L${CURLDIR}/lib -L${XML2DIR}/lib" \
./configure --prefix=${NFDIR} --enable-parallel-tests
make install -j64
)
# wordaround: remove all shared libs
rm ./lib/*so*