-
Notifications
You must be signed in to change notification settings - Fork 1
Build GLM on Ubuntu
Vahid Daneshmand edited this page Nov 26, 2021
·
13 revisions
Note:* These instructions have been tested on Ubuntu 20.04.
To install prerequisites:
sudo apt update && sudo apt install vim build-essential git gfortran-8 libnetcdf-dev libgd-dev -y
Make gfortran-8 the default gfortran:
sudo rm -rf /usr/bin/gfortran
sudo ln -s /usr/bin/gfortran-8 /usr/bin/gfortran
Then start building:
mkdir AquaticEcoDynamics
cd AquaticEcoDynamics
git clone https://github.com/AquaticEcoDynamics/libplot.git
git clone https://github.com/AquaticEcoDynamics/libaed-water.git
git clone https://github.com/AquaticEcoDynamics/libutil.git
git clone https://github.com/AquaticEcoDynamics/GLM.git
cd GLM
Edit GLM_CONFIG file:
vi GLM_CONFIG
Change WITH_PLOTS value from TRUE to FALSE:
export WITH_PLOTS=false
Change export AED2DIR value:
export AED2DIR=${CURDIR}/../libaed-water
The final content should be similar to the following:
#
# These are settings used for building glm
#
#export FABM=true
export AED2=false
export AED=true
export USE_DL=false
export WITH_PLOTS=false
export WITH_XPLOTS=false
# The build scripts will look for gfortran-8, gfortran then ifort; these can
# be used to override
# export FC=ifort
# export FC=gfortran
# The default is MacPorts : uncomment the next line if you use "homebrew"
# the build_glm.sh scripts will try to auto-configure this
#export HOMEBREW=true
export CURDIR=`pwd`
export FABMDIR=${CURDIR}/../fabm-git
export PLOTDIR=${CURDIR}/../libplot
export AED2DIR=${CURDIR}/../libaed-water
export AED2PLS=${CURDIR}/../libaed2-plus
export UTILDIR=${CURDIR}/../libutil
export GLM_CONFIGURED=true
Then build the GLM:
FC=gfortran-8 ./build_glm.sh
sudo ln -s $(realpath glm) /usr/local/bin
Run GLM:
glm
To re-build a package, first clear the directory and then build again:
make clean
Afterward, undo the change to the /etc/apt/sources.list file.
http://aquatic.science.uwa.edu.au/research/models/GLM/Download/downloader.php