Skip to content
Snippets Groups Projects
Commit e400f018 authored by Timo Koch's avatar Timo Koch
Browse files

[python] Add convenience script to setup environment

parent 180d6e3c
No related branches found
No related tags found
1 merge request!2681Feature/python main file
Pipeline #6547 waiting for manual action
...@@ -40,11 +40,11 @@ Then run dunecontrol which also builds the Dune Python bindings. ...@@ -40,11 +40,11 @@ Then run dunecontrol which also builds the Dune Python bindings.
./dune-common/bin/dunecontrol --opts=cmake.opts all ./dune-common/bin/dunecontrol --opts=cmake.opts all
``` ```
Add the Python binding modules to your Python path like this and install them: Add the Python binding modules to your Python path like this and install them with
the setup environment setup script
``` ```
export PYTHONPATH=$(pwd)/dune-common/build-cmake/python:$(pwd)/dune-grid/build-cmake/python:$(pwd)/dune-geometry/build-cmake/python:$(pwd)/dune-istl/build-cmake/python:$(pwd)/dune-localfunctions/build-cmake/python:$(pwd)/dumux/build-cmake/python source dumux/python/setup-python-env.sh
python3 dune-common/bin/setup-dunepy.py --opts=cmake.opts install
``` ```
If you are getting error with loading MPI in Python you might need to preload the MPI library If you are getting error with loading MPI in Python you might need to preload the MPI library
......
#!/bin/bash
# Adds all Python modules found in other Dune modules to the PYTHONPATH
./dune-common/bin/dunecontrol bexec "echo -n :\$(pwd)/python >> $(pwd)/pythonpath.txt"
export PYTHONPATH=$PYTHONPATH$(cat pythonpath.txt)
rm pythonpath.txt
# Sets up the dune-py module for JIT compilation of Python binding code
./dune-common/bin/setup-dunepy.py --opts=cmake.opts install
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment