Skip to content

Installing wflow on Ubuntu 18.04 LTS #36

@tuggegese

Description

@tuggegese

Hello,

I am not sure if this is the right place to post this (in the Issues section). However, since it took me some time to install wflow on Ubuntu 18.04 LTS, I figured I'll share this, maybe it helps somebody. For my specific application, I want the Python distribution to be as lean as possible. Therefore, I was not going for the Anaconda environment solution.

Compile PCRaster from source:

sudo apt install cmake gcc g++ git qtbase5-dev libncurses5-dev libqwt-qt5-dev libxerces-c-dev libboost-all-dev libgdal-dev python3-numpy python3-docopt
wget http://pcraster.geo.uu.nl/pcraster/4.2.1/pcraster-4.2.1.tar.bz2
tar xf pcraster-4.2.1.tar.bz2 && cd pcraster-4.2.1
mkdir build && cd build
cmake -DFERN_BUILD_ALGORITHM:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=$HOME/pcraster -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 ..
cmake --build .
make install
export PATH=$PATH:$HOME/pcraster/bin
export PYTHONPATH=$PYTHONPATH:$HOME/pcraster/python

Since the automatic installation of the required Python packages did not work for me, I installed them manually using pip

sudo apt install python3-pip
pip3 install numpy
pip3 install scipy
pip3 install GDAL==$(gdal-config --version | awk -F'[.]' '{print $1"."$2}') --global-option=build_ext --global-option="-I/usr/include/gdal"
pip3 install netcdf4
pip3 install pyproj
sudo apt-get install libllvm-9-ocaml-dev libllvm9 llvm-9 llvm-9-dev llvm-9-doc llvm-9-examples llvm-9-runtime
export LLVM_CONFIG='/usr/bin/llvm-config-9'
pip3 install numba
pip3 install python-dateutil

Afterwards I was cloning the git repository to my $Home directory

cd $HOME
git clone https://github.com/openstreams/wflow.git

I had to excluded the required packages in the setup.py file, which is located in $HOME/wflow/setup.py

install_requires=[
    #   "numpy",
    #    "scipy",
   #     "gdal",
   #     "netCDF4",
   #     "xarray",
    #    "cftime",
   #     "numba",
   #     "pyproj",
    #    "python-dateutil",
    ], 

At last wflow can be installed by using pip

cd wflow
pip3 install -e .

Cheers, Sebastian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions