Open michaeldauria opened 8 years ago
Try building LLVM like so:
brew uninstall llvm; brew install llvm \
--with-all-targets \
--with-python \
--with-shared-libs
And then, this will probably be needed
( \
X="$(brew --prefix llvm)"; \
env PATH="$X/bin:$PATH" \
DYLD_LIBRARY_PATH="$X/lib" \
ruby your_ffi_gen_script.rb \
)
brew link llvm
or it will break Xcode and your systemHere's an example which works:
brew install nanomsg
( \
X="$(brew --prefix llvm)"; \
env PATH="$X/bin:$PATH" \
DYLD_LIBRARY_PATH="$X/lib" \
ruby -rffi_gen <<FFI_GEN_SCRIPT
inc = "#{\`brew --prefix nanomsg\`.chop}/include/"
FFIGen.generate(
module_name: "Nanomsg",
ffi_lib: "nanomsg",
headers: Dir[inc+"**/*.h"].map {|x| x[inc.size..-1] },
cflags: \`llvm-config --cflags\`.split(" "),
prefixes: ["nanomsg", "NN_", "nn_"],
output: "nanomsg.rb",
)
FFI_GEN_SCRIPT
)
I'm having trouble getting started using this tool on OSX:
I have installed
llvm
via:brew install llvm --with-clang
on El Capitan, what am I missing?