Install Tinerator

1 minute read

Published:

Create new conda env

The steps follows this documentation with some changes.

  • create conda env and install packages. A list of packages can be loaded using requirements.txt
module load python

# make conda-forge channel the priority
conda config --add channels conda-forge
conda config --set channel_priority strict

conda create -n tinerator --file requirements.txt
source activate tinerator
  • packages inside requirements.txt
# list of packages
python
ipykernel
richdem
matplotlib
numpy
scipy
rasterio
fiona
elevation
scikit-image
scikit-fmm
vtk
pyvista
ipywidgets
geopandas
#jupyterlab

Build LaGrit

documentation

Download source code from github

git clone https://github.com/lanl/LaGriT.git LaGriT

build from binary file (optional)

wget "https://github.com/lanl/LaGriT/releases/download/v3.3.2/lagrit-linux-static"
chmod a+x lagrit-linux-static

build LaGrit from source code

Install compiler

  • IF ON Mac, change default gfortran compiler from clang to GNU

    alias gcc='gcc-9'
    alias g++='g++-9'
    
  • IF on Ubuntu

sudo apt-get -y install gfortran libz-dev m4 bison
  • on NERSC
module swap PrgEnv-intel PrgEnv-gnu

####Building exodus

cd LaGriT
export LAGRIT_DIR=$PWD
make exodus

####compile LaGriT

# make [option] [target], follow the prompt from previous step
make EXO_LIB_DIR=/Users/shua784/Dropbox/github/LaGriT/seacas/lib static 

####testing

make test

Install PyLaGrit

cd $LAGRIT_DIR/PyLaGriT
python setup.py install
  • add lagrit_exe : "/software/LaGriT/src/lagrit" path to .pylagritrc file
vi ~/.pylagritrc

Install Tinerator

git clone https://github.com/lanl/LaGriT.git tinerator && cd tinerator && git checkout tinerator
python setup.py install

create Jupyter kernel

python -m ipykernel install --user --name tinerator --display-name tinerator

Update Tinerator

Every time when developer made a new commit, do the following to update Tinerator.

source activate tin
(tin) $ cd $TINERATOR_SRC_DIR
(tin) $ git pull
(tin) $ python setup.py install

Issues

  1. libpoppler.so.76: cannot open shared object file: No such file or directory
    • This is likely caused by inconsistent package version between default and conda-forge channel. Try install packages using conda-forge channel.
      conda config --add channels conda-forge
      conda config --set channel_priority strict
      

Your ~/.condarc file contains the following:

channels:
  - conda-forge
  - defaults
channel_priority: strict
  1. LaGriT executable is not defined. Pylagrit could not find the executable defined in .pylagritrc
  • temporary hack: open LaGriT/PyLaGriT/pylagrit/pylagrit.py, replace the following:
    # if lagrit_exe is not None:
    #        self.lagrit_exe = lagrit_exe 
    self.lagrit_exe = '/Users/shua784/Dropbox/github/LaGriT/src/lagrit'
    
  1. Interactive widget did not show up

    • install nodejs
    • enable extension
    jupyter labextension install @jupyter-widgets/jupyterlab-manager