"Hello、World" LLVMパスを作成するためのチュートリアルhereを実行しようとしています - このチュートリアルでリンクされているガイドラインhereを使用していますディレクトリ。しかし、このチュートリアルに従おうとすると、CMakeはLLVM自体の内部で多くのエラーを報告します。次のCMakeを使用してパスチュートリアルを実行すると内部LLVM構文エラーが発生する
私は次のディレクトリ構造を持っている:
HelloWorld/ CMakeLists.txt HelloWorld/ CMakeLists.txt HelloWorld.cpp
マイHelloWorld.cpp
、および2 CMakeLists.txt
はコピーであり、上記にリンクされているチュートリアルから直接貼り付けました。
私はを実行し、CMake設定を正常に生成します。しかし、私はmake
を実行します。 LLVMコードベース自体から多数のエラーが報告されています。
[ 50%] Building CXX object CMakeFiles/LLVMPassName.dir/Vectorize.cpp.o
In file included from /Volumes/andromeda/HelloWorld/HelloWorld.cpp:1:
In file included from /usr/local/Cellar/llvm/3.6.2/include/llvm/Pass.h:377:
In file included from /usr/local/Cellar/llvm/3.6.2/include/llvm/PassSupport.h:27:
In file included from /usr/local/Cellar/llvm/3.6.2/include/llvm/PassRegistry.h:20:
In file included from /usr/local/Cellar/llvm/3.6.2/include/llvm-c/Core.h:18:
In file included from /usr/local/Cellar/llvm/3.6.2/include/llvm-c/Support.h:17:
/usr/local/Cellar/llvm/3.6.2/include/llvm/Support/DataTypes.h:57:3: error: "Must #define
__STDC_LIMIT_MACROS before #including Support/DataTypes.h"
# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
^
/usr/local/Cellar/llvm/3.6.2/include/llvm/Support/DataTypes.h:61:3: error: "Must #define
__STDC_CONSTANT_MACROS before " "#including Support/DataTypes.h"
# error "Must #define __STDC_CONSTANT_MACROS before " \
リストは延々と続く、それらのすべては、LLVMのヘッダファイルのエラーを参照してください。これはHomebrewを使用したLLVMのクリーンインストールです。作業にリンクするには、CPLUS_INCLUDE_PATH
をLLVMのホームブリューインクルードディレクトリに設定しなければなりませんでした。
私が最初に考えたのはcmakeのは、別のコンパイラ(GCCまたはその逆対クラン)を使用しようとしますが、どちらか私のclang
またはg++
インストール助けにはならなかったを指すようにCMAKE_CXX_COMPILER
を設定したということでした。
ここで問題が発生する可能性のある人はいますか?
コメントの中で@oakが提供するリンクをたどった後、私は最初の2つのサポート/データタイプのエラーを取り除くことができました。しかし、まだ多くの誤りが残っています。
In file included from /usr/local/Cellar/llvm/3.6.2/include/llvm/Pass.h:377:
In file included from /usr/local/Cellar/llvm/3.6.2/include/llvm/PassSupport.h:27:
In file included from /usr/local/Cellar/llvm/3.6.2/include/llvm/PassRegistry.h:21:
/usr/local/Cellar/llvm/3.6.2/include/llvm/ADT/DenseMap.h:543:63: error: a space is required
between consecutive right angle brackets (use '> >')
typename BucketT = detail::DenseMapPair<KeyT, ValueT>>
^
/usr/local/Cellar/llvm/3.6.2/include/llvm/ADT/DenseMap.h:694:63: error: a space is required
between consecutive right angle brackets (use '> >')
typename BucketT = detail::DenseMapPair<KeyT, ValueT>>
#error "#including Support/DataTypes.hの前に#define \ _ \ _ STDC \ _LIMIT \ _MACROSを指定する必要があります"](http://stackoverflow.com/questions/18965870/error-must-define- hd) – Oak
CMake経由でコマンドライン引数を渡す方法はありますか?私は、CMake(または結果として得られるMakefile)にこれらをビルドプロセスに組み込むことに失敗した。 –
[add_definitions](https://cmake.org/cmake/help/v3.0/command/add_definitions.html) – user3159253