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

Static link of python in windows fails due to gcc style static library name. #13848

Open
dcrowe777 opened this issue Oct 30, 2024 · 2 comments
Open
Labels
modules:python Issues specific to the python module

Comments

@dcrowe777
Copy link

libpath = Path('libs') / f'libpython{vernum}.a'

statically linked python fails on windows with :

Program python3 found: YES
Program C:\Python311\python found: YES (C:\Python311\python.exe)
Could not find Python3 library 'C:\Python311\libs\libpython311.a'
Run-time dependency python found: NO (tried sysconfig)

meson.build:33:12: ERROR: Python dependency not found

@dcbaker dcbaker added the modules:python Issues specific to the python module label Oct 31, 2024
@rgommers
Copy link
Contributor

rgommers commented Nov 4, 2024

Thanks for the report @dcrowe777. We were just looking at that exact line in gh-13851 and wondering if it was used at all. I'm curious about your use case, could you elaborate?

It seems like we may need:

  1. Cygwin/MinGW support, both Python and the package depending on it built with 'gcc': .a
  2. All built with MSVC/Clang-cl/Intel: .lib

For each of those, we will then need libpython{vernum} or libpython{vernum}t, depending on is_freethreaded. Unclear to me if we also need stable ABI variants. And I guess we probably shouldn't support the "mixed compilers" use case for static linking (libpython313.lib + 'gcc').

@dcrowe777
Copy link
Author

My use case is MSVC with the following lines in meson.build :

pymod = import('python')
py = pymod.find_installation('python3')
py_dep = py.dependency(embed: 'true', static: true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules:python Issues specific to the python module
Projects
None yet
Development

No branches or pull requests

3 participants