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
新手
9,309 次查看

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 项奖励
1 解答
Huiyan_C_Intel
主持人
9,000 次查看

Hi,


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


在原帖中查看解决方案

0 项奖励
6 回复数
AthiraM_Intel
主持人
9,265 次查看

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 项奖励
kgerheiser
新手
9,247 次查看

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 项奖励
kgerheiser
新手
9,242 次查看

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 项奖励
kgerheiser
新手
9,231 次查看

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 项奖励
AthiraM_Intel
主持人
9,211 次查看

Hi,


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


Thanks


0 项奖励
Huiyan_C_Intel
主持人
9,001 次查看

Hi,


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


0 项奖励
回复