Use CBindingGen to conveniently generate bindings to the SEAL C functions#20
Use CBindingGen to conveniently generate bindings to the SEAL C functions#20
Conversation
Pull Request Test Coverage Report for Build 627256776
💛 - Coveralls |
|
@sloede I am still awaiting the Julia registry curators to register the package (https://github.com/analytech-solutions/C.jl), but I got this working against a near-zero-effort experimental branch of it (https://github.com/krrutkow/C.jl/tree/cxx-experiment). Here is the branch demonstrating it working (https://github.com/krrutkow/SEAL.jl/tree/use-cjl). C.jl is still very bleeding edge for platforms other than 64-bit Mac/Linux and in Julia 1.5 (1.6 seems stellar though), but it is the replacement for the CBinding*.jl packages. Example of the new bindings placed directly into module libsealc
# ⋮
cxx`-std=c++17 $(clang_args) -L$(dirname(SEAL_jll.get_libsealc_path())) -lsealc`
# ⋮
cxx"""
#include <seal/c/defines.h>
#include <seal/c/batchencoder.h>
#include <seal/c/sealcontext.h>
// ⋮
#include <seal/c/valcheck.h>
#include <seal/c/version.h>
"""j
end |
|
@krrutkow This is great news! I am looking forward to seeing your new package in action! In |
|
It is possible to store the generated code to file by writing the expression returned by cxx`...`
@static if hasDep
cxx"#include <dep/header.h>"s
else
cxx"#include <mock-dep/header.h>"s
end
cxx"""
#include <mylib/header.h>
""" |
This is still WIP as it does not fully work yet. The main problem is that the SEAL C headers also include C++ code and thus need to be parsed as C++, which currently seems to prevent
CBindingGenfrom working (see related: analytech-solutions/CBindingGen.jl#27)