pocl / pocl

pocl - Portable Computing Language
http://portablecl.org
MIT License
910 stars 251 forks source link

CMake config error on Mac OS 12.4 #1075

Closed dvincentwest closed 2 years ago

dvincentwest commented 2 years ago

Hello,

I am trying to build pocl from source.

System: MBP 16" 2019 Intel i9, AMD Radeon 5500m Mac OS 12.4 using bash, instead of zsh llvm from home-brew, -version 14

I have the following in my .bash_profile to setup the build environment

export PATH=/usr/local/opt/llvm/bin:$PATH
export CC=clang
export CMAKE_C_COMPILER=clang
export CXX=clang++
export CMAKE_CXX_COMPILER=clang++

I go and clone the repo with git, cd into the source directory, mkdir build

Then run:

cmake -S . -B build/

The configuration seems to make it far, but ends with the following error

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/Users/vince/Coding/opencl/pocl/lib/CL/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL
/Users/vince/Coding/opencl/pocl/lib/CL/devices/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL/devices
/Users/vince/Coding/opencl/pocl/lib/CL/devices/basic/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL/devices/basic
/Users/vince/Coding/opencl/pocl/lib/CL/devices/pthread/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL/devices/pthread
/Users/vince/Coding/opencl/pocl/lib/CL/devices/topology/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL/devices/topology
/Users/vince/Coding/opencl/pocl/lib/llvmopencl/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/llvmopencl

Here is the full CMake output:

> cmake -S . -B build/
CMake Deprecation Warning at CMakeLists.txt:27 (cmake_policy):
  The OLD behavior for policy CMP0067 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.

-- The C compiler identification is Clang 14.0.6
-- The CXX compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/opt/llvm/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_WARN_INCOMPATIBLE_POINTER_TYPES
-- Performing Test HAVE_WARN_INCOMPATIBLE_POINTER_TYPES - Success
-- Setting build type to 'Debug' as none was specified.
-- Pocl source Git commit: 4627171d40543091e399989c277faa52fcee0ff8
-- Pocl source Git branch: * master
-- Pocl source Git describe: master-0-g4627171d
-- Host CPU cores: 16
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'hwloc'
--   Found hwloc, version 2.7.1
-- Found Hwloc: hwloc  
-- Found hwloc 2.7.1 in /usr/local/Cellar/hwloc/2.7.1/include:hwloc
-- Hwloc_VERSION 2.7.1
-- Hwloc_LIBRARIES hwloc
-- Hwloc_INCLUDE_DIRS /usr/local/Cellar/hwloc/2.7.1/include
getconf: no such configuration parameter `LEVEL1_DCACHE_LINESIZE'
CMake Warning at CMakeLists.txt:411 (message):
  getconf exited with nonzero status!

CMake Warning at CMakeLists.txt:429 (message):
  Unable to detect cacheline size - assuming 64byte cacheline, override with
  -DHOST_CPU_CACHELINE_SIZE=<number> (Note: this is merely used for
  optimization, at worst pocl will be slightly slower)

-- Using llvm-config: /usr/local/opt/llvm/bin/llvm-config
-- LLVM binaries suffix : 
-- llvm-config's LLVM_PREFIX is: /usr/local/Cellar/llvm/14.0.6
-- llvm-config's LLVM_VERSION_FULL is: 14.0.6
-- LLVM_VERSION: 14.0
-- llvm-config's LLVM_CFLAGS is: -I/usr/local/Cellar/llvm/14.0.6/include  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- llvm-config's LLVM_CXXFLAGS is: -I/usr/local/Cellar/llvm/14.0.6/include -std=c++14 -stdlib=libc++   -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- llvm-config's LLVM_CPPFLAGS is: -I/usr/local/Cellar/llvm/14.0.6/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- llvm-config's LLVM_LDFLAGS is: -L/usr/local/Cellar/llvm/14.0.6/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-- llvm-config's LLVM_BINDIR is: /usr/local/Cellar/llvm/14.0.6/bin
-- llvm-config's LLVM_LIBDIR is: /usr/local/Cellar/llvm/14.0.6/lib
-- llvm-config's LLVM_INCLUDEDIR is: /usr/local/Cellar/llvm/14.0.6/include
-- llvm-config's LLVM_SRC_ROOT is: /tmp/llvm-20220626-68708-t3jj0m/llvm-project-14.0.6.src/llvm
-- llvm-config's LLVM_OBJ_ROOT is: /usr/local/Cellar/llvm/14.0.6
-- llvm-config's LLVM_ALL_TARGETS is: AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430 NVPTX PowerPC RISCV Sparc SystemZ VE WebAssembly X86 XCore
-- llvm-config's LLVM_HOST_TARGET is: x86_64-apple-darwin21.5.0
-- llvm-config's LLVM_BUILD_MODE is: Release
-- llvm-config's LLVM_ASSERTS_BUILD is: OFF
-- llvm-config's LLVM_SYSLIBS is: 
-- llvm-config's LLVM_HAS_RTTI is: YES
-- llvm-config's LLVM_LIBS is: -lLLVM-14
-- llvm-config's LLVM_SYSLIBS is: 
-- Found clang: /usr/local/Cellar/llvm/14.0.6/bin/clang
-- Found clang++: /usr/local/Cellar/llvm/14.0.6/bin/clang++
-- Found opt: /usr/local/Cellar/llvm/14.0.6/bin/opt
-- Found llc: /usr/local/Cellar/llvm/14.0.6/bin/llc
-- Found llvm-as: /usr/local/Cellar/llvm/14.0.6/bin/llvm-as
-- Found llvm-link: /usr/local/Cellar/llvm/14.0.6/bin/llvm-link
-- Found lli: /usr/local/Cellar/llvm/14.0.6/bin/lli
-- udivmodti4 compiles without extra flags
-- Checking if LLVM is a DEBUG build
-- DEBUG build
-- Find out LLC target triple (for host x86_64-apple-darwin21.5.0)
-- Find out LLC host CPU with /usr/local/Cellar/llvm/14.0.6/bin/llc
-- Checking clang -march vs. -mcpu flag
--   Using -march=
-- LLVM link test OK
-- Checking fp16 support
-- FP16 is disabled: 1
-- Looking for fork
-- Looking for fork - found
-- Looking for fsync
-- Looking for fsync - found
-- Looking for sleep
-- Looking for sleep - found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for utime
-- Looking for utime - found
-- Looking for ANNOTATE_HAPPENS_BEFORE
-- Looking for ANNOTATE_HAPPENS_BEFORE - not found
-- Looking for futimens
-- Looking for futimens - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for fdatasync
-- Looking for fdatasync - not found
-- Looking for mkdtemp
-- Looking for mkdtemp - found
-- Looking for mkstemps
-- Looking for mkstemps - found
-- Looking for vfork
-- Looking for vfork - found
-- Looking for mkostemps
-- Looking for mkostemps - not found
-- Looking for dladdr
-- Looking for dladdr - found
-- Private Datadir Relative path: ../share/pocl
-- Compiler supports IPO: YES
-- Enable Link-Time Optimization (IPO) while building pocl runtime : 1
CMake Warning at CMakeLists.txt:788 (message):
  SPIR support is available but highly experimental; use at your own risk.

-- libdl found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Checking for module 'lttng-ust>=2.7'
--   No package 'lttng-ust' found
-- Checking for module 'ocl-icd>=1.3'
--   No package 'ocl-icd' found
-- ocl-icd not found -> trying fallback ICD implementations
-- Checking for module 'OpenCL>=1.2'
--   No package 'OpenCL' found
-- Looking for clEnqueueFillImage
-- Looking for clEnqueueFillImage - found
-- libOpenCL (unknown ICD loader) found
-- Using an ICD loader : 1
-- Run tests with ICD: 0
-- OpenCL.h not found or ICD disabled, installing our headers
-- Failed to find tcecc or tce-config, disabling TCE
-- TCE support : 0
-- Building the following device drivers: basic pthreads
-- Using generic OpenCL 2.0 atomics
-- skylake SLEEF: 128bit vectors available.
-- skylake SLEEF: 128bit hardware FMA available.
-- skylake SLEEF: 256bit vectors available.
-- skylake SLEEF: 256bit hardware FMA available.
-- skylake SLEEF: 512bit vectors NOT available.
-- skylake SLEEF bc list: /Users/vince/Coding/opencl/pocl/build/lib/kernel/host/skylake/c_sleefsp.c.bc;/Users/vince/Coding/opencl/pocl/build/lib/kernel/host/skylake/c_sleefdp.c.bc;/Users/vince/Coding/opencl/pocl/build/lib/kernel/host/skylake/c_sleef_glue_auto.c.bc;/Users/vince/Coding/opencl/pocl/build/lib/kernel/host/skylake/v128_sleefsimdsp.c.bc;/Users/vince/Coding/opencl/pocl/build/lib/kernel/host/skylake/v128_sleefsimddp.c.bc;/Users/vince/Coding/opencl/pocl/build/lib/kernel/host/skylake/v256_sleefsimdsp.c.bc;/Users/vince/Coding/opencl/pocl/build/lib/kernel/host/skylake/v256_sleefsimddp.c.bc
-- skylake SLEEF bc: /Users/vince/Coding/opencl/pocl/build/lib/kernel/host/skylake/sleef.bc
-- Host Kernel BC for "skylake": /Users/vince/Coding/opencl/pocl/build/lib/kernel/host/kernel-x86_64-apple-macosx12.0.0-skylake.bc
-- CPACK_DEBIAN_ICD_PACKAGE_DEPENDS
-- CPACK_DEBIAN_ICD_PACKAGE_NAME
-- CPACK_DEBIAN_ICD_PACKAGE_PROVIDES
-- CPACK_DEBIAN_ICD_PACKAGE_RECOMMENDS
-- CPACK_DEBIAN_LIB_PACKAGE_BREAKS
-- CPACK_DEBIAN_LIB_PACKAGE_DEPENDS
-- CPACK_DEBIAN_LIB_PACKAGE_NAME
-- CPACK_DEBIAN_LIB_PACKAGE_RECOMMENDS
-- CPACK_DEBIAN_LIB_PACKAGE_REPLACES
-- OPENCL_LIBS: Threads::Threads;/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenCL.framework
-- OPENCL_CFLAGS: 
-- POCLU LINK OPTS: poclu;Threads::Threads;/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenCL.framework;-lm
-- CPACK_DEBIAN_ICD_PACKAGE_DEPENDS
-- CPACK_DEBIAN_ICD_PACKAGE_NAME
-- CPACK_DEBIAN_ICD_PACKAGE_PROVIDES
-- CPACK_DEBIAN_ICD_PACKAGE_RECOMMENDS
-- CPACK_DEBIAN_LIB_PACKAGE_BREAKS
-- CPACK_DEBIAN_LIB_PACKAGE_DEPENDS
-- CPACK_DEBIAN_LIB_PACKAGE_NAME
-- CPACK_DEBIAN_LIB_PACKAGE_RECOMMENDS
-- CPACK_DEBIAN_LIB_PACKAGE_REPLACES
-- CPACK_DEBIAN_POCLCC_PACKAGE_DEPENDS
-- CPACK_DEBIAN_POCLCC_PACKAGE_NAME
--  
-- *********************** SUMMARY ***************************
--  
-- ******* Directories:
--  
-- CMAKE_INSTALL_PREFIX: /usr/local
-- POCL_INSTALL_CMAKE_CONFIG_DIR: /usr/local/lib/pocl/cmake
-- POCL_INSTALL_ICD_VENDORDIR: /usr/local/etc/OpenCL/vendors
-- POCL_INSTALL_OPENCL_HEADER_DIR: /usr/local/include/OpenCL
-- POCL_INSTALL_PKGCONFIG_DIR: /usr/local/lib/pkgconfig
-- POCL_INSTALL_PRIVATE_DATADIR: /usr/local/share/pocl
-- POCL_INSTALL_PRIVATE_HEADER_DIR: /usr/local/share/pocl/include
-- POCL_INSTALL_PRIVATE_LIBDIR: /usr/local/lib/pocl
-- POCL_INSTALL_PUBLIC_BINDIR: /usr/local/bin
-- POCL_INSTALL_PUBLIC_HEADER_DIR: /usr/local/include
-- POCL_INSTALL_PUBLIC_LIBDIR: /usr/local/lib
--  
--  
-- ******* LLVM Programs:
--  
-- LLVM_CONFIG: /usr/local/opt/llvm/bin/llvm-config
-- LLVM_OPT: /usr/local/Cellar/llvm/14.0.6/bin/opt
-- LLVM_LLC: /usr/local/Cellar/llvm/14.0.6/bin/llc
-- LLVM_AS: /usr/local/Cellar/llvm/14.0.6/bin/llvm-as
-- LLVM_LINK: /usr/local/Cellar/llvm/14.0.6/bin/llvm-link
-- LLVM_LLI: /usr/local/Cellar/llvm/14.0.6/bin/lli
-- WITH_LLVM_CONFIG (User preferred llvm-config): 
--  
-- ******* Various Flags:
--  
-- CL_DISABLE_HALF: 1
-- HAVE_CLOCK_GETTIME: 1
-- HAVE_GLEW: 
-- HAVE_LTTNG_UST: 0
-- HOST_AS_FLAGS:  
-- HOST_CLANG_FLAGS: --target=x86_64-apple-macosx12.0.0 -D_CL_DISABLE_HALF 
-- HOST_LD_FLAGS: -dynamiclib -w -lm 
-- HOST_LLC_FLAGS: -relocation-model=pic -mtriple=x86_64-apple-macosx12.0.0 
-- 
-- LIB_API_VERSION: 2
-- LIB_BUILD_VERSION: 2.9.0
-- ICD_LD_FLAGS: -single_module
-- EXTRA_KERNEL_FLAGS: 
-- EXTRA_KERNEL_CXX_FLAGS: 
-- EXTRA_KERNEL_CL_FLAGS: 
-- EXTRA_KERNEL_C_FLAGS: 
-- final KERNEL_CXX_FLAGS: -xc++ -std=c++11 -fno-stack-protector -fPIC 
-- final KERNEL_CL_FLAGS: -xcl -fno-stack-protector -fPIC 
-- final KERNEL_C_FLAGS: -xc -std=c11 -D__CBUILD__ -fno-math-errno -fno-stack-protector -fPIC 
-- 
-- CLANG_HAS_64B_MATH: ON
-- CLANG_HAS_128B_MATH: ON
-- CLANG_NEEDS_RTLIB: OFF
-- CLANG_MARCH_FLAG: -march=
-- CLANG_TARGET_OPTION: --target=
-- LLVM_VERSION: 14.0
-- LLVM_LIB_IS_SHARED: 
-- LLVM_HAS_RTTI: YES
-- LLVM_LIB_MODE: --link-shared
-- LLVM_ASSERTS_BUILD: OFF
-- LLVM_BUILD_MODE: Release
-- LLVM_CFLAGS: -I/usr/local/Cellar/llvm/14.0.6/include  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- LLVM_CXXFLAGS: -I/usr/local/Cellar/llvm/14.0.6/include -std=c++14 -stdlib=libc++   -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- LLVM_CPPFLAGS: -I/usr/local/Cellar/llvm/14.0.6/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- LLVM_LDFLAGS: -L/usr/local/Cellar/llvm/14.0.6/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-- LLVM_LIBDIR: /usr/local/Cellar/llvm/14.0.6/lib
-- LLVM_INCLUDEDIR: /usr/local/Cellar/llvm/14.0.6/include
-- LLVM_SRC_ROOT: /tmp/llvm-20220626-68708-t3jj0m/llvm-project-14.0.6.src/llvm
-- LLVM_OBJ_ROOT: /usr/local/Cellar/llvm/14.0.6
-- LLVM_INCLUDE_DIRS: 
-- LLVM_ALL_TARGETS: AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430 NVPTX PowerPC RISCV Sparc SystemZ VE WebAssembly X86 XCore
-- LLVM_HOST_TARGET: x86_64-apple-darwin21.5.0
-- LLC_TRIPLE: x86_64-apple-macosx12.0.0
-- LLC_HOST_CPU: skylake
-- 
-- MAX_EXTENDED_ALIGNMENT: 128
-- OCL_KERNEL_TARGET: x86_64-apple-macosx12.0.0
-- OCL_KERNEL_TARGET_CPU: skylake
-- HOST_DEVICE_ADDRESS_BITS: 64
-- 
-- ----------- -------------------------------- --------
-- llvm libs libpocl will be linked to (POCL_LLVM_LIBS):
-- /usr/local/Cellar/llvm/14.0.6/lib/libLLVM-14.dylib
-- ----------- -------------------------------- --------
-- clang libs libpocl will be linked to (CLANG_LIBFILES):
-- /usr/local/Cellar/llvm/14.0.6/lib/libclang-cpp.dylib
-- ----------- -------------------------------- --------
-- system libs libpocl will be linked to (LLVM_SYSLIBS):
-- 
-- ----------- -------------------------------- --------
-- ******* Enabled features:
--  
-- DEVELOPER_MODE: OFF
-- ENABLE_CONFORMANCE: OFF
-- ENABLE_IPO: YES
-- ENABLE_ICD: 1
-- ENABLE_TCE: 0
-- ENABLE_TCEMC: 0
-- ENABLE_HSA: OFF
-- ENABLE_CUDA: OFF
-- ENABLE_VULKAN: OFF
-- ENABLE_ASAN (address sanitizer): OFF
-- ENABLE_LSAN (leak sanitizer): 
-- ENABLE_TSAN (thread sanitizer): OFF
-- ENABLE_UBSAN (UB sanitizer): 
-- ENABLE_POCL_FLOAT_CONVERSION: OFF
-- ENABLE_RELOCATION: ON
-- ENABLE_PROXY_DEVICE: OFF
-- ENABLE_PROXY_DEVICE_INTEROP: OFF
-- ENABLE_CL_GET_GL_CONTEXT: 
-- ENABLE_OPENGL_INTEROP: 
-- ENABLE_EGL_INTEROP: 
-- ENABLE_SLEEF: ON
-- ENABLE_SPIR: ON
-- ENABLE_SPIRV: OFF
-- ENABLE_POCL_BUILDING: ON
-- INSTALL_OPENCL_HEADERS (Install our headers): ON
-- OCL_DRIVERS (Drivers built): basic pthreads
-- OCL_TARGETS (Targets built): host
-- ENABLE_LLVM: ON
-- POCL_ICD_ABSOLUTE_PATH: ON
-- POCL_ASSERTS_BUILD: 1
-- TESTS_USE_ICD: 0
-- Available testsuites: AMD;AMDSDK2.9;AMDSDK3.0;ASL;arrayfire;clBLAS;CLBlast;clFFT;conformance;CloverLeaf;Halide;IntelSVM;opencl-book-samples;OpenCV;Parboil;piglit;PyOpenCL;Rodinia;shoc;VexCL;ViennaCL;Glow
-- Enabled testsuites: 
-- Disabled testsuites: AMD;AMDSDK2.9;AMDSDK3.0;ASL;arrayfire;clBLAS;CLBlast;clFFT;conformance;CloverLeaf;Halide;IntelSVM;opencl-book-samples;OpenCV;Parboil;piglit;PyOpenCL;Rodinia;shoc;VexCL;ViennaCL;Glow
-- Testsuites are built from git master: OFF
-- Kernel caching: ON
-- Kernel library CPU variants: native
-- Kernel library distro build: 0
-- Use pocl custom memory allocator: OFF
-- L1d cacheline size: 64
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/Users/vince/Coding/opencl/pocl/lib/CL/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL
/Users/vince/Coding/opencl/pocl/lib/CL/devices/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL/devices
/Users/vince/Coding/opencl/pocl/lib/CL/devices/basic/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL/devices/basic
/Users/vince/Coding/opencl/pocl/lib/CL/devices/pthread/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL/devices/pthread
/Users/vince/Coding/opencl/pocl/lib/CL/devices/topology/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/CL/devices/topology
/Users/vince/Coding/opencl/pocl/lib/llvmopencl/OCL_ICD_INCLUDE_DIRS
   used as include directory in directory /Users/vince/Coding/opencl/pocl/lib/llvmopencl

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
dvincentwest commented 2 years ago

apologies, I am fairly certain this is just because I don't have have ocl-icd installed. I'm new to CMake and its just taking me awhile to parse through everything