Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Slycot installation on Ubuntu #15

Closed
Rariusz opened this issue Dec 23, 2017 · 6 comments
Closed

Problem with Slycot installation on Ubuntu #15

Rariusz opened this issue Dec 23, 2017 · 6 comments

Comments

@Rariusz
Copy link

Rariusz commented Dec 23, 2017

Hey,

I am trying to install the Slycot package on the Ubuntu system for Python 2.7.xxx
This is the list of packages I have installed:

adium-theme-ubuntu (0.3.4)
backports-abc (0.5)
backports.functools-lru-cache (1.4)
backports.shutil-get-terminal-size (1.0.0)
beautifulsoup4 (4.5.3)
bleach (2.1.2)
certifi (2017.11.5)
chardet (3.0.4)
configparser (3.5.0)
control (0.7.0)
cryptography (1.7.1)
cycler (0.10.0)
decorator (4.1.2)
entrypoints (0.2.3)
enum34 (1.1.6)
functools32 (3.2.3.post2)
html5lib (1.0.1)
idna (2.6)
ipaddress (1.0.17)
ipykernel (4.7.0)
ipython (5.5.0)
ipython-genutils (0.2.0)
ipywidgets (7.0.5)
Jinja2 (2.10)
jsonschema (2.6.0)
jupyter (1.0.0)
jupyter-client (5.2.0)
jupyter-console (5.2.0)
jupyter-core (4.4.0)
keyring (10.3.1)
keyrings.alt (2.2)
lxml (3.7.3)
MarkupSafe (1.0)
matplotlib (2.1.1)
mistune (0.8.3)
mpmath (1.0.0)
nbconvert (5.3.1)
nbformat (4.4.0)
nltk (3.2.5)
notebook (5.2.2)
numpy (1.13.3)
pandas (0.21.1)
pandocfilters (1.4.2)
pathlib2 (2.3.0)
pexpect (4.3.1)
pickleshare (0.7.4)
Pillow (4.0.0)
pip (9.0.1)
plotly (2.2.3)
prompt-toolkit (1.0.15)
ptyprocess (0.5.2)
pyasn1 (0.1.9)
pycrypto (2.6.1)
Pygments (2.2.0)
pygobject (3.22.0)
pyparsing (2.2.0)
pysam (0.13)
python-dateutil (2.6.1)
pytz (2017.3)
pyxdg (0.25)
pyzmq (16.0.3)
qtconsole (4.3.1)
regex (2017.12.12)
requests (2.18.4)
scandir (1.6)
scipy (1.0.0)
seaborn (0.8.1)
SecretStorage (2.3.1)
setuptools (38.2.4)
simplegeneric (0.8.1)
singledispatch (3.4.0.3)
six (1.11.0)
subprocess32 (3.2.7)
sympy (1.1.1)
terminado (0.8.1)
testpath (0.3.1)
tornado (4.5.2)
traitlets (4.3.2)
unity-lens-photos (1.0)
urllib3 (1.22)
wcwidth (0.1.7)
webencodings (0.5.1)
wheel (0.29.0)
widgetsnbextension (3.0.8)

Despite my attempts I still have the same error:
s1
s2

How to solve the above errors?

Best,
Rariusz

@murrayrm
Copy link
Member

The screen shot does not actually include enough information to determine what the issue is, but a common problem that generates an error message of this sort is that there is an error in linking, usually associated with -llapack or -lpython2.7. This can occur when you have a mixture of packages coming from conda (or something similar) and your operating system. If you scroll up in the window, you should be able to see what the actual error message is.

Three suggestions:

  • What we do for testing in python-control is to use the following set of commands to install slycot:
sudo apt-get install gfortran liblapack-dev
git clone https://github.com/python-control/Slycot.git slycot
cd slycot
python setup.py install

This works in our Travis CI tests under Ubuntu/Testy on Python 2.7. It basically installs gfortran and lapack on your operating system, then uses that for compiling slycot. See python-control PR 169 for details.

  • You can use the conda recipe that is included with the slycot package. See conda-recipe/meta.yml.
    This approach does everything within a conda environment. I have had troubles getting this to work on systems where the system gcc/gfortran compiler is incompatible with the conda packages (e.g., lapack), but it is worth a shot.

  • Finally, if none of those work, I have had good luck with the following commands on my Mac:

conda create -n test_slycot -c conda-forge python=3.6 gcc lapack matplotlib scipy
source activate test_slycot
python setup.py install

@cknoll
Copy link

cknoll commented Jan 13, 2018

Today I had a similar problem like @Rariusz . I figured out the solution by myself that the problem were missing dev-versions of libraries, but it took me annoyingly long time.
Main reason: I did not see the relevant errormessage.

The build process generated more than 100 kB of output. The relevant error message (/usr/bin/ld: cannot find -llapack) was in the third to last line but the last line was allone 22kB and therefore cluttered the whole terminal.

Maybe an easy fix would be to provide some more helpful error messages:

Additionally to Command "/usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oslowy16/slycot/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-uq6skn11-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-oslowy16/slycot/

Something like Probably not all dependencies can be found. See https://github.com/jgoppert/Slycot/tree/master#prerequisite for details would have helped me a lot.

A more solid (but laborious) fix might be to write the bulk of error messages to a logfile and only report "helpful" messages and the path of the logfile.

Additionally: Why does pip3 install slycot on Debian linux not fetch a binary wheel?
What is needed to provide one? (maybe this should be discussed in an different issue).

@repagh
Copy link
Member

repagh commented Aug 24, 2018

PR #38 uses a re-vamped build system. The build output is much more compact, and since the build is based on cmake, detection of missing libraries takes place earlier

@hungpham2511
Copy link

On Ubuntu 16.04 it seems openblas is also needed, other than gfortran and lapack.

I was able to install slycot from source after installing openblas as below:

sudo apt install libopenblas-dev

roryyorke added a commit that referenced this issue Apr 17, 2019
README.rst update for new buildsystem, issues #48, #47, #15
@billtubbs
Copy link

billtubbs commented May 25, 2019

I don't know if this is directly relevant to the specific issue reported here but I was having problems installing slycot on linux with mostly conda-managed packages and after trying a few things this worked perfectly:

conda install -c conda-forge slycot

Output:

Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: /home/billtubbs/miniconda3/envs/tf-gpu

  added / updated specs:
    - slycot


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2019.3.9   |       hecc5488_0         146 KB  conda-forge
    certifi-2019.3.9           |           py36_0         149 KB  conda-forge
    openblas-0.3.3             |    h9ac9557_1001        15.8 MB  conda-forge
    openssl-1.1.1b             |       h14c3975_1         4.0 MB  conda-forge
    slycot-0.3.4.0             |   py36hf0b9930_0         1.2 MB  conda-forge
    ------------------------------------------------------------
                                           Total:        21.2 MB

The following NEW packages will be INSTALLED:

  openblas           conda-forge/linux-64::openblas-0.3.3-h9ac9557_1001
  slycot             conda-forge/linux-64::slycot-0.3.4.0-py36hf0b9930_0

The following packages will be UPDATED:

  ca-certificates    pkgs/main::ca-certificates-2019.1.23-0 --> conda-forge::ca-certificates-2019.3.9-hecc5488_0

The following packages will be SUPERSEDED by a higher-priority channel:

  certifi                                         pkgs/main --> conda-forge
  openssl              pkgs/main::openssl-1.1.1b-h7b6447c_1 --> conda-forge::openssl-1.1.1b-h14c3975_1


Proceed ([y]/n)?

For info, the specific error I was getting trying to do this the standard way was as follows:

$ pip install slycot
Collecting slycot
  Using cached https://files.pythonhosted.org/packages/57/85/62b75247a271aef40c87539c884878cf965d0bd46679b5f0611905fee333/slycot-0.3.4.0.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-a2he4emz/slycot/setup.py", line 8, in <module>
        from skbuild import setup
    ModuleNotFoundError: No module named 'skbuild'
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-a2he4emz/slycot/

@roryyorke
Copy link
Collaborator

On Ubuntu 18.04, in a virtual environment with up-to-date pip (pip install -U pip), I can successfully pip install slycot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants