-
Notifications
You must be signed in to change notification settings - Fork 32
Bind to Python with pybind11 #96
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #96 +/- ##
=======================================
Coverage 49.46% 49.46%
=======================================
Files 77 77
Lines 1785 1785
=======================================
Hits 883 883
Misses 902 902
Continue to review full report at Codecov.
|
gives the following error |
|
Yeah, you need to have pybind11 installed. I still have to set up the
superbuild.
…On Tue, Oct 29, 2019, 08:58 Stig Rune Jensen ***@***.***> wrote:
./setup --pybindings
gives the following error
CMake Error at python/CMakeLists.txt:8 (find_package):
Could not find a package configuration file provided by "pybind11"
(requested version 2.3.0) with any of the following names:
pybind11Config.cmake
pybind11-config.cmake
Add the installation prefix of "pybind11" to CMAKE_PREFIX_PATH or set
"pybind11_DIR" to a directory containing one of the above files. If
"pybind11" provides a separate development package or SDK, be sure it has
been installed.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#96?email_source=notifications&email_token=AA4JOEMBJAQ6NAHJITXH74TQQ7UIXA5CNFSM4JFNDZWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECPSC2Q#issuecomment-547299690>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4JOEKSKYB34PJD33EOJLDQQ7UIXANCNFSM4JFNDZWA>
.
|
This bumps CMake version requirement up to 3.11
|
|
Ehm... It works on Travis 🤷♂️ Where are you trying to build? |
|
...sorry, I read "what"... I'm building on my Ubuntu |
|
I cannot reproduce it. Can you try to |
|
I'm able to run the command in Is this the same command |
|
I don't think it's the exact same, but something similar. |
|
Googling turned this one up: https://github.com/ruslo/hunter/issues/972#issuecomment-323687499 |
|
Argh, the annoyance |
|
Gentle nudge here. It'd be good to get this merged so I can move on with conda packaging and redoing the Fortran interface with |
|
I will review today ... |
|
Thanks 🐙 |
bast
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thumbs up from me but before we merge we need Andre and Christoph to comment since they depend most on the SWIG interface which would be removed by this merge.
I also agree that we target a v2.0.0 with this merge but would like if we test it a bit first. In other words this would be v2.0.0-beta or v2.0.0-rc.
|
Sorry, was busy / travelling the last two weeks. I will try to test over the weekend. |
|
Yes, this should be a beta release. We can do rc when the Fortran bindings are refurbished. |
|
|
||
| m.def("xcfun_version", &xcfun_version, "XCFun version"); | ||
| m.def("xcfun_splash", &xcfun_splash, "XCFun splash screen"); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add
m.def("xcfun_test", &xcfun_test, "XCFun self test");
We are calling xcfun_test from the PyADF test suite to make sure xcfun is working correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. Good catch! pybind11 won't generate binding code unless you explicitly define the function/class to be bound.
chjacob-tubs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, except for my comment everything is working fine in PyADF.
|
It works on my Mac, but I somehow dont get it to work on Ubuntu. Setup now fails with Any idea what the problem might be? |
|
Yes, I made a silly CMake mistake. Should be fixed in the latest commit. |
|
OK, now it works! (One minor issue: It seems that CMake does not discover the system-installed pybind11 but always downloads and builds itself. Thats fine for me, I actually dont know how / where CMake is looking for pybind11) |
|
How was pybind11 installed? I can look at this later next week. |
|
On Ubuntu both with apt-get and with pip, an the Mac with macports |
|
The PyPI package does not install the CMake support files. The package from |
|
OK, I got it to work, I guess that was the problem. |
|
Should we merge this now? How are you handling this / who is pushing the button? |
|
Sorry, should have been clearer. I wanted to give @aspgomes one more week for comments, then anyone with write access can push the button (I usually prefer not to self-merge) |
Description
I've redone the Python bindings using pybind11. The bindings are now more transparent and easier to read/extend than the SWIG bindings were.
If pybind11 is not around, it will be fetched. This trick requires use of CMake 3.11 at least.
Types of changes
Questions
master?Status