CLAWRIM Wiki

The Computational Lab for Advanced Water Resources Informatics and Modeling

User Tools

Site Tools


howtos:how_to_compile_modflow_6_on_slackware

How to compile MODFLOW 6 on Slackware

MODFLOW 6 is parallelized using the Message Passing Interface (MPI) and the Portable, Extensible Toolkit for Scientific Computation (PETSc). This HOWTO explains how to compile these dependencies and MODFLOW 6 on Slackware.

# switch to root
su -
 
# install openmpi and python3-numpy; petsc requires python3-numpy and OpenBLAS;
# build queuefiles, not packages, to automatically build any other dependencies
sbopkg -k -i "openmpi python3-numpy OpenBLAS"
 
# download and unzip a petsc build script
cd /tmp
wget https://clawiki.isnew.info/_media/howtos/petsc.zip
unzip petsc.zip
cd petsc
 
# build petsc
./petsc.SlackBuild
 
# install petsc
cd ..
rm -rf petsc
installpkg petsc-*.tgz
 
# switch to non-root
exit
 
# clone github repositories
mkdir -p ~/usr/local/src
cd ~/usr/local/src
git clone https://github.com/MODFLOW-USGS/modflow6.git
git clone https://github.com/fortran-lang/test-drive.git
 
# build test-drive
cd test-drive
meson setup builddir --prefix=$PWD --libdir=lib
meson install -C builddir
mkdir -p ~/usr/local/share/pkgconfig
cp -a builddir/meson-private/test-drive.pc ~/usr/local/share/pkgconfig
if ! echo $PKG_CONFIG_PATH | grep -q $HOME/usr/local/share/pkgconfig; then
  echo 'export PKG_CONFIG_PATH="$HOME/usr/local/share/pkgconfig:$PKG_CONFIG_PATH"' > ~/.bash_profile
  . ~/.bash_profile
fi
cd ..
 
# build modflow6
cd modflow6
meson setup builddir -Ddebug=false -Dparallel=true --prefix=$(pwd) --libdir=bin
meson install -C builddir
meson test --verbose --no-rebuild -C builddir
 
# install modflow6
mkdir ~/usr/local/bin
cp -a bin/mf6 ~/usr/local/bin
if ! echo $PATH | grep -q $HOME/usr/local/bin; then
  echo 'export PATH="$HOME/usr/local/bin:$PATH"' > ~/.bash_profile
  . ~/.bash_profile
fi
howtos/how_to_compile_modflow_6_on_slackware.txt · Last modified: by hcho

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki