Error when running "ninja all" to build glow

Wilbur: <p>My Linux version is Ubuntu 18.04.</p>
<p>I followed a solution in this <a href="https://discuss.pytorch.org/t/error-when-ninja-all-is-run/116957/6">post</a> to avoid the “bundle error”. (In fact, I also encountered that error if I didn’t delete the line “bundle_with_multiple_entries”)</p>
<p>Then I ran the following command to generate the build config:</p>
<pre><code class="lang-auto">cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DGLOW_WITH_BUNDLES=ON -DLLVM_DIR=/usr/lib/llvm-7/cmake/ -DCMAKE_C_COMPILER=/usr/lib/llvm-7/bin/clang -DCMAKE_CXX_COMPILER=/usr/lib/llvm-7/bin/clang++ -DLLVM_CONFIG=/usr/lib/llvm-7/bin/llvm-config ../glow
</code></pre>
<p>After that, I ran “ninja all” to build, but I encountered the following error:</p>
<pre><code class="lang-auto">2021-05-24 21:55:25 (9.48 MB/s) - ‘/home/user/build_Release/examples/bundles/resnet50/resnet50/init_net.pb’ saved [128070759/128070759]

[670/724] Generating profile.yml
FAILED: examples/bundles/lenet_mnist/profile.yml 
cd /home/user/build_Release/examples/bundles/lenet_mnist &amp;&amp; /home/user/build_Release/bin/image-classifier /home/user/glow/tests/images/mnist/*.png -i=0to1 -dump-profile=/home/user/build_Release/examples/bundles/lenet_mnist/profile.yml -m=/home/user/build_Release/examples/bundles/lenet_mnist/lenet_mnist -model-input-name=data
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0524 21:57:25.627862 24050 Partitioner.cpp:693] Profiling a model to be partitioned cross different backends. Each sub-network will be optimized and run on cpu backend.
LLVMIRGen: libjit.bc: error: Unknown attribute kind (60) (Producer: 'LLVM9.0.1' Reader: 'LLVM 7.1.0')
F0524 21:57:25.651914 24054 LLVMIRGen.cpp:216] Check failed: llmodule_.get() Unable to load the JIT library.
*** Check failure stack trace: ***
#0 0x0000000000ac799e llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;) (/home/user/build_Release/bin/image-classifier+0xac799e)
#1 0x0000000000ac5ea1 llvm::sys::RunSignalHandlers() (/home/user/build_Release/bin/image-classifier+0xac5ea1)
#2 0x0000000000ac7cb1 SignalHandler(int) (/home/user/build_Release/bin/image-classifier+0xac7cb1)
#3 0x00007f742018297f (/lib/x86_64-linux-gnu/libpthread.so.0+0x1297f)
#4 0x00007f741f47efb7 raise /build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007f741f480920 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:79:0
#6 0x00007f7423a891f8 (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xa1f8)
#7 0x00007f7423a8b0cc google::LogMessage::Fail() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xc0cc)
#8 0x00007f7423a8cf32 google::LogMessage::SendToLog() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xdf32)
#9 0x00007f7423a8ac27 google::LogMessage::Flush() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xbc27)
#10 0x00007f7423a8d998 google::LogMessageFatal::~LogMessageFatal() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xe998)
#11 0x0000000000c17e2e glow::LLVMIRGen::initCodeGen() (/home/user/build_Release/bin/image-classifier+0xc17e2e)
#12 0x0000000000c3b2af glow::LLVMBackend::compileIRWithoutConstants(glow::IRFunction*) const (/home/user/build_Release/bin/image-classifier+0xc3b2af)
#13 0x0000000000c3bb0a glow::LLVMBackend::compile(glow::Function*, glow::BackendOptions const&amp;) const (/home/user/build_Release/bin/image-classifier+0xc3bb0a)
#14 0x00000000025d6574 std::thread::_State_impl&lt;std::thread::_Invoker&lt;std::tuple&lt;glow::Backend::compileFunctions(std::vector&lt;glow::Function*, std::allocator&lt;glow::Function*&gt; &gt;&amp;, llvm::StringMap&lt;glow::BackendOptions, llvm::MallocAllocator&gt;&amp;) const::$_0, (anonymous namespace)::PerCompilationThreadState*&gt; &gt; &gt;::_M_run() (/home/user/build_Release/bin/image-classifier+0x25d6574)
#15 0x00007f741fb066de (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xbd6de)
#16 0x00007f74201776da start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
#17 0x00007f741f56171e clone /build/glibc-S9d2JN/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95:0
Aborted (core dumped)
[687/724] Generating profile.yml
FAILED: examples/bundles/resnet50/profile.yml 
cd /home/user/build_Release/examples/bundles/resnet50 &amp;&amp; /home/user/build_Release/bin/image-classifier /home/user/glow/tests/images/imagenet/*.png -i=0to1 -dump-profile=/home/user/build_Release/examples/bundles/resnet50/profile.yml -m=/home/user/build_Release/examples/bundles/resnet50/resnet50 -model-input-name=gpu_0/data
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0524 21:57:26.608170 24047 Partitioner.cpp:693] Profiling a model to be partitioned cross different backends. Each sub-network will be optimized and run on cpu backend.
LLVMIRGen: libjit.bc: error: Unknown attribute kind (60) (Producer: 'LLVM9.0.1' Reader: 'LLVM 7.1.0')
F0524 21:57:26.623073 24058 LLVMIRGen.cpp:216] Check failed: llmodule_.get() Unable to load the JIT library.
*** Check failure stack trace: ***
#0 0x0000000000ac799e llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;) (/home/user/build_Release/bin/image-classifier+0xac799e)
#1 0x0000000000ac5ea1 llvm::sys::RunSignalHandlers() (/home/user/build_Release/bin/image-classifier+0xac5ea1)
#2 0x0000000000ac7cb1 SignalHandler(int) (/home/user/build_Release/bin/image-classifier+0xac7cb1)
#3 0x00007f012a57597f (/lib/x86_64-linux-gnu/libpthread.so.0+0x1297f)
#4 0x00007f0129871fb7 raise /build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007f0129873920 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:79:0
#6 0x00007f012de7c1f8 (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xa1f8)
#7 0x00007f012de7e0cc google::LogMessage::Fail() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xc0cc)
#8 0x00007f012de7ff32 google::LogMessage::SendToLog() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xdf32)
#9 0x00007f012de7dc27 google::LogMessage::Flush() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xbc27)
#10 0x00007f012de80998 google::LogMessageFatal::~LogMessageFatal() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xe998)
#11 0x0000000000c17e2e glow::LLVMIRGen::initCodeGen() (/home/user/build_Release/bin/image-classifier+0xc17e2e)
#12 0x0000000000c3b2af glow::LLVMBackend::compileIRWithoutConstants(glow::IRFunction*) const (/home/user/build_Release/bin/image-classifier+0xc3b2af)
#13 0x0000000000c3bb0a glow::LLVMBackend::compile(glow::Function*, glow::BackendOptions const&amp;) const (/home/user/build_Release/bin/image-classifier+0xc3bb0a)
#14 0x00000000025d6574 std::thread::_State_impl&lt;std::thread::_Invoker&lt;std::tuple&lt;glow::Backend::compileFunctions(std::vector&lt;glow::Function*, std::allocator&lt;glow::Function*&gt; &gt;&amp;, llvm::StringMap&lt;glow::BackendOptions, llvm::MallocAllocator&gt;&amp;) const::$_0, (anonymous namespace)::PerCompilationThreadState*&gt; &gt; &gt;::_M_run() (/home/user/build_Release/bin/image-classifier+0x25d6574)
#15 0x00007f0129ef96de (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xbd6de)
#16 0x00007f012a56a6da start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
#17 0x00007f012995471e clone /build/glibc-S9d2JN/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95:0
Aborted (core dumped)
[703/724] Building CXX object tests/unittests/CMakeFiles/CPUOperatorTest.dir/OperatorTest.cpp.o2021-05-24 21:55:25 (9.48 MB/s) - ‘/home/user/build_Release/examples/bundles/resnet50/resnet50/init_net.pb’ saved [128070759/128070759]

[670/724] Generating profile.yml
FAILED: examples/bundles/lenet_mnist/profile.yml 
cd /home/user/build_Release/examples/bundles/lenet_mnist &amp;&amp; /home/user/build_Release/bin/image-classifier /home/user/glow/tests/images/mnist/*.png -i=0to1 -dump-profile=/home/user/build_Release/examples/bundles/lenet_mnist/profile.yml -m=/home/user/build_Release/examples/bundles/lenet_mnist/lenet_mnist -model-input-name=data
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0524 21:57:25.627862 24050 Partitioner.cpp:693] Profiling a model to be partitioned cross different backends. Each sub-network will be optimized and run on cpu backend.
LLVMIRGen: libjit.bc: error: Unknown attribute kind (60) (Producer: 'LLVM9.0.1' Reader: 'LLVM 7.1.0')
F0524 21:57:25.651914 24054 LLVMIRGen.cpp:216] Check failed: llmodule_.get() Unable to load the JIT library.
*** Check failure stack trace: ***
#0 0x0000000000ac799e llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;) (/home/user/build_Release/bin/image-classifier+0xac799e)
#1 0x0000000000ac5ea1 llvm::sys::RunSignalHandlers() (/home/user/build_Release/bin/image-classifier+0xac5ea1)
#2 0x0000000000ac7cb1 SignalHandler(int) (/home/user/build_Release/bin/image-classifier+0xac7cb1)
#3 0x00007f742018297f (/lib/x86_64-linux-gnu/libpthread.so.0+0x1297f)
#4 0x00007f741f47efb7 raise /build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007f741f480920 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:79:0
#6 0x00007f7423a891f8 (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xa1f8)
#7 0x00007f7423a8b0cc google::LogMessage::Fail() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xc0cc)
#8 0x00007f7423a8cf32 google::LogMessage::SendToLog() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xdf32)
#9 0x00007f7423a8ac27 google::LogMessage::Flush() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xbc27)
#10 0x00007f7423a8d998 google::LogMessageFatal::~LogMessageFatal() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xe998)
#11 0x0000000000c17e2e glow::LLVMIRGen::initCodeGen() (/home/user/build_Release/bin/image-classifier+0xc17e2e)
#12 0x0000000000c3b2af glow::LLVMBackend::compileIRWithoutConstants(glow::IRFunction*) const (/home/user/build_Release/bin/image-classifier+0xc3b2af)
#13 0x0000000000c3bb0a glow::LLVMBackend::compile(glow::Function*, glow::BackendOptions const&amp;) const (/home/user/build_Release/bin/image-classifier+0xc3bb0a)
#14 0x00000000025d6574 std::thread::_State_impl&lt;std::thread::_Invoker&lt;std::tuple&lt;glow::Backend::compileFunctions(std::vector&lt;glow::Function*, std::allocator&lt;glow::Function*&gt; &gt;&amp;, llvm::StringMap&lt;glow::BackendOptions, llvm::MallocAllocator&gt;&amp;) const::$_0, (anonymous namespace)::PerCompilationThreadState*&gt; &gt; &gt;::_M_run() (/home/user/build_Release/bin/image-classifier+0x25d6574)
#15 0x00007f741fb066de (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xbd6de)
#16 0x00007f74201776da start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
#17 0x00007f741f56171e clone /build/glibc-S9d2JN/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95:0
Aborted (core dumped)
[687/724] Generating profile.yml
FAILED: examples/bundles/resnet50/profile.yml 
cd /home/user/build_Release/examples/bundles/resnet50 &amp;&amp; /home/user/build_Release/bin/image-classifier /home/user/glow/tests/images/imagenet/*.png -i=0to1 -dump-profile=/home/user/build_Release/examples/bundles/resnet50/profile.yml -m=/home/user/build_Release/examples/bundles/resnet50/resnet50 -model-input-name=gpu_0/data
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0524 21:57:26.608170 24047 Partitioner.cpp:693] Profiling a model to be partitioned cross different backends. Each sub-network will be optimized and run on cpu backend.
LLVMIRGen: libjit.bc: error: Unknown attribute kind (60) (Producer: 'LLVM9.0.1' Reader: 'LLVM 7.1.0')
F0524 21:57:26.623073 24058 LLVMIRGen.cpp:216] Check failed: llmodule_.get() Unable to load the JIT library.
*** Check failure stack trace: ***
#0 0x0000000000ac799e llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;) (/home/user/build_Release/bin/image-classifier+0xac799e)
#1 0x0000000000ac5ea1 llvm::sys::RunSignalHandlers() (/home/user/build_Release/bin/image-classifier+0xac5ea1)
#2 0x0000000000ac7cb1 SignalHandler(int) (/home/user/build_Release/bin/image-classifier+0xac7cb1)
#3 0x00007f012a57597f (/lib/x86_64-linux-gnu/libpthread.so.0+0x1297f)
#4 0x00007f0129871fb7 raise /build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007f0129873920 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:79:0
#6 0x00007f012de7c1f8 (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xa1f8)
#7 0x00007f012de7e0cc google::LogMessage::Fail() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xc0cc)
#8 0x00007f012de7ff32 google::LogMessage::SendToLog() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xdf32)
#9 0x00007f012de7dc27 google::LogMessage::Flush() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xbc27)
#10 0x00007f012de80998 google::LogMessageFatal::~LogMessageFatal() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xe998)
#11 0x0000000000c17e2e glow::LLVMIRGen::initCodeGen() (/home/user/build_Release/bin/image-classifier+0xc17e2e)
#12 0x0000000000c3b2af glow::LLVMBackend::compileIRWithoutConstants(glow::IRFunction*) const (/home/user/build_Release/bin/image-classifier+0xc3b2af)
#13 0x0000000000c3bb0a glow::LLVMBackend::compile(glow::Function*, glow::BackendOptions const&amp;) const (/home/user/build_Release/bin/image-classifier+0xc3bb0a)
#14 0x00000000025d6574 std::thread::_State_impl&lt;std::thread::_Invoker&lt;std::tuple&lt;glow::Backend::compileFunctions(std::vector&lt;glow::Function*, std::allocator&lt;glow::Function*&gt; &gt;&amp;, llvm::StringMap&lt;glow::BackendOptions, llvm::MallocAllocator&gt;&amp;) const::$_0, (anonymous namespace)::PerCompilationThreadState*&gt; &gt; &gt;::_M_run() (/home/user/build_Release/bin/image-classifier+0x25d6574)
#15 0x00007f0129ef96de (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xbd6de)
#16 0x00007f012a56a6da start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
#17 0x00007f012995471e clone /build/glibc-S9d2JN/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95:0
Aborted (core dumped)
[703/724] Building CXX object tests/unittests/CMakeFiles/CPUOperatorTest.dir/OperatorTest.cpp.o
</code></pre>
<p>Could anyone help me identify what’s the problem here? Thanks in advance!</p>

jfix: <blockquote>
<p>LLVMIRGen: libjit.bc: error: Unknown attribute kind (60) (Producer: ‘LLVM9.0.1’ Reader: ‘LLVM 7.1.0’)</p>
</blockquote>
<p>It seems like there is a mismatch between llvm versions on your machine – can you try to ensure you’re using the same llvm everywhere?</p>