Libclang runtime dependencies?

What are the libclang runtime dependencies?

1. Does it depend on any LLVM library or is all included into libclang

2. What about header files and similar. Is it enough to have the system compiler installed when running a tool built with libclang

3. Anything else I've forgotten about

What are the libclang runtime dependencies?

  1. Does it depend on any LLVM library or is all included into libclang

When I build LLVM (and clang as tool inside the LLVM tree) for Linux / Mac / Windows using MinGW + MSYS
I am using this configure line:

./configure --disable-assertions --disable-debug --enable-optimized --enable-optimized --disable-threads --disable-shared

The last part: --disable-shared is the key switch, without it your libclang will depends on libLLVM.so (or something like that)
To test the build, simply run ‘ldd libclang.so’

  1. What about header files and similar. Is it enough to have the system
    compiler installed when running a tool built with libclang

For me, I only provide (lib)clang.dylib / dll / so ( choose your suffix / prefix) and its enough
code completion is working without a problem (a bit slow on Windows on a real world application and not ‘Hello World’) - but it is working properly

  1. Anything else I’ve forgotten about

If you plan on providing the binary on Linux, I suggest that you use an older g++ version to build libclang with (I am using g++4.4.1, although I could use 4.7) this will “lower” the glibc requirements and you will be able
to use the same binary on different distros

HTH,

When I build LLVM (and clang as tool inside the LLVM tree) for Linux /
Mac / Windows using MinGW + MSYS
I am using this configure line:

./configure --disable-assertions --disable-debug --enable-optimized
--enable-optimized --disable-threads --disable-shared

I was hoping to use a pre-compiled library. I'm trying to stick to releases as much as possible.

Hmm, actually, if I run "otool -L libclang.dylib" it prints:

libclang.dylib:

@rpath/libclang.dylib (compatibility version 1.0.0, current version 0.0.0)

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)

/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)

Which seems to indicate that it only depends on the C++ standard library and the C system library (or what else is in libSystem). Those dependencies are easy enough to satisfy :slight_smile:

The last part: --disable-shared is the key switch, without it your
libclang will depends on libLLVM.so (or something like that)
To test the build, simply run 'ldd libclang.so'

Ok, I see.

For me, I only provide (lib)clang.dylib / dll / so ( choose your suffix
/ prefix) and its enough
code completion is working without a problem (a bit slow on Windows on a
real world application and not 'Hello World') - but it is working properly

That's good.

If you plan on providing the binary on Linux, I suggest that you use an
older g++ version to build libclang with (I am using g++4.4.1, although
I could use 4.7) this will "lower" the glibc requirements and you will
be able
to use the same binary on different distros
HTH,

I have a virtual machine running Ubuntu 6.x just for this :slight_smile: