You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a Julia package to provide simple entry points to two C++ codes. In each of the two C++ codes (say codes A and B providing shared libraries libA.so and libB.so) I have written CxxWrap functions as follows:
Both libraries are built using BinaryBuilder and wrapped into Julia Packages LibA_jll.jl and LibB_jll.jl.
Both function names are different, but they share the same types of arguments and the same return type. In Julia, I am trying to expose functions A and B from these two libs as follows:
module WrapperAB
using CxxWrap
using LibA_jll
using LibB_jll
@wrapmodule () ->joinpath("", "libA")
@wrapmodule () ->joinpath("", "libB") # line WrapperAB.jl:14, see belowend
This code triggers the following error when trying to precompile the module WrapperAB:
As stupid as it may seem, the solution was quite simple. It involves encapsulating the cxx part in the module WrapperAB, as follows
module WrapperAB
module A
using CxxWrap
using LibA_jll
@wrapmodule () ->joinpath("", "libA")
function__init__()
@initcxxendendmodule B
using CxxWrap
using LibB_jll
@wrapmodule () ->joinpath("", "libB")
function__init__()
@initcxxendendend
I am writing a Julia package to provide simple entry points to two C++ codes. In each of the two C++ codes (say codes
A
andB
providing shared librarieslibA.so
andlibB.so
) I have written CxxWrap functions as follows:For library
libA.so
:For library
libB.so
Both libraries are built using BinaryBuilder and wrapped into Julia Packages
LibA_jll.jl
andLibB_jll.jl
.Both function names are different, but they share the same types of arguments and the same return type. In Julia, I am trying to expose functions A and B from these two libs as follows:
This code triggers the following error when trying to precompile the module
WrapperAB
:It seems as if functions A and B were treated as being the same and the wrapper were unable to differentiate between the two.
The text was updated successfully, but these errors were encountered: