-
Notifications
You must be signed in to change notification settings - Fork 0
/
iolib_installation.sh
executable file
·200 lines (174 loc) · 4.74 KB
/
iolib_installation.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#!/bin/bash
#
# Sources for all libraries used in this script can be found at
# http://www2.mmm.ucar.edu/people/duda/files/mpas/sources/
#
module purge
module load pgi/19.7
module load openmpi/3.1.4
module load cmake
module load cuda
# Where to find sources for libraries
export LIBSRC=/glade/work/cmille73/pgi197/sources
# Where to install libraries
export LIBBASE=/glade/work/cmille73/pgi197/pgi197libs
# Compilers
export SERIAL_FC=pgf90
export SERIAL_F77=pgf90
export SERIAL_CC=pgcc
export SERIAL_CXX=pgc++
export MPI_FC=mpif90
export MPI_F77=mpif90
export MPI_CC=mpicc
export MPI_CXX=mpicxx
export OMPI_CC=$SERIAL_CC
export OMPI_CXX=$SERIAL_CXX
export OMPI_FC=$SERIAL_FC
export OMPI_F90=$SERIAL_FC
export OMPI_F77=$SERIAL_FC
export CC=$SERIAL_CC
export CXX=$SERIAL_CXX
export F77=$SERIAL_F77
export FC=$SERIAL_FC
unset F90 # This seems to be set by default on NCAR's Cheyenne and is problematic
unset F90FLAGS
########################################
# MPICH
########################################
#tar xzvf ${LIBSRC}/mpich-3.3.1.tar.gz
#cd mpich-3.3.1
#export CC=$SERIAL_CC
#export CXX=$SERIAL_CXX
#export F77=$SERIAL_F77
#export FC=$SERIAL_FC
#export CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
#./configure --prefix=${LIBBASE} --enable-fortran --enable-romio
#make
#make check
#make install
#cd ..
########################################
# zlib
########################################
export CFLAGS='-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1'
tar xzvf ${LIBSRC}/zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=${LIBBASE} --static
make
make install
cd ..
#rm -rf zlib-1.2.11
#
#########################################
## HDF5
#########################################
tar xjvf ${LIBSRC}/hdf5-1.10.5.tar.bz2
cd hdf5-1.10.5
unset CFlags
export FC=$MPI_FC
export CC=$MPI_CC
export CXX=$MPI_CXX
#
./configure --prefix=${LIBBASE} --enable-parallel --with-zlib=${LIBBASE} --disable-shared
#
make
#make check
make install
cd ..
##rm -rf hdf5-1.10.5
########################################
# Parallel-netCDF
########################################
rm -rf pnetcdf-1.11.2
tar xzvf ${LIBSRC}/pnetcdf-1.11.2.tar.gz
cd pnetcdf-1.11.2
export CC=$SERIAL_CC
export CXX=$SERIAL_CXX
export F77=$SERIAL_F77
export FC=$SERIAL_FC
export MPICC=$MPI_CC
export MPICXX=$MPI_CXX
export MPIF77=$MPI_F77
export MPIF90=$MPI_FC
export OBJECT_MODE='64'
export CFLAGS='CFLAGS=-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 '
./configure --prefix=${LIBBASE} --enable-large-single-req
make
#make testing
make install
export PNETCDF=${LIBBASE}
cd ..
#rm -rf pnetcdf-1.11.2
########################################
# netCDF (C library)
########################################
rm -rf netcdf-4.6.1
tar xzvf ${LIBSRC}/netcdf-4.6.1.tar.gz
cd netcdf-c-4.6.1
unset CFLAGS
export CC=$MPI_CC
export MPICC=$MPI_CC
export MPICXX=$MPI_CXX
export MPIF77=$MPI_F77
export MPIF90=$MPI_FC
export CPPFLAGS="-I${LIBBASE}/include"
export LDFLAGS="-L${LIBBASE}/lib"
export LIBS="-lhdf5_hl -lhdf5 -lz -ldl"
./configure --prefix=${LIBBASE} --disable-dap --enable-netcdf4 --enable-pnetcdf --enable-cdf5 --disable-shared --enable-largefile
make
#make check
make install
export NETCDF=${LIBBASE}
cd ..
#rm -rf netcdf-c-4.6.1
########################################
# netCDF (Fortran interface library)
########################################
rm -rf netcdf-fortran-4.4.4
tar xzvf ${LIBSRC}/netcdf-fortran-4.4.4.tar.gz
cd netcdf-fortran-4.4.4
export MPICC=$MPI_CC
export MPICXX=$MPI_CXX
export MPIF77=$MPI_F77
export MPIF90=$MPI_FC
export FC=$MPI_FC
export F77=$MPI_F77
export LIBS="-lnetcdf ${LIBS}"
./configure --prefix=${LIBBASE} --disable-shared --enable-largefile
make
#make check
make install
cd ..
#rm -rf netcdf-fortran-4.4.4
########################################
# PIO
########################################
#rm -rf ParallelIO pio
git clone https://github.com/NCAR/ParallelIO
cd ParallelIO
export PIOSRC=`pwd`
cd ..
mkdir pio
cd pio
export CXX=$SERIAL_CXX
export F77=$SERIAL_F77
export MPICC=$MPI_CC
export MPICXX=$MPI_CXX
export MPIF77=$MPI_F77
export MPIF90=$MPI_FC
export CC=$MPI_CC
export FC=$MPI_FC
unset CFLAGS
export CTEST_OUTPUT_ON_FAILURE=1
cmake -DNetCDF_C_PATH=$NETCDF -DNetCDF_Fortran_PATH=$NETCDF -DPnetCDF_PATH=$PNETCDF -DCMAKE_INSTALL_PREFIX=$LIBBASE -DPIO_USE_MPIIO=ON -DPIO_ENABLE_FORTRAN=ON -DPIO_ENABLE_TIMING=OFF -DPIO_ENABLE_TESTS=OFF -DPIO_ENABLE_LOGGING=OFF -DPIO_USE_MALLOC=ON -DCMAKE_VERBOSE_MAKEFILE=ON $PIOSRC
make install
#make tests
#make check
cd ..
#rm -rf pio ParallelIO
export PIO=$LIBBASE
########################################
# Other environment vars needed by MPAS
########################################
export MPAS_EXTERNAL_LIBS="-L${LIBBASE}/lib -lhdf5_hl -lhdf5 -ldl -lz"
export MPAS_EXTERNAL_INCLUDES="-I${LIBBASE}/include"