Open peremato opened 1 week ago
This looks like a possible version mismatch, can you check with CxxWrap.libcxxwrapversion()
that this is using the correct libcxxwrap? Maybe also verify with Libdl.dllist()
that no wrong library gets pulled in.
Thanks for the reply. I do not see it. Everything looks fine for me (I reverted to julia 1.10 just to check):
julia> using CxxWrap
julia> CxxWrap.libcxxwrapversion()
v"0.13.2"
julia> using Libdl
julia> for l in Libdl.dllist();occursin("cxxwrap",lowercase(l)) && println(l);end
/Users/mato/.julia/compiled/v1.10/libcxxwrap_julia_jll/9VnAb_b2u6u.dylib
/Users/mato/.julia/artifacts/a733004dc3a6d098fcb468930d1084d8fea63e5e/lib/libcxxwrap_julia.0.13.2.dylib
/Users/mato/.julia/artifacts/a733004dc3a6d098fcb468930d1084d8fea63e5e/lib/libcxxwrap_julia_stl.dylib
/Users/mato/.julia/compiled/v1.10/CxxWrap/WGIJU_b2u6u.dylib
The only possibility I see is that JLCXX_HAS_RANGES
is not defined for MacOS when building the libcxxwrap_julia_jll
. See https://github.com/JuliaInterop/libcxxwrap-julia/blob/587f9feb6b64baa512856af2d508fec1f63583bc/include/jlcxx/stl.hpp#L175
The problem is that for MacOS the compiler used is clang++ and does not support <ranges>
therefore the define JLCXX_HAS_RANGES
is false.
# /opt/bin/aarch64-apple-darwin20-libgfortran5-cxx11-julia_version+1.10.0/aarch64-apple-darwin20-clang++ -std=c++20 a.cpp
a.cpp:2:10: fatal error: 'ranges' file not found
2 | #include <ranges>
| ^~~~~~~~
1 error generated.
Perhaps @giordano has an idea on how this can be overcome.
ranges
may require a much newer SDK (13?): https://github.com/JuliaPackaging/Yggdrasil/pull/8613#discussion_r1590110545
Ah yes, good catch, it is because of the #ifdef JLCXX_HAS_RANGES
. Easiest solution I can think of is to expose a jlcxx_has_ranges
function from libcxxwrap-julia and use that as a condition to use StdFill
on the Julia side in CxxWrap. Upgrading the SDK on Yggdrasil is not enough I seem to remember, we need to upgrade the compiler itself.
I am trying to re-generate the wrappers for XRootD.jl with version v0.16.0 of CxxWrap and version v0.13.2 of libcxxwrap_julia_jll. I can build successfully the wrapper library, but when initialising I get the error:
Any idea of what could be the problem? Thanks.