Using a binary dependency statically linked to LLVM


#1

I’m trying to use a C library that is linked to LLVM static libraries in Julia. I’m using BinDeps and Conda to download the C library, but I get the following error when building the Julia package

julia> Pkg.build("SymEngine")
INFO: Building Conda
INFO: Building SymEngine
: CommandLine Error: Option 'debug-pass' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

If I use the C library without LLVM support it works fine. (LLVM is an optional dependency of the C library, so I can remove the LLVM dependency. I’m not using any functionality that needs LLVM from the C library, so my current workaround is to use a binary of the C library that is compiled without LLVM support)

Is there anything that I can change in the C library so that it doesn’t affect Julia? Any suggestions welcome.


#2

Are you sure that llvm is linked statically? This error normally appears when LLVM is linked dynamically and then collides with the LLVM julia uses.

Links:


#3

Yes, I’m sure. LLVM installation had only static libraries and ldd on the C library doesn’t show any LLVM libraries.

isuru@isuru:~/projects/SymEngine.jl$ ldd /home/isuru/miniconda3_2/lib/libsymengine.so
        linux-vdso.so.1 =>  (0x00007ffc143fe000)
        libgmp.so.10 => /home/isuru/miniconda3_2/lib/./libgmp.so.10 (0x00007f4a56359000)
        libmpc.so.3 => /home/isuru/miniconda3_2/lib/./libmpc.so.3 (0x00007f4a56141000)
        libmpfr.so.4 => /home/isuru/miniconda3_2/lib/./libmpfr.so.4 (0x00007f4a55ee2000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4a55c9f000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4a55a9a000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4a5587d000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4a554fb000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4a551f1000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4a54fdb000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4a54c12000)
        /lib64/ld-linux-x86-64.so.2 (0x00005593ddfbe000)