-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add a CI workflow for building against Eigen from source #749
base: master
Are you sure you want to change the base?
Conversation
This isn't really meant to be merged, but it's a follow up from wjakob#746 demonstrating the test failure with the current master branch of Eigen. This workflow seems to fail when run on macOS, and (as @hawkinsp suggested) I expect the issue is related to using clang instead of gcc.
That looks concerning since it affects such basic types. Let me add @WKarel as well. |
What happens if you replace the trailing return type I do not see why template <typename T2>
static handle from_cpp(T2 &&v, rv_policy policy, cleanup_list *cleanup) noexcept {
return Caster::from_cpp(std::forward<T2>(v), policy, cleanup);
} Replacing it with static handle from_cpp(T&& v, rv_policy policy, cleanup_list* cleanup) noexcept {
return Caster::from_cpp(std::move(v), policy, cleanup);
}
static handle from_cpp(const T& v, rv_policy policy, cleanup_list* cleanup) noexcept {
return Caster::from_cpp(v, policy, cleanup);
} might actually fix the issue with CLang on MacOS. |
Thanks for the suggestions, @WKarel!
I can confirm that updating the test as follows also fixes the error: - "default_arg", [](Matrix1d a, Matrix1d b) { return a + b; },
+ "default_arg", [](Matrix1d a, Matrix1d b) -> Eigen::Array<double, 1, 1> { return a + b; }, However, the error persists if
I tried updating the following lines (I think this is what you were referring to): nanobind/include/nanobind/eigen/dense.h Lines 228 to 231 in 5ead8f0
with the version you suggest, unfortunately that doesn't seem to fix the problem! |
I see. And yes, what you did is what I meant to give a try. Now I am out of ideas. So I would try to debug the problematic call, or temporarily introduce some debug output, e.g. starting with nanobind/include/nanobind/eigen/dense.h Line 230 in 5ead8f0
|
@wjakob, @WKarel — I'm so sorry about disappearing here! I'll see if I can make any progress debugging this later today or tomorrow, but in the meantime, here's what I get for that
If that immediately suggests anything to try, let me know! |
Can you run that through |
Absolutely! That prints:
|
That type meets my expectations. Does this test also fail in an unoptimized build? |
Good question and sorry for the slow response! It looks like switching to a Debug build fixes the error. |
This isn't really meant to be merged, but it's a follow up from #746 demonstrating the test failure with the current master branch of Eigen. This workflow seems to fail when run on macOS (but not on Ubuntu), and (as @hawkinsp suggested) I expect the issue is related to using clang instead of gcc.
One way to "fix" this test failure is to update this function:
nanobind/tests/test_eigen.cpp
Lines 172 to 179 in bff96e2
as follows
but I think there's probably something more complicated happening here.