2015-04-20 2 views
3

Я работаю над учебником Kaleidoscope для LLVM и у вас бесконечные проблемы с его компиляцией. В следующем учебном пособии показано, что для llvm-config флаг «-system-libs» не существует (он просто распечатывает блок использования). Я попытался оставить его, но это похоже на кроличью дыру от ошибок компоновщика, что заставляет меня поверить, что я просто настроил свою среду разработки совершенно неправильно. Я пробовал это как на OSX Yosemite, так и на Ubuntu с аналогичными результатами. Не найденную ошибку можно разрешить, добавив -I [путь к llvm], однако это просто показывает больше ошибок, заставляя меня думать, что это неправильный подход.Учебник LLVM --system-libs не существует

http://llvm.org/releases/3.6.0/docs/tutorial/LangImpl3.html

$make 
#clang++ -g -v -L -std=c++11 -O3 toy.cpp -I/usr/include/llvm-3.5/ `llvm-config --cxxflags --ldflags --libs all` -o toy 
clang++ -g -O3 toy.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core` -o toy 
usage: llvm-config <OPTION>... [<COMPONENT>...] 

Get various configuration information needed to compile programs which use 
LLVM. Typically called from 'configure' scripts. Examples: 
    llvm-config --cxxflags 
    llvm-config --ldflags 
    llvm-config --libs engine bcreader scalaropts 

Options: 
    --version   Print LLVM version. 
    --prefix   Print the installation prefix. 
    --src-root  Print the source root LLVM was built from. 
    --obj-root  Print the object root used to build LLVM. 
    --bindir   Directory containing LLVM executables. 
    --includedir  Directory containing LLVM headers. 
    --libdir   Directory containing LLVM libraries. 
    --cppflags  C preprocessor flags for files that include LLVM headers. 
    --cflags   C compiler flags for files that include LLVM headers. 
    --cxxflags  C++ compiler flags for files that include LLVM headers. 
    --ldflags   Print Linker flags. 
    --libs   Libraries needed to link against LLVM components. 
    --libnames  Bare library names for in-tree builds. 
    --libfiles  Fully qualified library filenames for makefile depends. 
    --components  List of all possible components. 
    --targets-built List of all targets currently built. 
    --host-target  Target triple used to configure LLVM. 
    --build-mode  Print build mode of LLVM tree (e.g. Debug or Release). 
Typical components: 
    all    All LLVM libraries (default). 
    engine   Either a native JIT or a bitcode interpreter. 
toy.cpp:1:10: fatal error: 'llvm/IR/Verifier.h' file not found 
#include "llvm/IR/Verifier.h" 
     ^
1 error generated. 
make: *** [parser] Error 1 

ответ

2

Оказывается версии LLVM-конфигурации я использую это устареет. На Ubuntu я могу только apt-get install llvm-config-3.6, а на OSX я могу сделать brew install homebrew/versions/llvm36. Наконец, используйте llvm-config-3.6 вместо llvm-config.

Смежные вопросы