CHIP-SPV/hipBLAS

Failure to link against OpenCL

Closed this issue · 1 comments

cmake ../ -DCMAKE_INSTALL_PREFIX=/home/pvelesko/install/hipBLAS/latest -DCMAKE_BUILD_TYPE=RelWithDebInfo  -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang                                                                                                                                                                                                   130 ↵
-- HIP_DIR=/home/pvelesko/install/chipStar/llvm16/latest/debug
-- CMAKE_INSTALL_PREFIX = /home/pvelesko/install/hipBLAS/latest
-- The CXX compiler identification is Clang 16.0.5
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/pvelesko/install/clang/16.0/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ROCM_FOUND: 1
-- hip-config.cmake chipStar:
-- HIP_PATH:
-- HIP_COMPILER: clang
-- HIP_RUNTIME: spirv
-- HIP_PLATFORM: spirv
-- HIP_ARCH: spirv
-- HIP_OFFLOAD_COMPILE_OPTIONS:
-- HIP_OFFLOAD_LINK_OPTIONS:
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- hipblas_VERSION: 0.54.0
-- 	==>CMAKE_BUILD_TYPE: RelWithDebInfo
-- 	==>BUILD_SHARED_LIBS: ON
-- 	==>CMAKE_INSTALL_PREFIX link: /home/pvelesko/install/hipBLAS/latest
-- 	==>CMAKE_MODULE_PATH link: /opt/rocm-5.4.2/share/rocm/cmake/home/pvelesko/hipBLAS/cmake
-- 	==>CMAKE_PREFIX_PATH link:
-- 	==>CMAKE_CXX_COMPILER flags:
-- 	==>CMAKE_CXX_COMPILER debug flags: -g
-- 	==>CMAKE_CXX_COMPILER release flags: -O3 -DNDEBUG
-- 	==>CMAKE_CXX_COMPILER relwithdebinfo flags: -O2 -g -DNDEBUG
-- 	==>CMAKE_EXE_LINKER link flags:
-- ICPX_CORE_BINDIR: /opt/intel/oneapi/compiler/latest/linux/bin
-- ICPX_CORE_LIBDIR: /opt/intel/oneapi/compiler/latest/linux/lib
-- ICPX_INCLUDE_DIR: /opt/intel/oneapi/compiler/latest/linux/include

*******************************************************************************
*------------------------------- ROCMChecks WARNING --------------------------*
  Options and properties should be set on a cmake target where possible. The
  variable 'CMAKE_CXX_COMPILER' may be set by the cmake toolchain, either by
  calling 'cmake -DCMAKE_CXX_COMPILER="/opt/intel/oneapi/compiler/latest/linux/bin/icpx"'
  or set in a toolchain file and added with
  'cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file>'. ROCMChecks now calling:
CMake Warning at /opt/rocm-5.4.2/share/rocm/cmake/ROCMChecks.cmake:46 (message):
  'CMAKE_CXX_COMPILER' is set at
  /home/pvelesko/hipBLAS/library/src/CMakeLists.txt:<line#> shown below:
Call Stack (most recent call first):
  library/src/CMakeLists.txt:9223372036854775807 (rocm_check_toolchain_var)
  library/src/CMakeLists.txt:52 (set)


*-----------------------------------------------------------------------------*
*******************************************************************************

-- MKL_ARCH: None, set to ` intel64` by default
-- MKL_ROOT /opt/intel/oneapi/mkl/2023.1.0
-- MKL_LINK: None, set to ` dynamic` by default
-- MKL_INTERFACE_FULL: None, set to ` intel_ilp64` by default
-- MKL_THREADING: sequential
-- MKL_MPI: None, set to ` intelmpi` by default
-- Found MKL: intelmpi
-- Found MKL: /opt/intel/oneapi/mkl/2023.1.0
-- Found MKL: /opt/intel/oneapi/mkl/2023.1.0/lib/intel64/libmkl_sycl.so
-- Found MKL: /opt/intel/oneapi/mkl/2023.1.0/lib/intel64/libmkl_intel_ilp64.so
-- Found MKL: /opt/intel/oneapi/mkl/2023.1.0/lib/intel64/libmkl_sequential.so
-- Found MKL: /opt/intel/oneapi/mkl/2023.1.0/lib/intel64/libmkl_core.so
-- icpx : /opt/intel/oneapi/compiler/latest/linux/bin/icpx MKL: /opt/intel/oneapi/mkl/2023.1.0
-- Found both MLK and icpx

*******************************************************************************
*------------------------------- ROCMChecks WARNING --------------------------*
  Options and properties should be set on a cmake target where possible. The
  variable 'CMAKE_CXX_COMPILER' may be set by the cmake toolchain, either by
  calling 'cmake -DCMAKE_CXX_COMPILER="/opt/intel/oneapi/compiler/latest/linux/bin/icpx"'
  or set in a toolchain file and added with
  'cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file>'. ROCMChecks now calling:
CMake Warning at /opt/rocm-5.4.2/share/rocm/cmake/ROCMChecks.cmake:46 (message):
  'CMAKE_CXX_COMPILER' is set at
  /home/pvelesko/hipBLAS/library/src/oneApi_detail/deps/CMakeLists.txt:<line#>
  shown below:
Call Stack (most recent call first):
  library/src/oneApi_detail/deps/CMakeLists.txt:9223372036854775807 (rocm_check_toolchain_var)
  library/src/oneApi_detail/deps/CMakeLists.txt:1 (set)


*-----------------------------------------------------------------------------*
*******************************************************************************


*******************************************************************************
*------------------------------- ROCMChecks WARNING --------------------------*
  Options and properties should be set on a cmake target where possible. The
  variable 'CMAKE_CXX_FLAGS' may be set by the cmake toolchain, either by
  calling 'cmake -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations"'
  or set in a toolchain file and added with
  'cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file>'. ROCMChecks now calling:
CMake Warning at /opt/rocm-5.4.2/share/rocm/cmake/ROCMChecks.cmake:46 (message):
  'CMAKE_CXX_FLAGS' is set at
  /home/pvelesko/hipBLAS/library/src/oneApi_detail/deps/CMakeLists.txt:<line#>
  shown below:
Call Stack (most recent call first):
  library/src/oneApi_detail/deps/CMakeLists.txt:9223372036854775807 (rocm_check_toolchain_var)
  library/src/oneApi_detail/deps/CMakeLists.txt:2 (set)


*-----------------------------------------------------------------------------*
*******************************************************************************

should look for oneMKL ??
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
--  Sarbojit :::: /home/pvelesko/hipBLAS/build/include/hipblas/hipblas-export.h
--  Sarbojit :::: /home/pvelesko/hipBLAS/build/include/hipblas/hipblas-version.h
--  Sarbojit :::: /home/pvelesko/hipBLAS/build/include/hipblas/hipblas.h
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/pvelesko/hipBLAS/build
Consolidate compiler generated dependencies of target sycl_wrapper
make[2]: Leaving directory '/home/pvelesko/hipBLAS/build'
make  -f library/src/oneApi_detail/deps/CMakeFiles/sycl_wrapper.dir/build.make library/src/oneApi_detail/deps/CMakeFiles/sycl_wrapper.dir/build
make[2]: Entering directory '/home/pvelesko/hipBLAS/build'
[ 16%] Linking CXX shared library libsycl_wrapper.so
cd /home/pvelesko/hipBLAS/build/library/src/oneApi_detail/deps && /home/pvelesko/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-12.1.0/cmake-3.26.3-hrnqktxw5fcvaojmfanrkr74zf55an4b/bin/cmake -E cmake_link_script CMakeFiles/sycl_wrapper.dir/link.txt --verbose=1
/opt/intel/oneapi/compiler/latest/linux/bin/icpx -fPIC -Wno-deprecated-declarations -O2 -g -DNDEBUG -shared -Wl,-soname,libsycl_wrapper.so -o libsycl_wrapper.so CMakeFiles/sycl_wrapper.dir/sycl_wrapper.cpp.o CMakeFiles/sycl_wrapper.dir/onemkl.cpp.o  -Wl,-rpath,/opt/intel/oneapi/mkl/2023.1.0/lib/intel64: /opt/intel/oneapi/mkl/2023.1.0/lib/intel64/libmkl_intel_ilp64.so /opt/intel/oneapi/mkl/2023.1.0/lib/intel64/libmkl_sequential.so /opt/intel/oneapi/mkl/2023.1.0/lib/intel64/libmkl_core.so -fsycl -Wl,-rpath=/opt/intel/oneapi/mkl/2023.1.0/lib/intel64 /opt/intel/oneapi/mkl/2023.1.0/lib/intel64/libmkl_sycl.so -lm -ldl -lpthread -lsycl -lOpenCL
/usr/bin/ld: cannot find -lOpenCL: No such file or directory

I had to use the following modification to fix the issue manually:

LDFLAGS=-L/opt/ocl-icd/lib cmake ../ -DCMAKE_INSTALL_PREFIX=/home/pvelesko/install/hipBLAS/latest -DCMAKE_BUILD_TYPE=RelWithDebInfo  -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang

moved to suibmodule build