esa / pagmo_plugins_nonfree

A pagmo affiliated package (https://github.com/esa/pagmo2) adding commercial solvers to the list of solvers/algorithms: SNOPT7, WORHP
GNU General Public License v3.0
10 stars 9 forks source link

Incorrectly set dependencies for pygmo_plugins_nonfree in conda #16

Closed Microno95 closed 4 years ago

Microno95 commented 4 years ago

There is a small issue in the Conda package that results in the following error when trying to import pygmo_plugins_nonfree:

>>> import pygmo_plugins_nonfree as ppnf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ekin/miniconda3/envs/ppnf_test/lib/python3.6/site-packages/pygmo_plugins_nonfree/__init__.py", line 8, in <module>
    from .core import *
ImportError: libboost_python36.so.1.70.0: cannot open shared object file: No such file or directory

This was tested in a newly created conda environment created with the command: conda create -n ppnf_test python==3.6 pygmo pygmo_plugins_nonfree pykep with conda_forge as the preferred installation channel.

Click for environment details My environment is a fresh Python 3.6 conda environment with the following specs: ``` # packages in environment at /home/ekin/miniconda3/envs/ppnf_test: # # Name Version Build Channel _libgcc_mutex 0.1 main ampl-mp 3.1.0 hc99cbb1_1003 conda-forge backcall 0.1.0 py_0 conda-forge boost 1.68.0 py36h8619c78_1001 conda-forge boost-cpp 1.68.0 h11c811c_1000 conda-forge bzip2 1.0.8 h516909a_1 conda-forge ca-certificates 2019.9.11 hecc5488_0 conda-forge certifi 2019.9.11 py36_0 conda-forge cloudpickle 1.2.2 py_0 conda-forge decorator 4.4.1 py_0 conda-forge eigen 3.3.7 h6bb024c_1000 conda-forge gmp 6.1.2 hf484d3e_1000 conda-forge icu 58.2 hf484d3e_1000 conda-forge ipopt 3.12.12 hba85781_1006 conda-forge ipykernel 5.1.3 py36h5ca1d4c_0 conda-forge ipyparallel 6.2.4 py36_0 conda-forge ipython 7.9.0 py36h5ca1d4c_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge jedi 0.15.1 py36_0 conda-forge jupyter_client 5.3.3 py36_1 conda-forge jupyter_core 4.5.0 py_0 conda-forge libblas 3.8.0 14_openblas conda-forge libcblas 3.8.0 14_openblas conda-forge libgcc-ng 9.1.0 hdf63c60_0 libgfortran-ng 7.3.0 hdf63c60_2 conda-forge liblapack 3.8.0 14_openblas conda-forge libopenblas 0.3.7 h6e990d7_2 conda-forge libsodium 1.0.17 h516909a_0 conda-forge libstdcxx-ng 9.1.0 hdf63c60_0 metis 5.1.0 he1b5a44_1004 conda-forge mpfr 4.0.2 he80fd80_0 conda-forge mumps-include 5.2.1 5 conda-forge mumps-seq 5.2.1 h9dc29ad_5 conda-forge ncurses 5.9 10 conda-forge nlopt 2.5.0 py36h35deaed_1000 conda-forge numpy 1.17.3 py36h95a1406_0 conda-forge openssl 1.0.2r h14c3975_0 conda-forge pagmo 2.10 h3b0fa25_1000 conda-forge parso 0.5.1 py_0 conda-forge pexpect 4.7.0 py36_0 conda-forge pickleshare 0.7.5 py36_1000 conda-forge pip 19.3.1 py36_0 conda-forge prompt_toolkit 2.0.10 py_0 conda-forge ptyprocess 0.6.0 py_1001 conda-forge pyaudi 1.6.3 py36h615d524_1 conda-forge pygments 2.4.2 py_0 conda-forge pygmo 2.10 py36h7bceaee_1002 conda-forge pygmo_plugins_nonfree 0.10 py36hb3f55d8_0 conda-forge pykep 2.3 py36h886bf27_0 conda-forge python 3.6.0 2 conda-forge python-dateutil 2.8.0 py_0 conda-forge pyzmq 18.1.0 py36h1768529_0 conda-forge readline 6.2 0 conda-forge scotch 6.0.8 h0eec0ba_1 conda-forge setuptools 41.6.0 py36_0 conda-forge six 1.12.0 py36_1000 conda-forge sqlite 3.13.0 1 conda-forge tk 8.5.19 2 conda-forge tornado 6.0.3 py36h516909a_0 conda-forge traitlets 4.3.3 py36_0 conda-forge wcwidth 0.1.7 py_1 conda-forge wheel 0.33.6 py36_0 conda-forge xz 5.2.4 h14c3975_1001 conda-forge zeromq 4.3.2 he1b5a44_2 conda-forge zlib 1.2.11 h516909a_1006 conda-forge ```

The issue seems to stem from the way the Boost library requirements are laid out. Essentially, pykep requires Boost 1.68.x while pygmo 2.11 and pygmo_plugins_nonfree 0.10 both require Boost 1.70.x, but this is not explicitly stated in the conda requirements for the latter as can be seen in the output of conda search --info conda-forge/linux-64::pygmo_plugins_nonfree==0.10=py36hb3f55d8_0:

Loading channels: done
pygmo_plugins_nonfree 0.10 py36hb3f55d8_0
-----------------------------------------
file name   : pygmo_plugins_nonfree-0.10-py36hb3f55d8_0.tar.bz2
name        : pygmo_plugins_nonfree
version     : 0.10
build       : py36hb3f55d8_0
build number: 0
size        : 283 KB
license     : GPL v3 and LGPL v3
subdir      : linux-64
url         : https://conda.anaconda.org/conda-forge/linux-64/pygmo_plugins_nonfree-0.10-py36hb3f55d8_0.tar.bz2
md5         : e443659c671e75e408f0d3deeb3b0d15
timestamp   : 2019-09-19 17:13:54 UTC
dependencies:
  - boost
  - cloudpickle
  - ipyparallel
  - libgcc-ng >=7.3.0
  - libstdcxx-ng >=7.3.0
  - numpy >=1.14.6,<2.0a0
  - pagmo
  - pygmo
  - python >=3.6,<3.7.0a0

When installing pykep alongside pygmo and pygmo_plugins_nonfree, conda is forced to create an environment where the version of pygmo is 2.10 due to the fact that the Boost that is installed is 1.68.x (as this is the version required by pykep 2.3). Since pygmo_plugins_nonfree does not explicitly state the version of Boost that is required version 0.10 is installed. Since this actually does depend on Boost 1.70.x, it is not possible to import the package due to the inconsistencies of the environment.

Suggested solution is to have pygmo_plugins_nonfree 0.10 list Boost 1.70.x as a requirement so that conda does not create an inconsistent environment.

darioizzo commented 4 years ago

Thanks for the report. Your diagnosis and solution seems correct. As a qujick solution I am rebuilding pykep for boost 1.70 ... but in the long run those recipe needs to be updated as to ensure only consisten env are created.

Will let you know when the new packages are available (hopefully today)

Microno95 commented 4 years ago

Just tested with the latest version of pykep compiled with Boost 1.70.x and now the environment is fully functional!