[LLVMdev] LLVM Cmake module?
Eli Gottlieb
eligottlieb at gmail.com
Wed Nov 3 20:04:40 PDT 2010
Oh, and I've definitely configured CMake to compile everything as C.
project(jllvm C)
On 11/03/2010 10:56 PM, Eli Gottlieb wrote:
> After I actually get everything compiling, install the library, and
> load it from my Java program, I get the following:
>> Exception in thread "main" java.lang.UnsatisfiedLinkError:
>> /usr/lib/libjllvm.so: /usr/lib/libjllvm.so: undefined symbol:
>> _ZTVN10__cxxabiv120__si_class_type_infoE
> If I have to guess, this means that the CMake stuff given is linking
> to the C++ libraries of LLVM when I wanted them linking to the C
> bindings. Any ideas? I definitely included the headers for the C
> bindings only.
> On 11/03/2010 03:30 PM, Óscar Fuentes wrote:
>> Eli Gottlieb<eligottlieb at gmail.com> writes:
>>
>>> I compiled and installed it to the prefix /usr, but that's not the
>>> issue. Once I actually compile and install LLVM with CMake by hand, I
>>> get the share/llvm/cmake stuff installed correctly (can those files be
>>> included in "normal" builds, or will LLVM switch to CMake as its
>>> primary build system?). Now I'm running into the problem of cflags or
>>> includes or something not being set properly.
>> [snip]
>>
>>>> [ 9%] Building C object CMakeFiles/jllvm.dir/Analysis_wrap.c.o
>>>> In file included from /usr/include/llvm-c/Core.h:36,
>>>> from /usr/include/llvm-c/Analysis.h:22,
>>>> from
>>>> /home/eli/Programs/decac/src/jllvm/llvm/Analysis_wrap.c:190:
>>>> /usr/include/llvm/System/DataTypes.h:46: error: #error "Must #define
>>>> __STDC_LIMIT_MACROS before #including System/DataTypes.h"
>>>> /usr/include/llvm/System/DataTypes.h:50: error: #error "Must #define
>>>> __STDC_CONSTANT_MACROS before " "#including System/DataTypes.h"
>>>> make[2]: *** [CMakeFiles/jllvm.dir/Analysis_wrap.c.o] Error 1
>>>> make[1]: *** [CMakeFiles/jllvm.dir/all] Error 2
>>>> make: *** [all] Error 2
>> Yes, you must define __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS on
>> your CMakeLists.txt. Put this before any add_executable/add_library that
>> contains source files that uses LLVM stuff:
>>
>> add_definitions( -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS )
>
More information about the llvm-dev
mailing list