-
Notifications
You must be signed in to change notification settings - Fork 11
build_libs
Ricardo Torres edited this page Feb 16, 2022
·
1 revision
#!/usr/bin/env bash
set -eu
# Build the libraries needed for WRF. Omit the MPI one as we will need to use
# the cluster one instead.
# Set up the environment
module load mpi/mpich-x86_64 # for parallel runs
GET=${GET:-yes} # set to no to skip download and extraction of the archives
if [ $GET == 'yes' ]; then
wget \
--header='Host: www2.mmm.ucar.edu' \
--header='User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0' \
--header='Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
--header='Accept-Language: en-GB,en;q=0.5' \
--header='DNT: 1' \
--header='Content-Type: application/x-www-form-urlencoded' \
'http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/netcdf-4.1.3.tar.gz' \
-c
wget \
--header='Host: www2.mmm.ucar.edu' \
--header='User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0' \
--header='Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
--header='Accept-Language: en-GB,en;q=0.5' \
--header='DNT: 1' \
--header='Content-Type: application/x-www-form-urlencoded' \
'http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/jasper-1.900.1.tar.gz' \
-c
wget \
--header='Host: www2.mmm.ucar.edu' \
--header='User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0' \
--header='Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
--header='Accept-Language: en-GB,en;q=0.5' \
--header='DNT: 1' \
--header='Content-Type: application/x-www-form-urlencoded' \
'http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/libpng-1.2.50.tar.gz' \
-c
wget \
--header='Host: www2.mmm.ucar.edu' \
--header='User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0' \
--header='Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
--header='Accept-Language: en-GB,en;q=0.5' \
--header='DNT: 1' \
--header='Content-Type: application/x-www-form-urlencoded' \
'http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/zlib-1.2.7.tar.gz' \
-c
# Extract if we haven't already.
if [ ! -d netcdf-4.1.3 ]; then
tar xvf netcdf-4.1.3.tar.gz
fi
if [ ! -d jasper-1.900.1 ]; then
tar xvf jasper-1.900.1.tar.gz
fi
if [ ! -d libpng-1.2.50 ]; then
tar xvf libpng-1.2.50.tar.gz
fi
if [ ! -d zlib-1.2.7 ]; then
tar xvf zlib-1.2.7.tar.gz
fi
fi
# Do the builds. Largely lifted from:
# http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php
# netCDF
export DIR=$(readlink -f $(pwd))
export CC=gcc
export CXX=g++
export FC=gfortran
export FCFLAGS=-m64
export F77=gfortran
export FFLAGS=-m64
cd netcdf-4.1.3
./configure --prefix=$DIR/netcdf --disable-dap \
--disable-netcdf-4 --disable-shared
make -j 16
make install
export PATH=$DIR/netcdf/bin:$PATH
export NETCDF=$DIR/netcdf
cd ~-
# zlib
export LDFLAGS=-L$DIR/grib2/lib
export CPPFLAGS=-I$DIR/grib2/include
cd zlib-1.2.7
./configure --prefix=$DIR/grib2
make -j 16
make install
cd ~-
# libpng
cd libpng-1.2.50
./configure --prefix=$DIR/grib2
make -j 16
make install
cd ~-
# JasPer
cd jasper-1.900.1
./configure --prefix=$DIR/grib2
make -j 16
make install
cd ~-
For questions regarding FVCOM, to contribute to the wiki please subscribe to the mailing list uk-fvcom mailing list If you would like to cite FVCOM, please refer to its main publication and/or URLs.
Background
=== FVCOM Wiki ===
User guide
-
Additional information of less frequent usage in no particular order