CMake error

Dear al, im trying to install llvm with all the projects because I need Clang ant the SPIR-V target. I am using cmake like the llvm manual says and it give me this error, someone could help me to solve it? (error below)

Also, doing this am i installing the SPIR-V target? I need it to compile OpenCL codes. I saw that ifI clone the following link (https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git ) in llvm/projects and then i run cmake, it install the SPIR-V target.

The command i need to use is like: clang -target spir64-unknown-unknown test.cl

You can see specifications at https://clang.llvm.org/docs/UsersManual.html#opencl-targets

CMAKE ERROR TRACE:

enrique@enrique-VirtualBox:~/Escritorio/llvm-project/build$ cmake -DLLVM_ENABLE_PROJECTS=‘all’ -DCMAKE_BUILD_TYPE=Release -G ‘Ninja’ …/llvm
– clang project is enabled
– clang-tools-extra project is enabled
– compiler-rt project is enabled
– debuginfo-tests project is enabled
– libclc project is enabled
– libcxx project is enabled
– libcxxabi project is enabled
– libunwind project is enabled
– lld project is enabled
– lldb project is enabled
– llgo project is enabled
– openmp project is enabled
– parallel-libs project is enabled
– polly project is enabled
– pstl project is enabled
– Could NOT find Z3: Found unsuitable version “0.0.0”, but required is at least “4.7.1” (found Z3_LIBRARIES-NOTFOUND)
– Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
– Native target architecture is X86
– Threads enabled.
– Doxygen disabled.
– Go bindings disabled.
– Ninja version: 1.8.2
– Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
– Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
– OCaml bindings disabled.
– LLVM host triple: x86_64-unknown-linux-gnu
– LLVM default target triple: x86_64-unknown-linux-gnu
– Building with -fPIC
– Constructing LLVMBuild project information
– Linker detection: GNU ld
– Targeting AArch64
– Targeting AMDGPU
– Targeting ARM
– Targeting BPF
– Targeting Hexagon
– Targeting Lanai
– Targeting Mips
– Targeting MSP430
– Targeting NVPTX
– Targeting PowerPC
– Targeting RISCV
– Targeting Sparc
– Targeting SystemZ
– Targeting WebAssembly
– Targeting X86
– Targeting XCore
– Failed to locate sphinx-build executable (missing: SPHINX_EXECUTABLE)
– Linker detection: GNU ld
– Parallel STL uses the serial backend
– Linker detection: GNU ld
– Linker detection: GNU ld
– gdb found: /usr/bin/gdb
– Linker detection: GNU ld
– Compiler-RT supported architectures: x86_64
– Builtin supported architectures: x86_64
– Linker detection: GNU ld
– Linker detection: GNU ld
– Builtin supported architectures: x86_64
– Generated Sanitizer SUPPORTED_TOOLS list on “Linux” is “asan;lsan;msan;tsan;ubsan”
– sanitizer_common tests on “Linux” will run against “asan;lsan;msan;tsan;ubsan”
– check-shadowcallstack does nothing.
– Could NOT find LIBOMPTARGET_DEP_LIBELF (missing: LIBOMPTARGET_DEP_LIBELF_LIBRARIES LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIRS)
– Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
– Could NOT find LIBOMPTARGET_DEP_CUDA_DRIVER (missing: LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES)
– LIBOMPTARGET: Building offloading runtime library libomptarget.
– LIBOMPTARGET: Not building aarch64 offloading plugin: machine not found in the system.
– LIBOMPTARGET: Not building CUDA offloading plugin: libelf dependency not found.
– LIBOMPTARGET: Not building PPC64 offloading plugin: machine not found in the system.
– LIBOMPTARGET: Not building PPC64le offloading plugin: machine not found in the system.
– LIBOMPTARGET: Not building x86_64 offloading plugin: libelf dependency not found.
– LIBOMPTARGET: Not building CUDA offloading device RTL: CUDA tools not found in the system.
– ISL version: isl-0.20-65-gb822a210
– PPCG version: ppcg-0.07
– Clang version: 10.0.0
CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET llgo. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:219 (add_libgo_variant)

CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET cc-wrapper. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:219 (add_libgo_variant)

CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET llgo. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:222 (add_libgo_variant)

CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET cc-wrapper. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:222 (add_libgo_variant)

CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET llgo. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:226 (add_libgo_variant)

CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET cc-wrapper. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:226 (add_libgo_variant)

CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET llgo. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:230 (add_libgo_variant)

CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET cc-wrapper. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:230 (add_libgo_variant)

CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET llgo. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:234 (add_libgo_variant)

CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET cc-wrapper. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:234 (add_libgo_variant)

– LLD version: 10.0.0
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LibEdit (missing: libedit_INCLUDE_DIRS libedit_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/enrique/Escritorio/llvm-project/lldb/cmake/modules/FindLibEdit.cmake:54 (find_package_handle_standard_args)
/home/enrique/Escritorio/llvm-project/lldb/cmake/modules/LLDBConfig.cmake:104 (find_package)
/home/enrique/Escritorio/llvm-project/lldb/CMakeLists.txt:21 (include)

– Configuring incomplete, errors occurred!
See also “/home/enrique/Escritorio/llvm-project/build/CMakeFiles/CMakeOutput.log”.
See also “/home/enrique/Escritorio/llvm-project/build/CMakeFiles/CMakeError.log”.

I’m no sure exactly what has gone wrong for you. Some more information about the environment you’re building in might be useful, and what version/commit of LLVM you’re trying to build.

Assuming you don’t need to write code in the Go language, you can specify -DLLVM_ENABLE_BINDINGS=Off, which may eliminate the llgo errors.

Hope that helps!

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

llgo may not be useful to you. When I was compiling all the projects under llvm a little while back I could not get it to compile. I expect you would need to list all the projects, less llgo, for enable-projects if that is what you really need.

On Ubuntu installing libedit-dev may remove those related errors.

You might consider Installing lld, the llvm linker, and use that instead of ld, the gcc linker, as it will use much less memory.

Neil Nelson