Following all steps for compile on Ubuntu 20.04 not compile with that error for clang-8.0.1:
ninja all
[1/385] Building CXX object lib/Backend/CMakeFiles/Backend.dir/CompiledFunction.cpp.o
FAILED: lib/Backend/CMakeFiles/Backend.dir/CompiledFunction.cpp.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CONTEXT_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DFMT_LOCALE -DGFLAGS_IS_A_DLL=0 -DGIT_DATE=\"2020-07-16\" -DGIT_SHA1=\"9691029b\" -DGLOW_BUILD_DATE=\"2020-07-16\" -DGLOW_WITH_CPU=1 -DGLOW_WITH_LLVMIRCODEGEN=1 -DWITH_PNG -D__STDC_FORMAT_MACROS -I../include -Iinclude -I. -I../ -I../externalbackends -I../thirdparty/fp16/include -I../thirdparty/miniz-2.0.8 -I../thirdparty/folly -Ithirdparty/folly -isystem /usr/lib/llvm-10/include -Wall -Wnon-virtual-dtor -g -fno-omit-frame-pointer -O0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pthread -std=c++14 -MD -MT lib/Backend/CMakeFiles/Backend.dir/CompiledFunction.cpp.o -MF lib/Backend/CMakeFiles/Backend.dir/CompiledFunction.cpp.o.d -o lib/Backend/CMakeFiles/Backend.dir/CompiledFunction.cpp.o -c ../lib/Backend/CompiledFunction.cpp
In file included from ../lib/Backend/CompiledFunction.cpp:17:
In file included from ../include/glow/Backend/CompiledFunction.h:19:
In file included from ../include/glow/Backend/BackendUtils.h:20:
In file included from ../include/glow/IR/IR.h:22:
In file included from ../include/glow/Graph/Graph.h:21:
In file included from ../include/glow/Graph/Nodes.h:21:
In file included from ../include/glow/Graph/Grad.h:19:
In file included from ../include/glow/Graph/Node.h:27:
../include/glow/Graph/NodeValue.h:158:30: error: no template named 'StringMap' in namespace 'llvm'
using LoweredInfoMap = llvm::StringMap
~~^
1 error generated.
[2/385] Building CXX object lib/Backends/CMakeFiles/Backends.dir/Backends.cpp.o
FAILED: lib/Backends/CMakeFiles/Backends.dir/Backends.cpp.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CONTEXT_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DFMT_LOCALE -DGFLAGS_IS_A_DLL=0 -DGIT_DATE=\"2020-07-16\" -DGIT_SHA1=\"9691029b\" -DGLOW_BUILD_DATE=\"2020-07-16\" -DGLOW_WITH_CPU=1 -DGLOW_WITH_LLVMIRCODEGEN=1 -DWITH_PNG -D__STDC_FORMAT_MACROS -I../include -Iinclude -I. -I../ -I../externalbackends -I../thirdparty/fp16/include -I../thirdparty/miniz-2.0.8 -I../thirdparty/folly -Ithirdparty/folly -isystem /usr/lib/llvm-10/include -Wall -Wnon-virtual-dtor -g -fno-omit-frame-pointer -O0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pthread -std=c++14 -MD -MT lib/Backends/CMakeFiles/Backends.dir/Backends.cpp.o -MF lib/Backends/CMakeFiles/Backends.dir/Backends.cpp.o.d -o lib/Backends/CMakeFiles/Backends.dir/Backends.cpp.o -c ../lib/Backends/Backends.cpp
In file included from ../lib/Backends/Backends.cpp:17:
In file included from ../include/glow/Backend/Backend.h:19:
In file included from ../include/glow/Backend/CompiledFunction.h:19:
In file included from ../include/glow/Backend/BackendUtils.h:20:
In file included from ../include/glow/IR/IR.h:22:
In file included from ../include/glow/Graph/Graph.h:21:
In file included from ../include/glow/Graph/Nodes.h:21:
In file included from ../include/glow/Graph/Grad.h:19:
In file included from ../include/glow/Graph/Node.h:27:
../include/glow/Graph/NodeValue.h:158:30: error: no template named 'StringMap' in namespace 'llvm'
using LoweredInfoMap = llvm::StringMap
~~^
In file included from ../lib/Backends/Backends.cpp:17:
In file included from ../include/glow/Backend/Backend.h:22:
../include/glow/Optimizer/GraphOptimizer/CompilationContext.h:186:3: error: unknown type name 'LoweredInfoMap'
LoweredInfoMap *loweredInfoMap{nullptr};
^
../include/glow/Optimizer/GraphOptimizer/CompilationContext.h:243:22: error: unknown type name 'LoweredInfoMap'
LoweredInfoMap *loweredInfoMap_ = nullptr)
^
3 errors generated.
[3/385] Building CXX object lib/Backends/CMakeFiles/Backends.dir/DeviceManagers.cpp.o
FAILED: lib/Backends/CMakeFiles/Backends.dir/DeviceManagers.cpp.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CONTEXT_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DFMT_LOCALE -DGFLAGS_IS_A_DLL=0 -DGIT_DATE=\"2020-07-16\" -DGIT_SHA1=\"9691029b\" -DGLOW_BUILD_DATE=\"2020-07-16\" -DGLOW_WITH_CPU=1 -DGLOW_WITH_LLVMIRCODEGEN=1 -DWITH_PNG -D__STDC_FORMAT_MACROS -I../include -Iinclude -I. -I../ -I../externalbackends -I../thirdparty/fp16/include -I../thirdparty/miniz-2.0.8 -I../thirdparty/folly -Ithirdparty/folly -isystem /usr/lib/llvm-10/include -Wall -Wnon-virtual-dtor -g -fno-omit-frame-pointer -O0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pthread -std=c++14 -MD -MT lib/Backends/CMakeFiles/Backends.dir/DeviceManagers.cpp.o -MF lib/Backends/CMakeFiles/Backends.dir/DeviceManagers.cpp.o.d -o lib/Backends/CMakeFiles/Backends.dir/DeviceManagers.cpp.o -c ../lib/Backends/DeviceManagers.cpp
In file included from ../lib/Backends/DeviceManagers.cpp:17:
In file included from ../include/glow/Backends/DeviceManager.h:19:
In file included from ../include/glow/Backend/CompiledFunction.h:19:
In file included from ../include/glow/Backend/BackendUtils.h:20:
In file included from ../include/glow/IR/IR.h:22:
In file included from ../include/glow/Graph/Graph.h:21:
In file included from ../include/glow/Graph/Nodes.h:21:
In file included from ../include/glow/Graph/Grad.h:19:
In file included from ../include/glow/Graph/Node.h:27:
../include/glow/Graph/NodeValue.h:158:30: error: no template named 'StringMap' in namespace 'llvm'
using LoweredInfoMap = llvm::StringMap
~~^
In file included from ../lib/Backends/DeviceManagers.cpp:17:
In file included from ../include/glow/Backends/DeviceManager.h:23:
In file included from ../include/glow/Runtime/RuntimeTypes.h:19:
In file included from ../include/glow/Backend/Backend.h:22:
../include/glow/Optimizer/GraphOptimizer/CompilationContext.h:186:3: error: unknown type name 'LoweredInfoMap'
LoweredInfoMap *loweredInfoMap{nullptr};
^
../include/glow/Optimizer/GraphOptimizer/CompilationContext.h:243:22: error: unknown type name 'LoweredInfoMap'
LoweredInfoMap *loweredInfoMap_ = nullptr)
^
3 errors generated.
[4/385] Building CXX object lib/Backend/CMakeFiles/Backend.dir/Backend.cpp.o
FAILED: lib/Backend/CMakeFiles/Backend.dir/Backend.cpp.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CONTEXT_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DFMT_LOCALE -DGFLAGS_IS_A_DLL=0 -DGIT_DATE=\"2020-07-16\" -DGIT_SHA1=\"9691029b\" -DGLOW_BUILD_DATE=\"2020-07-16\" -DGLOW_WITH_CPU=1 -DGLOW_WITH_LLVMIRCODEGEN=1 -DWITH_PNG -D__STDC_FORMAT_MACROS -I../include -Iinclude -I. -I../ -I../externalbackends -I../thirdparty/fp16/include -I../thirdparty/miniz-2.0.8 -I../thirdparty/folly -Ithirdparty/folly -isystem /usr/lib/llvm-10/include -Wall -Wnon-virtual-dtor -g -fno-omit-frame-pointer -O0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pthread -std=c++14 -MD -MT lib/Backend/CMakeFiles/Backend.dir/Backend.cpp.o -MF lib/Backend/CMakeFiles/Backend.dir/Backend.cpp.o.d -o lib/Backend/CMakeFiles/Backend.dir/Backend.cpp.o -c ../lib/Backend/Backend.cpp
In file included from ../lib/Backend/Backend.cpp:17:
In file included from ../include/glow/Backend/Backend.h:19:
In file included from ../include/glow/Backend/CompiledFunction.h:19:
In file included from ../include/glow/Backend/BackendUtils.h:20:
In file included from ../include/glow/IR/IR.h:22:
In file included from ../include/glow/Graph/Graph.h:21:
In file included from ../include/glow/Graph/Nodes.h:21:
In file included from ../include/glow/Graph/Grad.h:19:
In file included from ../include/glow/Graph/Node.h:27:
../include/glow/Graph/NodeValue.h:158:30: error: no template named 'StringMap' in namespace 'llvm'
using LoweredInfoMap = llvm::StringMap
~~^
In file included from ../lib/Backend/Backend.cpp:17:
In file included from ../include/glow/Backend/Backend.h:22:
../include/glow/Optimizer/GraphOptimizer/CompilationContext.h:186:3: error: unknown type name 'LoweredInfoMap'
LoweredInfoMap *loweredInfoMap{nullptr};
^
../include/glow/Optimizer/GraphOptimizer/CompilationContext.h:243:22: error: unknown type name 'LoweredInfoMap'
LoweredInfoMap *loweredInfoMap_ = nullptr)
^
3 errors generated.
[5/385] Building CXX object lib/Backend/CMakeFiles/Backend.dir/BackendUtils.cpp.o
FAILED: lib/Backend/CMakeFiles/Backend.dir/BackendUtils.cpp.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CONTEXT_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DFMT_LOCALE -DGFLAGS_IS_A_DLL=0 -DGIT_DATE=\"2020-07-16\" -DGIT_SHA1=\"9691029b\" -DGLOW_BUILD_DATE=\"2020-07-16\" -DGLOW_WITH_CPU=1 -DGLOW_WITH_LLVMIRCODEGEN=1 -DWITH_PNG -D__STDC_FORMAT_MACROS -I../include -Iinclude -I. -I../ -I../externalbackends -I../thirdparty/fp16/include -I../thirdparty/miniz-2.0.8 -I../thirdparty/folly -Ithirdparty/folly -isystem /usr/lib/llvm-10/include -Wall -Wnon-virtual-dtor -g -fno-omit-frame-pointer -O0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pthread -std=c++14 -MD -MT lib/Backend/CMakeFiles/Backend.dir/BackendUtils.cpp.o -MF lib/Backend/CMakeFiles/Backend.dir/BackendUtils.cpp.o.d -o lib/Backend/CMakeFiles/Backend.dir/BackendUtils.cpp.o -c ../lib/Backend/BackendUtils.cpp
In file included from ../lib/Backend/BackendUtils.cpp:16:
In file included from ../include/glow/Backend/BackendUtils.h:20:
In file included from ../include/glow/IR/IR.h:22:
In file included from ../include/glow/Graph/Graph.h:21:
In file included from ../include/glow/Graph/Nodes.h:21:
In file included from ../include/glow/Graph/Grad.h:19:
In file included from ../include/glow/Graph/Node.h:27:
../include/glow/Graph/NodeValue.h:158:30: error: no template named 'StringMap' in namespace 'llvm'
using LoweredInfoMap = llvm::StringMap
~~^
1 error generated.
[6/385] Building CXX object lib/Backends/CPU/CMakeFiles/CPUBackend.dir/CPUBackend.cpp.o
FAILED: lib/Backends/CPU/CMakeFiles/CPUBackend.dir/CPUBackend.cpp.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CONTEXT_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DFMT_LOCALE -DGFLAGS_IS_A_DLL=0 -DGIT_DATE=\"2020-07-16\" -DGIT_SHA1=\"9691029b\" -DGLOW_BUILD_DATE=\"2020-07-16\" -DGLOW_WITH_CPU=1 -DGLOW_WITH_LLVMIRCODEGEN=1 -DWITH_PNG -D__STDC_FORMAT_MACROS -I../include -Iinclude -I. -I../ -I../externalbackends -I../thirdparty/fp16/include -I../thirdparty/miniz-2.0.8 -I../thirdparty/folly -Ithirdparty/folly -isystem /usr/lib/llvm-10/include -Wall -Wnon-virtual-dtor -g -fno-omit-frame-pointer -O0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pthread -std=c++14 -MD -MT lib/Backends/CPU/CMakeFiles/CPUBackend.dir/CPUBackend.cpp.o -MF lib/Backends/CPU/CMakeFiles/CPUBackend.dir/CPUBackend.cpp.o.d -o lib/Backends/CPU/CMakeFiles/CPUBackend.dir/CPUBackend.cpp.o -c ../lib/Backends/CPU/CPUBackend.cpp
In file included from ../lib/Backends/CPU/CPUBackend.cpp:17:
In file included from ../lib/Backends/CPU/CPUBackend.h:19:
In file included from ../lib/Backends/CPU/CPUDeviceManager.h:19:
In file included from ../include/glow/Backends/QueueBackedDeviceManager.h:19:
In file included from ../include/glow/Backends/DeviceManager.h:19:
In file included from ../include/glow/Backend/CompiledFunction.h:19:
In file included from ../include/glow/Backend/BackendUtils.h:20:
In file included from ../include/glow/IR/IR.h:22:
In file included from ../include/glow/Graph/Graph.h:21:
In file included from ../include/glow/Graph/Nodes.h:21:
In file included from ../include/glow/Graph/Grad.h:19:
In file included from ../include/glow/Graph/Node.h:27:
../include/glow/Graph/NodeValue.h:158:30: error: no template named 'StringMap' in namespace 'llvm'
using LoweredInfoMap = llvm::StringMap
~~^
In file included from ../lib/Backends/CPU/CPUBackend.cpp:17:
In file included from ../lib/Backends/CPU/CPUBackend.h:19:
In file included from ../lib/Backends/CPU/CPUDeviceManager.h:19:
In file included from ../include/glow/Backends/QueueBackedDeviceManager.h:19:
In file included from ../include/glow/Backends/DeviceManager.h:23:
In file included from ../include/glow/Runtime/RuntimeTypes.h:19:
In file included from ../include/glow/Backend/Backend.h:22:
../include/glow/Optimizer/GraphOptimizer/CompilationContext.h:186:3: error: unknown type name 'LoweredInfoMap'
LoweredInfoMap *loweredInfoMap{nullptr};
^
../include/glow/Optimizer/GraphOptimizer/CompilationContext.h:243:22: error: unknown type name 'LoweredInfoMap'
LoweredInfoMap *loweredInfoMap_ = nullptr)
^
3 errors generated.
ninja: build stopped: subcommand failed.
The workaround is use clang-9 because too not work with clang-10.
I encountered the same problem and I guess you can fix it by building with an older LLVM and clang version
just install llvm-8 with sudo apt-get install llvm-8 and use
cmake -G Ninja ../glow \
-DCMAKE_BUILD_TYPE=Debug \
-DLLVM_DIR=/usr/lib/llvm-8/lib/cmake/llvm afterwards instead of the usual cmake command
and I realized that Glow expects at least something behind python, on new Ubuntu 20.04 installations, python needs to be redirected with python-is-python3, which is available with sudo apt-get install python-is-python3, but I am not sure, if it runs through with this setup as I switched to the docker container
Here the default is python 3 and with llvm-8 not work, only work with llvm-9. With llvm-9 no error. All tests passing like a charm.
Thanks @Hygens @MaxS1996 for the comments. Here is the summary from the above thread that works for me.
Install clang-9 instead of 8 using sudo apt install clang-9
In update-alternatives command change llvm-8 to llvm-9
Run sudo apt-get install python-is-python3 before building glow
Most helpful comment
The workaround is use clang-9 because too not work with clang-10.