fix julia_type<void>#178
Conversation
fixes #463
|
Type libcxxwrap-julia/src/jlcxx.cpp Line 397 in dd11c21 So the first thing to find out is why this fails in your setup. With regards to this PR, the error on e.g. Ubuntu is: So there is a syntax error. But adding a separate |
ah right, that is a typo sorry
yeah, that's weird. i even tried calling one annotation: we are using bazel as build system, and due to a symbol conflict between Julia's LLVM and our LLVM, we only export some C-API symbols marked manually. AFAIK only |
|
okay, so i run this inside the function definining the module std::cout << "has_julia_type<void>() = " << jlcxx::has_julia_type<void>() << std::endl;
jlcxx::register_core_types();
jlcxx::register_core_cxxwrap_types();
std::cout << "has_julia_type<void>() = " << jlcxx::has_julia_type<void>() << std::endl;and it returns this during Julia precompilation checking if i take the inner code from ..., and i put it in my code... jlcxx::set_julia_type<void>((jl_datatype_t*)jlcxx::julia_type("Cvoid", jl_base_module),false);
jlcxx::set_julia_type<void*>(jl_voidpointer_type,false);
jlcxx::set_julia_type<float>(jl_float32_type,false);
jlcxx::set_julia_type<double>(jl_float64_type,false);
jlcxx::set_julia_type<jl_datatype_t*>(jl_any_type,false);
jlcxx::set_julia_type<jl_value_t*>(jl_any_type,false);
std::cout << "has_julia_type<void>() = " << jlcxx::has_julia_type<void>() << std::endl;i get |
|
I am not able to reproduce this, what kind of system are you running all this on, exactly? |
|
i managed to reproduce the error with a MWE and packaged everything here https://github.com/mofeing/ReproducerCxxWrapVoidBug if you activate the package's env and call AFAIK only the julia module defining function is tldr: the problem is that we are filtering all symbols by default except some in a passlist, and the C++ symbols are not exported. i'm closing because my problem is solved, but might be good to record this somewhere in the docs? |
|
so my problem was symbol visibility. due to some symbol conflict we had on macOS between a build of LLVM included in our lib and Julia's lib, we were hiding symbols by default and only exporting some symbols from our own C-API. i also exported the C-API of libcxxwrap_julia, but it seemed to not be enough. the solution was to export all symbols by default and just hide the llvm symbols. probably you also need to export the C++ symbols of libcxxwrap. why it doesn't crash in a more obvious (like "hey, this symbol is missing") is out of my knowledge but symbol conflicts and visibility are hard to debug. |
fixes JuliaInterop/CxxWrap.jl#463
the erroring tests seem to be unrelated to the changed code