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

LDLIBRARY is set to libpython3.9a although no static lib is included in mambaforge for Linux #565

Open
1 task done
maxnoe opened this issue Mar 25, 2022 · 4 comments
Open
1 task done
Labels

Comments

@maxnoe
Copy link

maxnoe commented Mar 25, 2022

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

Compiling software, I use sysconfig.get_config_var("LDLIBRARY") to get the name of the python library.

In a fresh mambaforge installation, this variable is set to libpython3.9.a but only shared libraries are present in the lib dir:

❯ python -c 'import sysconfig; print(sysconfig.get_config_var("LDLIBRARY"))'
libpython3.9.a

❯ ls -1 ~/.local/conda/lib/libpython*
/home/mnoethe/.local/conda/lib/libpython3.9.so
/home/mnoethe/.local/conda/lib/libpython3.9.so.1.0
/home/mnoethe/.local/conda/lib/libpython3.so

Installed packages

Fresh mambaforge installation

Environment info

❯ conda info

     active environment : base
    active env location : /home/mnoethe/.local/conda
            shell level : 1
       user config file : /home/mnoethe/.condarc
 populated config files : /home/mnoethe/.local/conda/.condarc
          conda version : 4.11.0
    conda-build version : not installed
         python version : 3.9.7.final.0
       virtual packages : __linux=5.14.0=0
                          __glibc=2.31=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/mnoethe/.local/conda  (writable)
      conda av data dir : /home/mnoethe/.local/conda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/mnoethe/.local/conda/pkgs
                          /home/mnoethe/.conda/pkgs
       envs directories : /home/mnoethe/.local/conda/envs
                          /home/mnoethe/.conda/envs
               platform : linux-64
             user-agent : conda/4.11.0 requests/2.26.0 CPython/3.9.7 Linux/5.14.0-1027-oem ubuntu/20.04.4 glibc/2.31
                UID:GID : 5074:5002
             netrc file : None
           offline mode : False
@maxnoe maxnoe added the bug label Mar 25, 2022
@isuruf
Copy link
Member

isuruf commented Mar 25, 2022

You need to install libpython-static package.

@maxnoe
Copy link
Author

maxnoe commented Mar 25, 2022

@isuruf I don't want to have the static lib. This is about that the python package has the wrong sysconfig variable in the metadata.

sysconfig.get_config_var("LDLIBRARY") should point to an existing file, in this case the libpython3.9.so

@hmaarrfk
Copy link

For what its worth, it also affects 3.10.

We might to patch something here
https://github.com/python/cpython/blob/39a54ba63850e081a4a5551a773df5b4d5b1d3cd/Lib/sysconfig.py#L628

@hmaarrfk
Copy link

I'm not sure if this is something that we can work with upstream on.

I'm not really sure what the correct behavior is:

  1. Return .so when -static isn't installed.
  2. Return .a when -static is installed

Do we want the above?

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

No branches or pull requests

3 participants