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

Conda not properly updating library linking #10335

Closed
jessemapel opened this issue Nov 4, 2020 · 2 comments
Closed

Conda not properly updating library linking #10335

jessemapel opened this issue Nov 4, 2020 · 2 comments
Labels
locked [bot] locked due to inactivity

Comments

@jessemapel
Copy link

Current Behavior

Some of our users attempted to install our package via Conda and had a issues with Anaconda not properly updating the linking on a dynamic library file. Conda solved for Armadillo 8, but the main library seemed to be trying to link Armadillo 9 after it was installed. You can see their bug reports here:

I wasn't able to reproduce their exact solves, but by first installing Armadillo8.200.0 I was able to reproduce their environments.

From there ldd showed that libisis was linking against libarmadillo9 instead of libarmadillo8:

(isis4.2.0_test) bash-4.2$ ldd $CONDA_PREFIX/lib/libisis.so | grep "armadillo"
	libarmadillo.so.9 => not found

Attempting to run an executable that linked against libisis resulted in a library not found error for libaramadillo9:

(isis4.2.0_test) bash-4.2$ fx -h
fx: error while loading shared libraries: libarmadillo.so.9: cannot open shared object file: No such file or directory

Manually installing armadillo 9.200 from conda-forge (conda install -c conda-forge armadillo=9.200) solved the libarmadillo error but revealed a similar issue with gsl:

(isis4.2.0_test) bash-4.2$ fx -h
fx: error while loading shared libraries: libgsl.so.25: cannot open shared object file: No such file or directory

Manually installing gsl 2.6 (conda install gsl=2.6) solve this and finally allowed the executable to run:

(isis4.2.0_test) bash-4.2$ fx -h
F1       = Null
F2       = Null
F3       = Null
F4       = Null
F5       = Null
TO       = Null
FROMLIST = Null
EQUATION = Null
MODE     = (*CUBES, LIST, OUTPUTONLY)
LINES    = 1
SAMPLES  = 1
BANDS    = 1

Steps to Reproduce

Commands are for bash on Linux

conda env create -n isis4.2.0_test python=3.6
conda activate isis4.2.0_test
conda config --env --add channels conda-forge
conda config --env --add channels usgs-astrogeology
conda install -c conda-forge armadillo=8.200.0
conda install -c usgs-astrogeology isis=4.2.0
export ISISROOT=$CONDA_PREFIX
ldd $CONDA_PREFIX/lib/libisis.so | grep "armadillo"
fx -h

Expected Behavior

I would expect Anaconda to update the linking on libisis so that it links the versions of armadillo and gsl that were installed.

The ldd command should properly show libisis linking against libarmadillo8:

(isis4.0.0) bash-4.2$ ldd $CONDA_PREFIX/lib/libisis.so | grep "armadillo"
	libarmadillo.so.8 => /usgs/cpkgs/anaconda3_linux/envs/isis4.0.0/lib/./libarmadillo.so.8 (0x00007f442c6ee000)

The fx application should properly return its arguments

(isis4.0.0) bash-4.2$ fx -h
F1       = Null
F2       = Null
F3       = Null
F4       = Null
F5       = Null
TO       = Null
FROMLIST = Null
EQUATION = Null
MODE     = (*CUBES, LIST, OUTPUTONLY)
LINES    = 1
SAMPLES  = 1
BANDS    = 1

Is this too much to ask Anaconda to do? Do we need to pin the major version on armadillo in our conda-build recipe?

Environment Information

`conda info`

     active environment : isis4.2.0_test
    active env location : /work/users/jmapel/anaconda_local/envs/isis4.2.0_test
            shell level : 1
       user config file : /home/jmapel/.condarc
 populated config files : /home/jmapel/.condarc
                          /work/users/jmapel/anaconda_local/envs/isis4.2.0_test/.condarc
          conda version : 4.8.2
    conda-build version : 3.18.12
         python version : 3.7.4.final.0
       virtual packages : __glibc=2.17
       base environment : /work/users/jmapel/anaconda_local  (writable)
           channel URLs : https://conda.anaconda.org/usgs-astrogeology/linux-64
                          https://conda.anaconda.org/usgs-astrogeology/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /work/users/jmapel/anaconda_local/pkgs
                          /home/jmapel/.conda/pkgs
       envs directories : /usgs/cpkgs/anaconda3_linux/envs
                          /work/users/jmapel/anaconda_local/envs
                          /home/jmapel/.conda/envs
               platform : linux-64
             user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.4 Linux/3.10.0-957.10.1.el7.x86_64 centos/7.6.1810 glibc/2.17
                UID:GID : 79440:1800
             netrc file : None
           offline mode : False


`conda config --show-sources`

==> /home/jmapel/.condarc <==
envs_dirs:
  - /usgs/cpkgs/anaconda3_linux/envs
ssl_verify: False
channels:
  - usgs-astrogeology
  - conda-forge
  - defaults

==> /work/users/jmapel/anaconda_local/envs/isis4.2.0_test/.condarc <==
channels:
  - usgs-astrogeology
  - conda-forge
  - defaults


`conda list --show-channel-urls`

# packages in environment at /work/users/jmapel/anaconda_local/envs/isis4.2.0_test:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
ale                       0.8.4            py36hdb11119_0    conda-forge
armadillo                 8.200.0         blas_openblas_200  [blas_openblas]  conda-forge
arpack                    3.6.2           blas_openblash26a2512_200  [blas_openblas]  conda-forge
blas                      1.1                    openblas    conda-forge
boost                     1.68.0          py36h8619c78_1001    conda-forge
boost-cpp                 1.68.0            h11c811c_1000    conda-forge
bullet                    2.86.1                        0    usgs-astrogeology
bz2file                   0.98                       py_0    conda-forge
bzip2                     1.0.8                h516909a_3    conda-forge
ca-certificates           2020.6.20            hecda079_0    conda-forge
cairo                     1.14.6                        4    conda-forge
certifi                   2020.6.20        py36h9880bd3_2    conda-forge
cspice                    66                h516909a_1010    conda-forge
curl                      7.64.0               h646f8bb_0    conda-forge
dbus                      1.13.0            h4e0c4b3_1000    conda-forge
decorator                 4.4.2                      py_0    conda-forge
eigen                     3.3.8                hc9558a2_0    conda-forge
embree                    2.16.0                        0    usgs-astrogeology
expat                     2.2.9                he1b5a44_2    conda-forge
ffmpeg                    3.4.1                         0    conda-forge
flann                     1.9.1                         0    conda-forge
fontconfig                2.12.1                        4    conda-forge
freetype                  2.7                           1    conda-forge
geos                      3.7.3                he1b5a44_0    conda-forge
geotiff                   1.4.2                hb54a4aa_1    conda-forge
gettext                   0.19.8.1          hf34092f_1004    conda-forge
giflib                    5.2.1                h36c2ea0_2    conda-forge
glib                      2.51.4                        0    conda-forge
gmm                       5.0                           0    usgs-astrogeology
gmp                       6.2.0                h58526e2_4    conda-forge
gsl                       2.2.1           blas_openblas_3  [blas_openblas]  conda-forge
gst-plugins-base          1.8.0                         0    conda-forge
gstreamer                 1.8.0                         2    conda-forge
harfbuzz                  1.3.4                         2    conda-forge
hdf5                      1.8.18                        3    conda-forge
icu                       58.2              hf484d3e_1000    conda-forge
isis                      4.2.0                         0    usgs-astrogeology
jama                      125                           0    usgs-astrogeology
jasper                    1.900.1                       4    conda-forge
jpeg                      9b                   h024ee3a_2    defaults
kakadu                    1                             0    usgs-astrogeology
krb5                      1.16.3            hc83ff2d_1000    conda-forge
ld_impl_linux-64          2.35                 h769bd43_9    conda-forge
libblas                   3.8.0               17_openblas    conda-forge
libcblas                  3.8.0               17_openblas    conda-forge
libcurl                   7.64.0               h01ee5af_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libffi                    3.2.1             he1b5a44_1007    conda-forge
libgcc                    7.2.0                h69d50b8_2    conda-forge
libgcc-ng                 9.3.0               h5dbcf3e_17    conda-forge
libgfortran               3.0.0                         1    conda-forge
libgfortran-ng            7.5.0               hae1eefd_17    conda-forge
libgfortran4              7.5.0               hae1eefd_17    conda-forge
libgomp                   9.3.0               h5dbcf3e_17    conda-forge
libiconv                  1.15              h516909a_1006    conda-forge
liblapack                 3.8.0               17_openblas    conda-forge
libopenblas               0.3.10               h5a2b251_0    defaults
libpng                    1.6.37               h21135ba_2    conda-forge
libpq                     10.6              h13b8bad_1000    conda-forge
libprotobuf               3.9.1                h8b12597_0    conda-forge
libssh2                   1.8.0             h1ad7b7a_1003    conda-forge
libstdcxx-ng              9.3.0               h2ae2ef3_17    conda-forge
libtiff                   4.0.9                he6b73bb_1    conda-forge
libuuid                   2.32.1            h14c3975_1000    conda-forge
libwebp                   0.5.2                         7    conda-forge
libxcb                    1.13              h14c3975_1002    conda-forge
libxml2                   2.9.9                h13577e0_2    conda-forge
mesalib                   18.3.1               h590aaf7_0    conda-forge
metis                     5.1.0             he1b5a44_1006    conda-forge
mysql                     5.7.20            hf484d3e_1001    conda-forge
mysql-connector-c         6.1.11            hab6429c_1002    conda-forge
nanoflann                 1.3.1                         0    conda-forge
ncurses                   6.2                  he1b5a44_2    conda-forge
networkx                  2.5                        py_0    conda-forge
nlohmann_json             3.9.1                he1b5a44_0    conda-forge
nn                        1.86.0            h14c3975_2003    conda-forge
numpy                     1.13.3          py36_blas_openblas_200  [blas_openblas]  conda-forge
openblas                  0.2.19                        2    conda-forge
opencv                    3.2.0           np113py36_blas_openblas_203  [blas_openblas]  conda-forge
openssl                   1.0.2u               h516909a_0    conda-forge
pcl                       1.9.1             h482114b_1002    conda-forge
pcre                      8.44                 he1b5a44_0    conda-forge
pip                       20.2.4                     py_0    conda-forge
pixman                    0.34.0            h14c3975_1003    conda-forge
postgresql                10.6              h66cca7a_1000    conda-forge
proj4                     4.9.3                h516909a_9    conda-forge
protobuf                  3.9.1            py36he1b5a44_0    conda-forge
pthread-stubs             0.4               h14c3975_1001    conda-forge
pvl                       1.0.1              pyh9f0ad1d_0    conda-forge
python                    3.6.7             hd21baee_1002    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.6                     1_cp36m    conda-forge
pyyaml                    5.3.1            py36he6145b8_1    conda-forge
qhull                     7.2.0                         0    usgs-astrogeology
qt                        5.9.6                         0    usgs-astrogeology
qwt                       6.1.3                         0    usgs-astrogeology
readline                  7.0               hf8c457e_1001    conda-forge
scipy                     1.2.1            py36h09a28d5_1    conda-forge
setuptools                49.6.0           py36h9880bd3_2    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
spiceypy                  2.3.2                      py_0    conda-forge
sqlite                    3.28.0               h8b20d00_0    conda-forge
suitesparse               4.5.4           blas_openblas_200  [blas_openblas]  conda-forge
superlu                   5.2.2                hfe2efc7_0    conda-forge
tbb                       4.4                           0    usgs-astrogeology
tk                        8.6.10               hed695b0_1    conda-forge
tnt                       126                           0    usgs-astrogeology
tzcode                    2020a                h516909a_0    conda-forge
wheel                     0.35.1             pyh9f0ad1d_0    conda-forge
x264                      20131218                      0    conda-forge
xerces-c                  3.1.4                         0    usgs-astrogeology
xorg-fixesproto           5.0               h14c3975_1002    conda-forge
xorg-inputproto           2.3.2             h14c3975_1002    conda-forge
xorg-kbproto              1.0.7             h14c3975_1002    conda-forge
xorg-libice               1.0.10               h516909a_0    conda-forge
xorg-libsm                1.2.3             h84519dc_1000    conda-forge
xorg-libx11               1.6.12               h516909a_0    conda-forge
xorg-libxau               1.0.9                h14c3975_0    conda-forge
xorg-libxdmcp             1.1.3                h516909a_0    conda-forge
xorg-libxext              1.3.4                h516909a_0    conda-forge
xorg-libxfixes            5.0.3             h516909a_1004    conda-forge
xorg-libxi                1.7.10               h516909a_0    conda-forge
xorg-libxrender           0.9.10            h516909a_1002    conda-forge
xorg-renderproto          0.11.1            h14c3975_1002    conda-forge
xorg-xextproto            7.3.0             h14c3975_1002    conda-forge
xorg-xproto               7.0.31            h14c3975_1007    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
yaml                      0.2.5                h516909a_0    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge

@jessemapel jessemapel changed the title Conda not properly updating Conda not properly updating library linking Nov 4, 2020
@chenghlee
Copy link
Contributor

The shared library (.so) versions are determined at link-time when the package is built, and it would be a really bad idea for conda to modify the "needed libraries" data of the executables & libraries at package install time; such SONAME changes often indicate API and/or ABI incompatibilities, so having conda change the required versions would very likely lead to broken applications.

As you noted in the ticket, the correct way of handling this is to write your recipe so that your package properly states the versions of the libraries it needs. Note that if you are using conda-build >=3.0 and conda-forge/defaults channel packages, this should (largely) be handled automatically via the run_exports mechanism, as long as your recipe is appropriately structured; e.g., for Armadillo and GSL, your recipe's requirements section should look something like:

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
  host:
    - armadillo
    - gsl >=2.6
  run:
    # NOTE: "armadillo" and "gsl" do NOT need to be explicitly included in the
    # recipe's run requirements list; `conda build` will automatically inspect
    # the `run_exports` specifications for these packages and insert the
    # appropriate version-constrained requirements in your package's metadata.
    - other_app

@github-actions
Copy link

github-actions bot commented Nov 6, 2021

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Nov 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests

2 participants