intel / intel-graphics-compiler

Other
606 stars 158 forks source link

Cannot find SPIRVDLL sources in /home/ubuntu/intel-graphics-compiler/IGC/VectorCompiler/../../../llvm-project/llvm/projects/llvm-spirv #166

Closed jeffhammond closed 3 years ago

jeffhammond commented 3 years ago

In https://github.com/intel/compute-runtime/issues/397, it was suggested that I compile IGC in order to work around CMake issues preventing me from compiling Level Zero for something other than an Intel GPU.

This is a Raspberry Pi 4. I do not understand the CMake error below.

ubuntu@ubuntu:~$ git clone --recursive https://github.com/intel/intel-graphics-compiler.git
Cloning into 'intel-graphics-compiler'...
remote: Enumerating objects: 395, done.
remote: Counting objects: 100% (395/395), done.
remote: Compressing objects: 100% (281/281), done.
remote: Total 50039 (delta 212), reused 206 (delta 108), pack-reused 49644
Receiving objects: 100% (50039/50039), 51.51 MiB | 12.76 MiB/s, done.
Resolving deltas: 100% (40853/40853), done.
ubuntu@ubuntu:~$ cd intel-graphics-compiler/
ubuntu@ubuntu:~/intel-graphics-compiler$ mkdir build
ubuntu@ubuntu:~/intel-graphics-compiler$ cd build/
ubuntu@ubuntu:~/intel-graphics-compiler/build$ cmake ..
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at IGC/CMakeLists.txt:41 (cmake_policy):
  The OLD behavior for policy CMP0043 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

CMake Deprecation Warning at IGC/CMakeLists.txt:43 (cmake_policy):
  The OLD behavior for policy CMP0054 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

CMake Warning at IGC/CMakeLists.txt:1911 (message):
  CMAKE_BUILD_TYPE: Unknown build configuration.  The following
  configurations are available: Debug;Release.

  The "Release" configuration will be used.

  This value has meaning only for single-configuration generators (like
  Make).  It will be ignored for MSVC/XCode.

CMake Warning at IGC/CMakeLists.txt:1971 (message):
  IGC_OPTION__ARCHITECTURE_TARGET: Target architecture is not specified.
  Trying to deduce it from context.

-- ================================ IGC Project ================================
-- Build type:  Release (single-configuration generator)
-- Build tools: OFF
-- LLVM dir:    
-- 
-- Output directory:
--    "/home/ubuntu/intel-graphics-compiler/build/IGC/Release"
-- Install root directory:
--    "/usr/local"
-- Architecture:
--  - target: LinuxARM    (detected: LinuxARM)
--  - host:   LinuxARM    (detected: LinuxARM)
-- 
-- Cross-compilation needed: NO
-- Cross-compilation set:    FALSE
-- 
-- Advanced:
--  - Link BiF resources:              ON
--  - Building Windows Universal:      
-- =============================================================================
-- [IGC] LLVM targets are not defined. Searching for LLVM.
-- [IGC] Using system LLVM 7.0.1
-- [IGC] Link against found LLVM dylib /usr/lib/aarch64-linux-gnu/libLLVM-7.so
-- [CMFE] CM Frontend headers are taken from: /home/ubuntu/intel-graphics-compiler/IGC/CMFE/AdaptorCM
-- [CMFE] Using CMFE library name: libclangFEWrapper.so
-- Linking CMFE with LLVM
-- +++ Source/IGC/VectorCompiler +++
-- [VC] Build proj: VectorCompiler
-- [VC] Using system llvm
-- [VC] Found tblgen: /usr/lib/llvm-7/bin/llvm-tblgen
-- Linker detection: GNU ld
-- [VC] Including llvm headers: /usr/lib/llvm-7/include
-- [VC] Using vc-intrinsics source from: /home/ubuntu/intel-graphics-compiler/IGC/VectorCompiler/../../../vc-intrinsics/GenXIntrinsics
CMake Error at IGC/VectorCompiler/CMakeLists.txt:154 (add_subdirectory):
  add_subdirectory given source
  "/home/ubuntu/intel-graphics-compiler/IGC/VectorCompiler/../../../vc-intrinsics/GenXIntrinsics"
  which is not an existing directory.

-- [VC] SPIRVDLL_SRC = 
-- [VC] SPIRV_SRC = 
-- [VC] Cannot find SPIRVDLL sources in /home/ubuntu/intel-graphics-compiler/IGC/VectorCompiler/../../../llvm-project/llvm/projects/llvm-spirv
CMake Error at IGC/VectorCompiler/cmake/spirv.cmake:125 (message):
  [VC] Cannot find SPIRVDLL sources in
  /home/ubuntu/intel-graphics-compiler/IGC/VectorCompiler/../../../llvm-spirv
Call Stack (most recent call first):
  IGC/VectorCompiler/CMakeLists.txt:157 (include)

-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/intel-graphics-compiler/build/CMakeFiles/CMakeOutput.log".
lwesiers commented 3 years ago

As I see, you are using LLVM 7 for this build? If this was your intention then you need to disable VC like this is described in build instructions:

https://github.com/intel/intel-graphics-compiler/blob/master/documentation/build_ubuntu.md#llvmclang-version-specific-caveats

by adding cmake parameter : -DIGC_BUILD__VC_ENABLED=OFF

jeffhammond commented 3 years ago

I used LLVM 7 because it insisted I have LLVM 7 installed (I had 9 and 10 but they were rejected). I assumed that LLVM 7 was a dependency. But I'll try this now.

lwesiers commented 3 years ago

If you wish to use other preinstalled LLVM in system then please use this cmake parameter: -DIGC_PREFERRED_LLVM_VERSION="10.0.0" - then you don't need to disable VC.

lwesiers commented 3 years ago

I'm closing this issue as it was addressed. Feel free to re-open if needed.