I’m trying to wrap this this GraphBLAS.h file using Clang.jl (There is already a wrapper package, but I want to try generating it automatically). I used this code:
const z = "/usr/lib/clang/9.0.0/include" const y = "/home/Wimmerer/Desktop/GraphBLAS-3.1.1/Include/GraphBLAS.h" wc = init(;headers= [y], output_file=joinpath(@__DIR__,"libGB_api.jl"),common_file = joinpath(@__DIR__,"libGB_common.jl"),clang_includes = vcat([y],[z]), header_wrapped = (root,current)->root == current,header_library = x->"libGB",clang_diagnostics = true) run(wc)
Unfortunately while I get most ordinary functions wrapped I do have quite a few warnings and missing bits. In particular I get:
┌ Warning: not wrapping CLCursor (CLLastPreprocessing) stdio.h └ @ Clang ~/.julia/packages/Clang/CiPzM/src/wrap_c.jl:443
for all the standard libs required by GraphBLAS: errno, string, stdlib, stdbool, stdint, inttypes, stddef, limits, math, stdarg
┌ Warning: not wrapping CLCursor (CLMacroInstantiation) bool └ @ Clang ~/.julia/packages/Clang/CiPzM/src/wrap_c.jl:443
Repeated many times for bool, as well as
┌ Warning: not wrapping CLCursor (CLVarDecl) GrB_BOOL └ @ Clang ~/.julia/packages/Clang/CiPzM/src/wrap_c.jl:443
for everything under the
extern keyword in the .h file.
I’m not well versed enough in C programming and linking to external libraries to diagnose these issues myself unfortunately. I would appreciate any pointers here!
The Clang.jl docs have a great example, but not much to go off of if it doesn’t map well to my particular problems.