Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.

libpython3.9.a does not exist

kgerheiser
Novice
4,790 Views

I am trying to use Intel Python to build a package which requires linking to libpython. The package queries the Python libraries through `python -m sysconfig`. Specifically, the LDLIBRARY entry.

 

But for Intel Python it's configured incorrectly. Intel Python sets "LDLIBRARY = "libpython3.9.a" despite there not being a `libpython3.9.a` in `/opt/intel/oneapi/intelpython/python3.9/lib`

 

```

$ ls /opt/intel/oneapi/intelpython/python3.9/lib/libpython*
/opt/intel/oneapi/intelpython/python3.9/lib/libpython3.9.so /opt/intel/oneapi/intelpython/python3.9/lib/libpython3.9.so.1.0 /opt/intel/oneapi/intelpython/python3.9/lib/libpython3.so

```

 

Similarly, in CONFIGURE_ARGS there's `--disable-shared`.

 

So, my question is why is Intel Python configured this way? It's build with `--disable-shared` according to the log, but there are no static libraries and only shared libraries.

0 Kudos
1 Solution
Huiyan_C_Intel
Moderator
4,481 Views

Hi,


Thanks for reporting this issue, we will fix it in next release!


View solution in original post

0 Kudos
6 Replies
AthiraM_Intel
Moderator
4,746 Views

Hi,


Thankyou for posting in Intel Communities.


Could you please share the following details:


1) The package you are trying to install?

2) OS you are using?


Thanks.


0 Kudos
kgerheiser
Novice
4,728 Views

The application I'm building doesn't matter, it's just how I came to see the bug.

 

This was on Ubuntu 20.04.

 

On macOS the library is correct:  LDLIBRARY = "libpython3.7m.dylib" 

On a supercomputer I have access to (which I think is CentOS 7), it's also correct: `LDLIBRARY = "libpython3.7m.so"`

 

But on Ubuntu and a different super computer (also with CentOS 7 as the base OS) it's:  LDLIBRARY = "libpython3.9.a" (which doesn't exist)

 

On Ubuntu I installed it with `sudo apt install intel-oneapi-python`

0 Kudos
kgerheiser
Novice
4,723 Views

I have some more to add. This change seems to be related to the upgrade to Python 3.8 (and 3.9) starting in Intel 2021.3. The values are correct in previous versions of Intelpython when using Python 3.7.

0 Kudos
kgerheiser
Novice
4,712 Views

I downloaded the offline installer, extracted the contents, and looked at the Python executable. It's built with --disable-shared, but the lib directory only contains .so libraries. If Python was built with --disable-shared then it seems to me that the lib directory should contain a `libpython3.a` for consistency.

 

I found this script which is used to configure/build Python.

 

l_BaseKit_p_2022.1.2.146_offline/packages/intel.oneapi.lin.python3,v=2022.0.2-155/cupPayload/_installdir/conda_channel/linux-64/python-3.9.7-h718aa4a_4/info/recipe/build.sh

 

In that script there it builds Python twice, first with shared libraries, and then statically. Then, at the end of that script the static library is deleted.

 

rm ${PREFIX}/lib/libpython${VER}.a

 

So, what I gather is that the static interpreter is used (for performance reasons?) but only the shared libraries are installed, but then this leads to an inconsistent `python3 -m sysconfig`.

 

0 Kudos
AthiraM_Intel
Moderator
4,692 Views

Hi,


Thanks for sharing the detailed information. We will check on this internally and get back to you soon with an update.


Thanks


0 Kudos
Huiyan_C_Intel
Moderator
4,482 Views

Hi,


Thanks for reporting this issue, we will fix it in next release!


0 Kudos
Reply