-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
compiler:codegenGeneration of LLVM IR and native codeGeneration of LLVM IR and native code
Description
It seems there are some bumps in writing code that issues ccalls conditionally on the availability of a C library, see https://groups.google.com/forum/?fromgroups=#!topic/julia-users/O2lBbCaJ99w
The solution worked out there seem likely to be fragile with respect to improvements in inlining. The following seems safe:
const libfrobozz = find_library("libfrobozz")
const have_frobozz = !isempty(libfrobozz)
function somefunction()
if have_frobozz
eval(:(ccall((:somefunction, $libfrobozz), rettype, argtypes, args...))
else
# do something else
end
endBut that also seems a bit undesirable. Is there a better way?
Metadata
Metadata
Assignees
Labels
compiler:codegenGeneration of LLVM IR and native codeGeneration of LLVM IR and native code