Facing issues building llvm with openmp enabled

Here is my cmake command

 cmake ../llvm-project/llvm -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD='X86;NVPTX' -DLLVM_OPTIMIZED_TABLEGEN=1 -DLLVM_ENABLE_PROJECTS='clang' -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_BUILD_TOOLS=On -DLLVM_ENABLE_RUNTIMES="openmp"

and here is ninja error

vivek@vivek-System-Product-Name:~/dev/llvm-build$ ninja -j6
[8/12] Performing configure step for 'runtimes'
Not searching for unused variables given on the command line.
-- Building with -fPIC
-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter 
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
-- Using LLVM include directories: /home/vivek/dev/llvm-project/llvm/include;/home/vivek/dev/llvm-build/include
CUDA error: forward compatibility was attempted on non supported HW
Failed to 'dlopen' libhsa-runtime64.so
Failed to load libamdhip64.so: libamdhip64.so: cannot open shared object file: No such file or directory
-- OMPT target enabled
-- OpenMP tools dir in libomptarget: /home/vivek/dev/llvm-build/runtimes/runtimes-bins/openmp/runtime/src
-- LIBOMPTARGET: Not building aarch64 NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building AMDGPU NextGen plugin for dlopened libhsa
-- LIBOMPTARGET: Not generating AMDGPU tests, no supported devices detected.
-- LIBOMPTARGET: Building CUDA NextGen offloading plugin.
-- LIBOMPTARGET: Building CUDA plugin linked against libcuda
-- LIBOMPTARGET: Not generating NVIDIA tests, no supported devices detected.
-- LIBOMPTARGET: Not building PPC64 NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building PPC64le NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building x86_64 plugin linked with libffi
-- LIBOMPTARGET: Not building S390X NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building DeviceRTL. Using clang: /home/vivek/dev/llvm-build/bin/clang, llvm-link: /home/vivek/dev/llvm-build/bin/llvm-link and opt: /home/vivek/dev/llvm-build/bin/opt
-- LIBOMPTARGET: Building the llvm-omp-device-info tool
-- LIBOMPTARGET: Building the llvm-omp-kernel-replay tool
-- LIBOMPTARGET: Building offloading runtime library libomptarget.
-- LIBOMPTARGET: Building plugin unit tests for omptarget.rtl.x86_64
-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter Development Development.Module Development.Embed 
-- Configuring done
-- Generating done
CMake Error:
  Running

   '/usr/bin/ninja' '-C' '/home/vivek/dev/llvm-build/runtimes/runtimes-bins' '-t' 'recompact'

  failed with:

   ninja: error: build.ninja:762: bad $-escape (literal $ must be written as $$)

  



CMake Generate step failed.  Build files cannot be regenerated correctly.
FAILED: runtimes/runtimes-stamps/runtimes-configure /home/vivek/dev/llvm-build/runtimes/runtimes-stamps/runtimes-configure 
cd /home/vivek/dev/llvm-build/runtimes/runtimes-bins && /usr/bin/cmake --no-warn-unused-cli -DCMAKE_C_COMPILER=/home/vivek/dev/llvm-build/./bin/clang -DCMAKE_CXX_COMPILER=/home/vivek/dev/llvm-build/./bin/clang++ -DCMAKE_ASM_COMPILER=/home/vivek/dev/llvm-build/./bin/clang -DCMAKE_AR=/home/vivek/dev/llvm-build/./bin/llvm-ar -DCMAKE_RANLIB=/home/vivek/dev/llvm-build/./bin/llvm-ranlib -DCMAKE_NM=/home/vivek/dev/llvm-build/./bin/llvm-nm -DCMAKE_OBJDUMP=/home/vivek/dev/llvm-build/./bin/llvm-objdump -DCMAKE_OBJCOPY=/home/vivek/dev/llvm-build/./bin/llvm-objcopy -DCMAKE_STRIP=/home/vivek/dev/llvm-build/./bin/llvm-strip -DCMAKE_READELF=/home/vivek/dev/llvm-build/./bin/llvm-readelf -DCMAKE_C_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_CXX_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_ASM_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_INSTALL_PREFIX=/usr/local -DLLVM_BINARY_DIR=/home/vivek/dev/llvm-build -DLLVM_CONFIG_PATH=/home/vivek/dev/llvm-build/bin/llvm-config -DLLVM_ENABLE_WERROR=OFF -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_HAVE_LINK_VERSION_SCRIPT=1 -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=OFF -DLLVM_USE_RELATIVE_PATHS_IN_FILES=OFF -DLLVM_LIT_ARGS=-sv -DLLVM_SOURCE_PREFIX= -DPACKAGE_VERSION=19.0.0git -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=ON -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_ENABLE_PROJECTS_USED=ON -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_BUILD_TOOLS=On -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON -DHAVE_LLVM_LIT=ON -DCLANG_RESOURCE_DIR= -DLLVM_ENABLE_RUNTIMES=openmp -GNinja /home/vivek/dev/llvm-project/llvm/runtimes/../../runtimes && /usr/bin/cmake -E touch /home/vivek/dev/llvm-build/runtimes/runtimes-stamps//runtimes-configure
ninja: build stopped: subcommand failed.

Can you try a clean build? The cmake fails in your ninja invocation.
I haven’t seen this one before, without OpenMP it works? Does it work with a different runtime, e.g., libc?

cmake …/llvm-project/llvm -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD=‘X86;NVPTX’ -DLLVM_OPTIMIZED_TABLEGEN=1 -DLLVM_ENABLE_PROJECTS=‘clang’ -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_BUILD_TOOLS=On -DLLVM_ENABLE_RUNTIMES=“libcxx;libcxxabi;libunwind”
and
ninja
worked fine.

However even after deleting everything in build dir and running following commands fails
cmake …/llvm-project/llvm -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD=‘X86;NVPTX’ -DLLVM_OPTIMIZED_TABLEGEN=1 -DLLVM_ENABLE_PROJECTS=‘clang’ -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_BUILD_TOOLS=On -DLLVM_ENABLE_RUNTIMES=“openmp”
ninja -j6

I think I have figured out the issue, and it was dues to following way of exporting LD_LIBRARY_PATH in .bashrc

  export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
  export LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

I changed it to

  export PATH="/usr/local/cuda/bin:$PATH"
  export LD_LIBRARY_PATH="/usr/local/cuda-12.2/lib64:$LD_LIBRARY_PATH"

Now it compiles but I am getting another error

[18/44] Building CXX object openmp/libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/JIT.cpp.o
FAILED: openmp/libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/JIT.cpp.o 
/home/vivek/dev/llvm-build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DDEBUG_PREFIX=\"PluginInterface\" -DGTEST_HAS_RTTI=0 -DLIBOMPTARGET_JIT_NVPTX -DLIBOMPTARGET_JIT_X86 -DOMPTARGET_DEBUG -DOMPT_SUPPORT=1 -DTARGET_NAME=\"PluginInterface\" -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/vivek/dev/llvm-project/llvm/include -I/home/vivek/dev/llvm-build/include -I/home/vivek/dev/llvm-build/runtimes/runtimes-bins/openmp/runtime/src -I/home/vivek/dev/llvm-project/openmp/libomptarget/include -I/home/vivek/dev/llvm-project/openmp/libomptarget/plugins-nextgen/common/include -I/home/vivek/dev/llvm-project/openmp/libomptarget/plugins-nextgen/common/OMPT -isystem /usr/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -Wall -fcolor-diagnostics -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-enum-constexpr-conversion -Wno-extra -Wno-pedantic -fno-semantic-interposition -fdata-sections -g -fPIC -fvisibility=protected  -fno-exceptions -funwind-tables -fno-rtti -fno-exceptions -fno-rtti -MD -MT openmp/libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/JIT.cpp.o -MF openmp/libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/JIT.cpp.o.d -o openmp/libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/JIT.cpp.o -c /home/vivek/dev/llvm-project/openmp/libomptarget/plugins-nextgen/common/src/JIT.cpp
In file included from /home/vivek/dev/llvm-project/openmp/libomptarget/plugins-nextgen/common/src/JIT.cpp:11:
In file included from /home/vivek/dev/llvm-project/openmp/libomptarget/plugins-nextgen/common/include/JIT.h:14:
In file included from /home/vivek/dev/llvm-project/openmp/libomptarget/include/Shared/EnvironmentVar.h:14:
In file included from /home/vivek/dev/llvm-project/openmp/libomptarget/include/Shared/Debug.h:42:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:41:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/system_error:41:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/stdexcept:39:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/string:53:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:3968:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ext/string_conversions.h:41:
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cstdlib:75:15: fatal error: 'stdlib.h' file not found
   75 | #include_next <stdlib.h>
      |               ^~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
FAILED: runtimes/runtimes-stamps/runtimes-build /home/vivek/dev/llvm-build/runtimes/runtimes-stamps/runtimes-build 
cd /home/vivek/dev/llvm-build/runtimes/runtimes-bins && /usr/bin/cmake --build .
ninja: build stopped: subcommand failed.

Removing -isystem /usr/include from runtimes/runtimes-bins/build.ninja helped in above error but it failed in linking stage

FAILED: openmp/runtime/src/libomp.so 
: && /home/vivek/dev/llvm-build/./bin/clang --target=x86_64-unknown-linux-gnu -fPIC -fPIC -fno-semantic-interposition -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -Wall -fcolor-diagnostics -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-enum-constexpr-conversion -Wno-extra -Wno-pedantic -fno-semantic-interposition -fdata-sections -g  -Wl,-z,defs -Wl,-z,nodelete  -Wl,--as-needed -Wl,--version-script=/home/vivek/dev/llvm-project/openmp/runtime/src/exports_so.txt -static-libgcc -Wl,-z,noexecstack -shared -Wl,-soname,libomp.so -o openmp/runtime/src/libomp.so openmp/runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_atomic.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_debug.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_itt.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_environment.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_error.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_global.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_i18n.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_io.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_runtime.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_settings.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_str.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_tasking.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_threadprivate.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_utility.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_barrier.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_wait_release.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_dispatch.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_lock.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_sched.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_collapse.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_util.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/thirdparty/ittnotify/ittnotify_static.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_taskdeps.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_cancel.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_ftn_cdecl.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_ftn_extra.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_version.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/ompt-general.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/ompd-specific.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_asm.S.o  -lm  -ldl && cd /home/vivek/dev/llvm-build/runtimes/runtimes-bins/openmp/runtime/src && /usr/bin/cmake -E create_symlink libomp.so libgomp.so && /usr/bin/cmake -E create_symlink libomp.so libiomp5.so
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23
openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: in function `__kmpc_critical_with_hint':
kmp_csupport.cpp:(.text+0x25aa): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)'
/usr/bin/ld: kmp_csupport.cpp:(.text+0x25df): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)'
/usr/bin/ld: kmp_csupport.cpp:(.text+0x28b9): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)'
/usr/bin/ld: kmp_csupport.cpp:(.text+0x28ee): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)'
/usr/bin/ld: openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o: in function `__kmpc_end_critical':
kmp_csupport.cpp:(.text+0x31e9): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)'
/usr/bin/ld: openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o:kmp_csupport.cpp:(.text+0x321e): more undefined references to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)' follow
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[181/1042] Building CXX object openmp/libomptarget/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/PluginInterface.cpp.o
ninja: build stopped: subcommand failed.
FAILED: runtimes/runtimes-stamps/runtimes-build /home/vivek/dev/llvm-build/runtimes/runtimes-stamps/runtimes-build 
cd /home/vivek/dev/llvm-build/runtimes/runt

feels like my C++ installation is broken

I’ve seen those glibcxx failures before, I think it’s a bug in the GNU headers that showed up around GCC12 or something? Unfortunately I don’t know of any workarounds besides just using a different compiler / standard library.

Is there any nice blog/tutorial which teaches how to build/install clang and libcxx etc first and install them and then use them to build openmp?

Not that I’m aware of, I think that bug shows up in random places. There’s nothing written down as far as I know, but I can try making up a tutorial on the spot.

First you’ll probably want to build clang and the libraries.

mkdir build && cd build
cmake ../llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt;lld" -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" -DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;NVPTX" -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_OPTIMIZED_TABLEGEN=ON -G Ninja
ninja install

Then you can try doing the same thing with the newly installed compiler. Now, strictly speaking you could probably just build LLVM out of the runtimes directory, or even as a project. I think @shiltian has experience there, but I’ve never tried it.

mkdir build2 && cd build2
cmake ../llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${PREFIX}/bin/clang++  -DCMAKE_C_COMPILER=${PREFIX}/bin/clang -DLLVM_ENABLE_LIBCXX=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_ENABLE_PROJECTS="openmp" -DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;NVPTX" -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_OPTIMIZED_TABLEGEN=ON -G Ninja
ninja

No clue if that will work, didn’t test it or anything.

1 Like

I always use the standalone build of OpenMP. Basically you just build LLVM as normal, just w/o setting OpenMP in either LLVM_ENABLE_PROJECTS and LLVM_ENABLE_RUNTIMES. After the build, set LLVM_ROOT, CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the one you just built when you configure llvm-project/openmp.

Is LLVM_ROOT evn variables or -D cmake options?

CMake variables

Okay when trying with local install of clang I am getting following error in cmake for openmp

 cmake ../llvm-project/llvm -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/home/vivek/dev/llvm-installation/bin/clang++  -DCMAKE_C_COMPILER=/home/vivek/dev/llvm-installation/bin/clang -DLLVM_ENABLE_LIBCXX=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_ENABLE_PROJECTS="openmp" -DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;NVPTX" -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ROOT=/home/vivek/dev/llvm-project/llvm -G Ninja
Make Warning at /home/vivek/dev/llvm-project/third-party/benchmark/CMakeLists.txt:308 (message):
  Using std::regex with exceptions disabled is not fully supported


-- Performing Test HAVE_STEADY_CLOCK -- compiled but failed to run
-- Configuring done
CMake Error at cmake/modules/AddLLVM.cmake:1962 (add_dependencies):
  The dependency target "clang" of target "check-all" does not exist.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:2002 (add_lit_target)
  CMakeLists.txt:1255 (umbrella_lit_testsuite_end)

You have to enable clang in LLVM_ENABLE_PROJECTS as well.

okay that helped
but with next error I think I need to add some more env variables like LD_LIBRARY_PATH?

[23/23] Linking CXX executable bin/clang-tblgen
[3399/4914] ASTNodeAPI.json
FAILED: tools/clang/lib/Tooling/ASTNodeAPI.json /home/vivek/dev/llvm-build2/tools/clang/lib/Tooling/ASTNodeAPI.json 
cd /home/vivek/dev/llvm-build2/tools/clang/lib/Tooling && /home/vivek/dev/llvm-build2/bin/clang-ast-dump --skip-processing=1 -I /home/vivek/dev/llvm-build2/lib/clang/19/include -I /home/vivek/dev/llvm-project/clang/include -I /home/vivek/dev/llvm-build2/tools/clang/include -I /home/vivek/dev/llvm-build2/include -I /home/vivek/dev/llvm-project/llvm/include -I /usr/include/c++/12 -I /usr/include/x86_64-linux-gnu/c++/12 -I /usr/include/c++/12/backward -I /home/vivek/dev/llvm-installation/lib/clang/19/include -I /usr/local/include -I /usr/include/x86_64-linux-gnu -I /usr/include --json-output-path /home/vivek/dev/llvm-build2/tools/clang/lib/Tooling/ASTNodeAPI.json
/home/vivek/dev/llvm-build2/bin/clang-ast-dump: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory
[3406/4914] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/RangeConstraintManager.cpp.o
ninja: build stopped: subcommand failed.

LD_LIBRARY_PATH=/home/vivek/dev/llvm-installation/lib/x86_64-unknown-linux-gnu:$LD_LIBRARY_PATH ninja -j8
worked fine.