Hello, I met this error when building glow from master:
[54/175] Building CXX object lib/Backends/CPU/CMakeFiles/CPUBackend.dir/BundleSaver.cpp.o
FAILED: lib/Backends/CPU/CMakeFiles/CPUBackend.dir/GlowJIT.cpp.o
/Applications/Xcode_9.3.0_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DGLOW_WITH_CPU=1 -DGLOW_WITH_OPENCL=1 -I/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/include -Iinclude -I. -I/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/thirdparty/fp16/include -isystem /usr/local/opt/llvm/include -Wall -Wnon-virtual-dtor -fno-exceptions -fno-rtti -g -fno-omit-frame-pointer -O0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++14 -MD -MT lib/Backends/CPU/CMakeFiles/CPUBackend.dir/GlowJIT.cpp.o -MF lib/Backends/CPU/CMakeFiles/CPUBackend.dir/GlowJIT.cpp.o.d -o lib/Backends/CPU/CMakeFiles/CPUBackend.dir/GlowJIT.cpp.o -c /Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/lib/Backends/CPU/GlowJIT.cpp
/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/lib/Backends/CPU/GlowJIT.cpp:94:7: error: no matching constructor for initialization of 'llvm::orc::ExecutionSession'
ES_(SSP_),
^ ~~
/usr/local/opt/llvm/include/llvm/ExecutionEngine/Orc/Core.h:735:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'llvm::orc::SymbolStringPool' to 'const llvm::orc::ExecutionSession' for 1st argument
class ExecutionSession : public ExecutionSessionBase {
^
/usr/local/opt/llvm/include/llvm/ExecutionEngine/Orc/Core.h:745:3: note: candidate constructor not viable: no known conversion from 'llvm::orc::SymbolStringPool' to 'std::shared_ptr
ExecutionSession(std::shared_ptr
^
/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/lib/Backends/CPU/GlowJIT.cpp:95:17: error: no matching function for call to 'createLegacyLookupResolver'
resolver_(createLegacyLookupResolver(
^~~~~~~~
/usr/local/opt/llvm/include/llvm/ExecutionEngine/Orc/Legacy.h:202:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
createLegacyLookupResolver(ExecutionSession &ES, LegacyLookupFn LegacyLookup,
^
2 errors generated.
[55/175] Building CXX object lib/Backends/CPU/CMakeFiles/CPUBackend.dir/DebugInfo.cpp.o
FAILED: lib/Backends/CPU/CMakeFiles/CPUBackend.dir/BundleSaver.cpp.o
/Applications/Xcode_9.3.0_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DGLOW_WITH_CPU=1 -DGLOW_WITH_OPENCL=1 -I/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/include -Iinclude -I. -I/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/thirdparty/fp16/include -isystem /usr/local/opt/llvm/include -Wall -Wnon-virtual-dtor -fno-exceptions -fno-rtti -g -fno-omit-frame-pointer -O0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++14 -MD -MT lib/Backends/CPU/CMakeFiles/CPUBackend.dir/BundleSaver.cpp.o -MF lib/Backends/CPU/CMakeFiles/CPUBackend.dir/BundleSaver.cpp.o.d -o lib/Backends/CPU/CMakeFiles/CPUBackend.dir/BundleSaver.cpp.o -c /Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/lib/Backends/CPU/BundleSaver.cpp
/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/lib/Backends/CPU/BundleSaver.cpp:161:78: error: too few arguments to function call, expected at least 4, have 3
PM, outputFile, llvm::TargetMachine::CodeGenFileType::CGFT_ObjectFile);
^
/usr/local/opt/llvm/include/llvm/Target/TargetMachine.h:260:3: note: 'addPassesToEmitFile' declared here
virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &,
^
1 error generated.
[60/175] Building CXX object lib/Backends/CPU/CMakeFiles/CPUBackend.dir/Pipeline.cpp.o
FAILED: lib/Backends/CPU/CMakeFiles/CPUBackend.dir/LLVMIRGen.cpp.o
/Applications/Xcode_9.3.0_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DGLOW_WITH_CPU=1 -DGLOW_WITH_OPENCL=1 -I/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/include -Iinclude -I. -I/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/thirdparty/fp16/include -isystem /usr/local/opt/llvm/include -Wall -Wnon-virtual-dtor -fno-exceptions -fno-rtti -g -fno-omit-frame-pointer -O0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++14 -MD -MT lib/Backends/CPU/CMakeFiles/CPUBackend.dir/LLVMIRGen.cpp.o -MF lib/Backends/CPU/CMakeFiles/CPUBackend.dir/LLVMIRGen.cpp.o.d -o lib/Backends/CPU/CMakeFiles/CPUBackend.dir/LLVMIRGen.cpp.o -c /Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/lib/Backends/CPU/LLVMIRGen.cpp
/Users/zrphercule/zfacebook/onnxifi_test_driver_backends/glow/lib/Backends/CPU/LLVMIRGen.cpp:299:79: error: too few arguments to function call, expected at least 4, have 3
PM, asmStream, llvm::TargetMachine::CodeGenFileType::CGFT_AssemblyFile);
^
/usr/local/opt/llvm/include/llvm/Target/TargetMachine.h:260:3: note: 'addPassesToEmitFile' declared here
virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &,
^
1 error generated.
[63/175] Building CXX object lib/Backends/CPU/CMakeFiles/CPUBackend.dir/CPUBackend.cpp.o
ninja: build stopped: subcommand failed.
I followed the tutorial in documentations, installed all libs that needed, and my command of build is
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/opt/llvm/ ../glow/
I wonder if there is anything I have missed or should do? Thanks!
Smells like wrong LLVM version used. Which one are you using? How did you install it?
@rdzhabarov I used brew install --with-toolchain llvm to install it, and the version is llvm 7.0.0
@zrphercule ah, I suspect llvm7.0 does not really work with Glow as is.
can you give a try to "/utils/build_llvm.sh" that should help to resolve a temporary issue.
We'll look at 7.0 support
or try this brew install llvm@6
I updated README, also see https://github.com/pytorch/glow/pull/1677 for LLVM7 support.
Good catch!
@rdzhabarov cool I will try it tomorrow and give some feedback, thanks!
I believe that's resolved.
Most helpful comment
I updated README, also see https://github.com/pytorch/glow/pull/1677 for LLVM7 support.
Good catch!