vuo-compile vs Clang/LLVM versions

Hi folks,

I’ve been reading about Developing a Library Module, from which I learned that

If your library module is written in another language, you can compile it with Clang.

If I follow those instructions using the Clang supplied by Apple’s XCode Command-Line Tools (Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x86_64-apple-darwin18.7.0), my composition won’t run, and I find the following error in the Console:

loadModule():1763 Error: Couldn’t parse module ‘my.test_lib.bc’: Unknown bitstream version!.

As far as I can tell by inspecting the LLVM source code, this is about the MODULE_CODE_VERSION record in the bitcode file. But according to the historical documentation, the last time a new bitstream version was introduced was between LLVM 4.0.1 and LLVM 5.0.

I can’t find any command-line switches to tell Clang to emit earlier versions of bitcode, which is unsurprising because LLVM documentation does warn that bitcode is not intended to be used as a storage format or expected to be compatible between compiler releases.

Is vuo-compile really still based on a Clang/LLVM from 2017? What’s the best way to discover which version it was built with?


Hi, George. Great that you’re delving into the deeper parts of the API.

In fact, Vuo’s LLVM version is even older than that: LLVM 3.3. (You can see the versions of all of Vuo’s dependencies here: vuo/ at main · vuo/vuo · GitHub .)

You can use the clang executable bundled with Vuo to compile your library module to compatible bitcode —

Updating LLVM is on my to-do list for the next few months. We had been postponing the update so that we could prioritize features that provide a more tangible benefit to the community. However, it’s getting to the point where we do need to update LLVM to help with other features, so it’s now a high priority.