Skip to content

linking against an external library dependency in site_packages #782

Answered by bumi001
bumi001 asked this question in Q&A
Discussion options

You must be logged in to vote

Turns out I didn't need to use cpp_args or add_project_arguments(). But I needed to add the following to the meson.build that @daknuett has.

min_supported_cpython = run_command(python, ['-c', 'import torch.utils.cpp_extension; print(torch.utils.cpp_extension.min_supported_cpython)'], check: true).stdout().strip()
add_global_arguments('-D_Py_LIMITED_API=@0@'.format(min_supported_cpython), language: 'cpp')

Now, nm produces what I have been seeking:

nm -u --demangle _C.cpython-313-x86_64-linux-gnu.so | grep DispatchKey
                 U c10::impl::ExcludeDispatchKeyGuard::ExcludeDispatchKeyGuard(c10::DispatchKeySet)
                 U c10::impl::ExcludeDispatchKeyGuard::~ExcludeDispatchKey…

Replies: 5 comments 17 replies

Comment options

You must be logged in to vote
5 replies
@bumi001
Comment options

@bumi001
Comment options

@rgommers
Comment options

@bumi001
Comment options

@eli-schwartz
Comment options

Comment options

You must be logged in to vote
10 replies
@bumi001
Comment options

@bumi001
Comment options

@eli-schwartz
Comment options

@bumi001
Comment options

Answer selected by bumi001
@daknuett
Comment options

@daknuett
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@daknuett
Comment options

@bumi001
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants