@@ -10,16 +10,16 @@ Slycot
1010.. image :: https://travis-ci.org/python-control/Slycot.svg?branch=master
1111 :target: https://travis-ci.org/python-control/Slycot
1212
13- .. image :: https://coveralls.io/repos/python-control/slycot /badge.png
14- :target: https://coveralls.io/r /python-control/slycot
13+ .. image :: https://coveralls.io/repos/github/ python-control/Slycot /badge.svg
14+ :target: https://coveralls.io/github /python-control/Slycot
1515
1616Python wrapper for selected SLICOT routines, notably including solvers for
1717Riccati, Lyapunov, and Sylvester equations.
1818
1919Dependencies
2020------------
2121
22- Slycot supports Python versions 2.7 and >= 3.5.
22+ Slycot supports Python versions 2.7, and 3.5 or later .
2323
2424To run the compiled Slycot package, the following must be installed as
2525dependencies:
@@ -32,50 +32,40 @@ following dependencies:
3232
3333- Python 2.7, 3.5+
3434- NumPy
35- - scikit-build >=0.8.1
36- - cmake
35+ - scikit-build >= 0.10.0
36+ - CMake
3737- C compiler (e.g. gcc, MS Visual C++)
3838- FORTRAN compiler (e.g. gfortran, ifort, flang)
3939- BLAS/LAPACK (e.g. OpenBLAS, ATLAS, MKL)
4040
41+ To run the Slycot unit tests and examples, you'll also need scipy and
42+ pytest.
43+
4144There are a variety of ways to install these dependencies on different
4245operating systems. See the individual packages' documentation for options.
4346
4447Installing
4548-----------
4649
47- In general Slycot requires non-trivial compilation to install on a given
48- system. The easiest way to get started using Slycot is by installing
49- pre-compiled binaries. The Slycot team provides pre-compiled binaries via the
50- conda package manager and conda forge package hosting channel for Linux, OSX,
51- and Windows.
52-
53- Using conda
54- ~~~~~~~~~~~
55-
56- Install Miniconda or Anaconda and then Slycot can be installed via the conda
57- package manager from the conda-forge channel with the following command::
58-
59- conda install -c conda-forge slycot
50+ The easiest way to get started with Slycot is to install pre-compiled
51+ binaries from conda-forge (see below); these are available for Linux,
52+ OSX, and Windows.
6053
61- Using pip
62- ~~~~~~~~~
54+ Compiling the Slycot source is unfortunately a bit tricky, especially
55+ on Windows, but we give some pointers further below for doing this.
6356
64- Slycot can also be installed via the pip package manager. Install pip as per
65- recommendations in pip's documentation. At a minimum, Python and pip must be
66- installed. If a pre-complied binary (i.e. "wheel") is available it will be
67- installed with no need for compilation. If not, pip will attempt to compile the
68- package from source and thus the compilation dependencies will be required
69- (scikit-build, gfortran, BLAS, etc.).
57+ Using conda and conda-forge
58+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
7059
71- Pip can then be used to install Slycot with the command::
60+ First install Miniconda or Anaconda. Slycot can then be installed
61+ from the conda-forge channel with the following command::
7262
73- pip install slycot
63+ conda install -c conda-forge slycot
7464
75- From source
76- ~~~~~~~~~~~
65+ From source without conda (Linux, macOS, Windows)
66+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7767
78- Unpack the course code to a directory of your choice,
68+ Unpack the source code to a directory of your choice,
7969e.g. ``/path/to/slycot_src/ ``
8070
8171If you need to specify a specific compiler, set the environment variable FC
@@ -87,35 +77,85 @@ before running the install::
8777 # Windows:
8878 set FC=D:\path\to\my\fortran.exe
8979
90- To build and install execute::
80+ To build and install, execute::
9181
9282 cd /path/to/slycot_src/
9383 python setup.py install
9484
95- You can also use conda to build and install Slycot from source::
85+ From source using a conda recipe (Linux and macOS)
86+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9687
97- conda build conda-recipe
98- conda install --use-local slycot
88+ You can also use conda to build and install Slycot from source, but
89+ you'll have to choose the right recipe directory.
9990
100- If you prefer to use the OpenBLAS library, a conda recipe is available in
101- ``conda-recipe-openblas ``.
91+ On Linux you can choose between `` conda- recipe-openblas `` and
92+ ``conda-recipe-mkl ``
10293
103- Additional tips for how to install Slycot from source can be found in the
104- ``.travis.yml `` (commands used for Travis CI) and conda-recipe/ (conda
105- pre-requisites) both which are included in the source code repository.
94+ On macOS you should use ``conda-recipe-apple ``. See the
95+ `conda-build documentation `_ how to get the required macOS SDK.
96+
97+ .. _conda-build documentation : https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html#macos-sdk
98+
99+ For example, to build with the OpenBLAS recipe::
100+
101+ conda build -c conda-forge conda-recipe-openblas
102+ conda install -c conda-forge --use-local slycot
103+
104+ From source in a conda environment (Windows)
105+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106+
107+ A similar method can be used for Linux and macOS, but is detailed here
108+ for Windows. This method uses conda and conda-forge to get most build
109+ dependencies, *except * for the C compiler.
110+
111+ This procedure has been tested on Python 3.7 and 3.8.
106112
107- The hardest part about installing from source is getting a working version of
108- FORTRAN and LAPACK installed on your system and working properly with Python.
109- On Windows, the build system currently uses flang, which can be installed from
110- conda-forge. Note that flang is incompatible with Python 2.7.
113+ First, install the `correct Visual Studio compiler for the Python
114+ version `_ you wish to build for.
111115
112- If you are using conda, you can also get working (binary) copies of LAPACK from
113- conda-forge using the command::
116+ .. _correct Visual Studio compiler for the Python version : https://wiki.python.org/moin/WindowsCompilers
114117
115- conda install -c conda-forge lapack
118+ To build, you'll need a command shell setup for both conda and the
119+ Visual Studio build tools. See `conda activation `_ and `Microsoft
120+ Visual Studio setup `_ for information on this.
116121
117- Slycot will also work with the OpenBLAS libraries.
122+ .. _conda activation : https://docs.conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#windows-environment-has-not-been-activated
123+ .. _Microsoft Visual Studio setup : https://docs.microsoft.com/en-us/cpp/build/setting-the-path-and-environment-variables-for-command-line-builds?view=vs-2019
124+
125+ In such a command shell, run the following commands to build and
126+ install Slycot (this example creates a Python 3.8 environment)::
127+
128+ conda create --channel conda-forge --name build-slycot python=3.8 numpy scipy libblas=*=*netlib liblapack=*=*netlib scikit-build flang pytest
129+ conda activate build-slycot
130+
131+ python setup.py install
132+ pytest
133+
134+ The final ``pytest `` command is optional; it runs the Slycot unit tests.
135+
136+ General notes on compiling
137+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
138+
139+ Additional tips for how to install Slycot from source can be found in the
140+ ``.travis.yml `` (commands used for Travis CI) and the ``conda-recipe-*/ ``
141+ directories (conda pre-requisites) both which are included in the source
142+ code repository.
143+
144+ The hardest part about installing from source is getting a working
145+ version of FORTRAN and LAPACK (provided by OpenBLAS, MKL, etc.)
146+ installed on your system, and working properly with Python.
118147
119148Note that in some cases you may need to set the ``LIBRARY_PATH `` environment
120149variable to pick up dependencies such as ``-lpythonN.m `` (where N.m is the
121150version of python you are using).
151+
152+ Using pip
153+ ~~~~~~~~~
154+
155+ We publish Slycot to the Python package index, but only as a source
156+ package, so to install using pip you'll first need to install the
157+ build prerequisites (compilers, libraries, etc.)
158+
159+ If you have these build prerequisites, install in the standard way with:
160+
161+ pip install slycot
0 commit comments