Skip to content

Ubuntu 20.04 conda development quickstart

Rory Yorke edited this page Feb 14, 2021 · 9 revisions

Very loosely based on the SciPy development quickstart.

Conda

Install miniconda

Setup environment

Create a conda environment slycotdev with the necessary build requirements.

conda create --name slycotdev --channel conda-forge python numpy scipy pytest gfortran_linux-64 gxx_linux-64 scikit-build

If you're likely to install other packages (matplotlib, ipython, etc.) as you go along, make sure conda-forge is the first channel for packages:

conda activate slycotdev
conda config --env --add channels conda-forge

In-place build

Build inplace, making sure we don't use /usr/include or other system default NumPy headers, and that we do use the compilers from the gfortran_linux-64 and gxx_linux-64 packages:

conda activate slycotdev # if not already activated
python setup.py build_ext --inplace \
     -- -DNumPy_INCLUDE_DIR=$(python -q -c 'import numpy; print(numpy.get_include())' \
        -DCMAKE_Fortran_COMPILER=x86_64-conda_cos6-linux-gnu-gfortran \
        -DCMAKE_C_COMPILER=x86_64-conda_cos6-linux-gnu-gcc

Install in your development environment:

conda activate slycotdev # if not already activated
conda develop .

Run the tests:

conda activate slycotdev # if not already activated
pytest

As of 2021-01-24, commit 68e5abc, this runs 109 tests, all of which pass.

Testing against python-control

If you've installed Slycot in your development environment (see conda develop . above), you can use python-control to do more tests of Slycot. Clone python-control, and in the python-control working tree run pytest.

Clone this wiki locally