-
Notifications
You must be signed in to change notification settings - Fork 43
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
Building against libcxxwrap-julia require definition of comparison operators between incompatible types #173
Comments
Is this against the latest libcxxwrap-julia ( libcxxwrap-julia/include/jlcxx/stl.hpp Line 657 in 587f9fe
|
It happens both against |
OK, if you don't need sets or maps then you can comment out these lines in |
Thank you for the hint! I did a couple of other tests, and it seems that the check you mentioned before does work in most of the cases, but it gets "confused" when the type to which the STL is applied is itself a kind of "container". What I have observed is the following: I have my wrapped type jlcxx::stl::apply_stl<DA>(mod) Then I have the parametric type mod.add_type<jlcxx::Parametric<jlcxx::TypeVar<1>>>("AlgebraicMatrix", jlcxx::julia_type("AbstractMatrix", "Base"))
.apply<AlgebraicMatrix<DA>, AlgebraicMatrix<double>>([](auto wrapped) {
...
}); The type mod.method("hessian", [](const AlgebraicVector<DA>& vec)->std::vector<AlgebraicMatrix<DA>> { return vec.hessian(); }); Moreover, the To get a compiler error, I need both the |
Can you verify if PR #175 fixes this for you? |
I recompiled the library from your branch Tested on both Ubuntu 22.04 (gcc) and MacOS Sonoma (Apple Clang, Intel chip) Thanks! |
Thanks for testing, I'll integrate this into a new release. Unfortunately the changes are not binary compatible with previous versions, so this will become part of CxxWrap 0.17. |
I am building a Julia interface to dace using
libcxxwrap-julia
andCxxWrap
, and I recently came across a compilation error that requires me to define the "less than" operator between types for which is not defined, i.e.DACE::DA
andDACE::AlgebraicMatrix<DACE::DA>
.Here is the output I obtain when trying to build the wrapper on Ubuntu 22.04 LTS:
build.log
config.log
I started obtaining this error after defining the comparison operators
==,!=,<,>,<=,>=
betweenDACE::DA
objects anddouble
ininterfaces/cxx/include/dace/DA.h
I am also able to overcome it by adding these dummy definitions at the top of the interface
interfaces/julia/dace_julia.cxx
but this is really a workaround that shouldn't be there.
More surprisingly, I do not encounter the same error with
DACE::AlgebraicVector<DA>
, which is wrapped pretty much in the same way asDACE::AlgebraicMatrix<DA>
is. Building the library without the Julia wrapper bits also works, so it is really a matter of how it interacts withlibcxxwrap-julia
.Do you have any insight on the root cause of this error? Thanks!
The text was updated successfully, but these errors were encountered: