Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 54 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
# cargo-culted from python-control's .travis.yml
# Travis configuration file for slycot
language: python

python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"

env:
- TEST_CONDA=0
- TEST_CONDA=1

before_install:
#
# Install fortran compiler
#
- sudo apt-get install gfortran
#
# If not using conda, then install liblapack here (conda version
# will handle this through the build recipe)
#
- if [[ $TEST_CONDA == 0 ]]; then sudo apt-get install liblapack-dev; fi

install:
#
# Install miniconda to allow quicker installation of dependencies
# See https://conda.io/docs/user-guide/tasks/use-conda-with-travis-ci.html
#
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
Expand All @@ -19,21 +36,47 @@ before_install:
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda install conda-build
- conda config --add channels http://conda.binstar.org/python-control
- if [[ $TEST_CONDA == 1 ]]; then conda install conda-build; fi
- conda info -a
- conda create -q -n test-environment python="$TRAVIS_PYTHON_VERSION" pip coverage nose
#
# Set up a test environment for testing everything out
- conda create -q -n test-environment python="$TRAVIS_PYTHON_VERSION" pip coverage nose numpy
- source activate test-environment
#
# Make sure that fortran compiler can find conda libraries
#
- export LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib";
#
# Install the slycot package (two ways, to improve robustness). For the
# conda version, need to install lapack from conda-forge (no way to specify
# this in the recipe).
#
- if [[ $TEST_CONDA == 1 ]]; then
conda install -c conda-forge lapack;
conda build --python "$TRAVIS_PYTHON_VERSION" conda-recipe;
conda install slycot --use-local;
else
python setup.py install;
fi
#
# coveralls not in conda repos :-(
- pip install coveralls

install:
- conda build --python "$TRAVIS_PYTHON_VERSION" conda-recipe
- conda install slycot --use-local

# TODO: replace with nose?
script:
# Local unit tests
# TODO: replace with nose?
- python runtests.py --coverage
#
# As a deeper set of tests, get test against python-control as well
#
# Additional packages required for python-control
- conda install scipy matplotlib
# Install display manager to allow testing of plotting functions
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# Get python-control from source and install
- git clone https://github.com/python-control/python-control.git control
- cd control; python setup.py test

after_success:
- coveralls
46 changes: 31 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
Slycot
=============

.. image:: https://travis-ci.org/python-control/Slycot.svg?branch=master
:target: https://travis-ci.org/python-control/Slycot
.. image:: https://coveralls.io/repos/python-control/Slycot/badge.png
:target: https://coveralls.io/r/python-control/Slycot
.. image:: https://travis-ci.org/python-control/slycot.svg?branch=master
:target: https://travis-ci.org/python-control/slycot
.. image:: https://coveralls.io/repos/python-control/slycot/badge.png
:target: https://coveralls.io/r/python-control/slycot

Python wrapper for selected SLICOT routines, notably including solvers for
Riccati, Lyapunov and Sylvester equations.
Riccati, Lyapunov, and Sylvester equations.


Prerequisite:
-------------
Prerequisites:
--------------

Slycot depends on Numpy, and if you are installing a binary distribution, Numpy
is the only prerequisite.
Slycot depends on Numpy and, if you are installing a binary distribution,
Numpy should be the only prerequisite (though you may need the LAPACK
libraries as well, depending on your particular system configuration).

If you are installing Slycot from source, you will need a fortran
compiler such as gfortran, and BLAS/LAPACK libraries.
If you are installing Slycot from source, you will need a FORTRAN
compiler, such as gfortran, and BLAS/LAPACK libraries.

On Debian derivates you can install all the above with a single command::
On Debian derivatives you should be able to install all the above with a
single command::

sudo apt-get build-dep python-scipy

Expand All @@ -29,7 +31,7 @@ On Mac, you will first need to install the `developer tools

brew install gcc

On Windows, I suggest installing on top of the Python(x,y) distribution, and
On Windows, we suggest installing on top of the Python(x,y) distribution, and
grabbing BLAS and LAPACK libraries from:

http://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.4.1/Dynamic-MINGW/Win32/
Expand Down Expand Up @@ -64,10 +66,10 @@ Using conda
If you use `Anaconda or conda <http://continuum.io/downloads>`_ on Linux or Mac,
it should be straighforward to install Slycot, without needing any compilers or
other prerequisites. Slycot is not included in the standard conda package
repository, but there are packages available on http://binstar.org for Linux and
repository, but there are packages available on conda-forge for Linux and
Mac. You can install with the following command::

conda install -c http://conda.binstar.org/cwrowley slycot
conda install -c conda-forge slycot


From Source
Expand Down Expand Up @@ -96,6 +98,20 @@ with as contents::
[build]
compiler=mingw32

Additional tips for how to install slycot from source can be found in the
.travis.yml (commands used for Travis CI) and conda-recipe/ (conda
pre-requisities). The hardest part about installing from source is getting
a working version of FORTRAN and LAPACK installed on your system and working
properly with Python. If you are using conda, you can also get working
(binary) copies of LAPACK from conda-forge using the command::

conda install -c conda-forge lapack

Note that in some cases you may need to set the LIBRARY_PATH environment
variable to pick up dependencies such as -lpythonN.m (where N.m is the
version of python you are using).


To-Do
------

Expand Down
7 changes: 5 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ build:
requirements:
build:
- python
- numpy >=1.13.3
- numpy
- lapack
- m2w64-gcc-fortran # [win]
- gfortran_linux-64 # [linux]
- gfortran_osx-64 # [osx]

run:
- python
- numpy
- lapack
- libgfortran

test:
imports:
- slycot

about:
home: https://github.com/python-control/Slycot
home: https://github.com/python-control/slycot
license: GPLv2
summary: 'A wrapper for the SLICOT control and systems library'