-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgcc_netcdf_cluster.csh
executable file
·87 lines (80 loc) · 3.07 KB
/
gcc_netcdf_cluster.csh
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
#!/bin/csh -f
# ---------------------------
# Build and install gcc 9.3.0
# ---------------------------
#cd /home/centos/build
#GCC_VERSION=9.3.0
#wget https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz
#tar xzvf gcc-${GCC_VERSION}.tar.gz
#mkdir obj.gcc-${GCC_VERSION}
#cd gcc-${GCC_VERSION}
#./contrib/download_prerequisites
#cd ../obj.gcc-${GCC_VERSION}
#../gcc-${GCC_VERSION}/configure --disable-multilib
#make -j $(nproc)
#sudo make install
# -----------------------
# Download and build HDF5
# -----------------------
# cd /home/centos/build
# wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.5/src/hdf5-1.10.5.tar.gz
# tar xvf hdf5-1.10.5.tar.gz
# rm -f hdf5-1.10.5.tar.gz
# cd hdf5-1.10.5
# export CFLAGS="-O3"
# export FFLAGS="-O3"
# export CXXFLAGS="-O3"
# export FCFLAGS="-O3"
# ./configure --prefix=/usr/local --enable-fortran --enable-cxx --enable-shared --with-pic
# make > make.gcc9.log 2>&1
# make check > make.gcc9.check
# make install
# ---------------------------
# Download and build netCDF-C
# ---------------------------
setenv DIR /shared/build
mkdir $DIR
cd $DIR
wget https://downloads.unidata.ucar.edu/netcdf-c/4.8.1/netcdf-c-4.8.1.tar.gz
tar xvf netcdf-c-4.8.1.tar.gz
rm -f netcdf-c-4.8.1.tar.gz
cd netcdf-c-4.8.1
#./configure --with-pic --with-hdf5=/home/centos/build/hdf5-1.10.5/hdf5/ --enable-netcdf-4 --enable-shared --prefix=$DIR/netcdf
#configure: error: curl required for remote access. Install curl or build with --disable-dap.
#./configure --with-pic --enable-netcdf-4 --enable-shared --disable-dap --prefix=/usr/local
#configure: error: Can't find or link to the hdf5 library. Use --disable-netcdf-4, or see config.log for errors.
# ended up using:
./configure --disable-netcdf-4 --disable-shared --disable-dap --prefix=$DIR/netcdf
make >& make.netcdf4c.log
make install
# ---------------------------------
# Download and build netCDF-Fortran
# ---------------------------------
cd $DIR
#wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.5.2.tar.gz
#wget https://downloads.unidata.ucar.edu/netcdf-fortran/4.5.3/netcdf-fortran-4.5.3.tar.gz
wget https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.5.3.tar.gz
#tar xvf netcdf-fortran-4.5.2.tar.gz
tar xzvf v4.5.3.tar.gz
#rm -f netcdf-fortran-4.5.2.tar.gz
cd netcdf-fortran-4.5.3
setenv NCDIR $DIR/netcdf
setenv CPPFLAGS -I${NCDIR}/include
setenv LDFLAGS -L${NCDIR}/lib
setenv LIBS "-lnetcdf"
./configure --disable-shared --prefix=$DIR/netcdf
#got error: checking size of off_t... configure: error:
#edited .cshrc to add path to /usr/local/lib where netcdf-c was installed`
make >& make.netcdf.log
make install
# Test install
cd $DIR/netcdf/bin
./nc-config --version
./nf-config --version
# What I really need to do is edit the .cshrc
#if ( ! $?LD_LIBRARY_PATH ) then
# setenv LD_LIBRARY_PATH /shared/build/netcdf/lib
#else
# setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/shared/build/netcdf/lib
#endif
cp /shared/cyclecloud-cmaq/dot.cshrc ~/.cshrc