Open francescopt opened 6 years ago
With latest OpenMP runtime, you cannot configure the OpenMP/runtime directory, but must configure the OpenMP directory. We will need to update the readme. Just create the build directory in the openmp directory and proceed as described.
Thanks. In the next step, upon configuring archer I got another error message from CMake:
-- LLVM llvm-config found at: /usr/lib/llvm/5/bin/llvm-config
CMake Error at CMakeLists.txt:102 (include):
include could not find load file:
LLVMConfig
CMake Error at CMakeLists.txt:103 (include):
include could not find load file:
HandleLLVMOptions
CMake Error at CMakeLists.txt:104 (include):
include could not find load file:
AddLLVM
Actually, in my installation (Gentoo), LLVMConfig.cmake
, HandleLLVMOptions.cmake
, and AddLLVM.cmake
are located in /usr/lib/llvm/5/lib64/cmake/llvm/ whereas CMake is searching them in /usr/lib/llvm/5/lib/cmake/llvm/. So I modified line 100 of CMakeLists.txt as
# Incorporate the CMake features provided by LLVM:
- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LLVM_ROOT}/lib/cmake/llvm")
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LLVM_ROOT}/lib64/cmake/llvm")
include(LLVMConfig)
include(HandleLLVMOptions)
This makes the CMake works, but then the compilation fails:
$ ninja -j8 -l8
[14/15] Building CXX object lib/CMakeFiles/LLVMArcher.dir/Transforms/Instrumentation/InstrumentParallel.cpp.o
FAILED: lib/CMakeFiles/LLVMArcher.dir/Transforms/Instrumentation/InstrumentParallel.cpp.o
/usr/lib/llvm/5/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_VERSION=50 -DLLVM_VERSION="50 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/lib64/llvm/5/include -I/XXXXXX/archer_openmp/include -I../include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -w -fcolor-diagnostics -ffunction-sections -fdata-sections -fPIC -fno-exceptions -fno-rtti -MD -MT lib/CMakeFiles/LLVMArcher.dir/Transforms/Instrumentation/InstrumentParallel.cpp.o -MF lib/CMakeFiles/LLVMArcher.dir/Transforms/Instrumentation/InstrumentParallel.cpp.o.d -o lib/CMakeFiles/LLVMArcher.dir/Transforms/Instrumentation/InstrumentParallel.cpp.o -c ../lib/Transforms/Instrumentation/InstrumentParallel.cpp
../lib/Transforms/Instrumentation/InstrumentParallel.cpp:269:15: error: no member named 'ArgumentListType' in 'llvm::Function'
Function::ArgumentListType::iterator it = F.getArgumentList().begin();
~~~~~~~~~~^
../lib/Transforms/Instrumentation/InstrumentParallel.cpp:269:49: error: no member named 'getArgumentList' in 'llvm::Function'
Function::ArgumentListType::iterator it = F.getArgumentList().begin();
~ ^
../lib/Transforms/Instrumentation/InstrumentParallel.cpp:270:15: error: no member named 'ArgumentListType' in 'llvm::Function'
Function::ArgumentListType::iterator end = F.getArgumentList().end();
~~~~~~~~~~^
../lib/Transforms/Instrumentation/InstrumentParallel.cpp:270:42: error: use of undeclared identifier 'end'; did you mean 'std::end'?
Function::ArgumentListType::iterator end = F.getArgumentList().end();
^~~
std::end
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include/g++-v6/initializer_list:99:5: note: 'std::end' declared here
end(initializer_list<_Tp> __ils) noexcept
^
../lib/Transforms/Instrumentation/InstrumentParallel.cpp:272:18: error: use of undeclared identifier 'end'; did you mean 'std::end'?
while (it != end) {
^~~
std::end
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include/g++-v6/initializer_list:99:5: note: 'std::end' declared here
end(initializer_list<_Tp> __ils) noexcept
^
In file included from ../lib/Transforms/Instrumentation/InstrumentParallel.cpp:56:
In file included from /usr/lib64/llvm/5/include/llvm/Analysis/AliasAnalysis.h:42:
In file included from /usr/lib64/llvm/5/include/llvm/Analysis/TargetLibraryInfo.h:18:
/usr/lib64/llvm/5/include/llvm/IR/Module.h:344:50: error: non-constant-expression cannot be narrowed from type 'long' to 'size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
SmallVector<Type*, sizeof...(ArgsTy)> ArgTys{Args...};
^~~~
/usr/lib64/llvm/5/include/llvm/IR/Module.h:353:12: note: in instantiation of function template specialization 'llvm::Module::getOrInsertFunction<long>' requested here
return getOrInsertFunction(Name, AttributeList{}, RetTy, Args...);
^
../lib/Transforms/Instrumentation/InstrumentParallel.cpp:184:22: note: in instantiation of function template specialization 'llvm::Module::getOrInsertFunction<long>' requested here
Constant* c = M->getOrInsertFunction("__tsan_default_suppressions",
^
/usr/lib64/llvm/5/include/llvm/IR/Module.h:344:50: note: insert an explicit cast to silence this issue
SmallVector<Type*, sizeof...(ArgsTy)> ArgTys{Args...};
^~~~
static_cast<size_t>( )
6 errors generated.
ninja: build stopped: subcommand failed.
(I anonymize the include directory archer_openmp
which points to my previous installation of openmp)
I pushed a fix to the archer repository. Please pull and try to build again
CMake for archer now works without problems, but ninja -j8 -l8
gives the same errors.
@francescopt I haven't finished my fix yet, but you could give a try to the branch "update_to_60" which is based on Clang/LLVM 6.0 (but should work with clang 5.0.1. I suggest to use the older version under release. I should merge all my changes in the next days.
Hi, I followed the instructions for a Stand-alone building, and upon running CMake I get the following error
I am using cmake 3.9.6, clang 5.0.1.