-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Using meson with pybind11 #4677
Comments
El El mié, 26 dic 2018 a las 11:53, richardgedwards <
notifications@github.com> escribió:
The pybind11 website indicates that to compile with pybind11 one should
issue the following:
c++ -O3 -Wall -shared -std=c++11 -fPIC python3 -m pybind11 --includes
example.cpp -o examplepython3-config --extension-suffix
How would one get this from the meson-build system?
I think there us a wrapdb package. Add it to your subproject and it should
work.
… You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4677>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AM7F69brVV0eFBllrqiXUCrIeJvRyVq8ks5u8wDNgaJpZM4ZhXbI>
.
|
Hi, thanks for the quick response. The problem I am having is getting the correct name of my static library after it is compiled. Here is my meson.build file:
This compiles a library called |
El El mié, 26 dic 2018 a las 23:28, richardgedwards <
notifications@github.com> escribió:
Hi, thanks for the quick response. pybind11 is a header only library, so
adding it to my project is not a problem. As far as I understand, using the
wrapdb package as a subproject only helps with adding the pybind11 header
to my existing project and does not provide details on how to compile it.
Please correct me if I am wrong.
The problem I am having is getting the correct name of my static library
after it is compiled.
Here is my meson.build file:
project('pybindtest', 'cpp', default_options : ['cpp_std=c++14',])
deps = [dependency('python3')]
src = ['example.cpp']
shared_library('example', sources : src, dependencies : deps)
If you want a python module I think you need to use shared_module from
reference manual. Try and tell me if it works for you.
https://mesonbuild.com/Reference-manual.html#shared-module
You can compose the name detecting the python version and so on with the
python module but do not know the details.
… This compiles a library called libexample.so, where I need the library to
be named: example.cpython-36m-x86_64-linux-gnu.so which is generated by
concatenating the cpp file name (without extension) example + the output
from the the command python3-config --extension-suffix. Is there a way to
rename the static library from libexample.so to
example.cpython-36m-x86_64-linux-gnu.so within the meson build system.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4677 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AM7F6xDAzzIZU52D-OvbSpW9EEcO_vIcks5u86PFgaJpZM4ZhXbI>
.
|
After some research I found the following
|
I know it's been a while since this closed, but @richardgedwards do you have an example repo with how you set everything up to work? Thanks! |
since pybind is header-only, all you need is include_dir
|
The pybind11 website indicates that to compile with pybind11 one should issue the following:
c++ -O3 -Wall -shared -std=c++11 -fPIC
python3 -m pybind11 --includes
example.cpp -o examplepython3-config --extension-suffix
How would one get this from the meson-build system?
The text was updated successfully, but these errors were encountered: