Reputation: 61
I'm getting an error with building arrayfire.
I wish to use Arrayfire purely with CUDA, yet the arrayfire build seems to require OpenCL, despite me setting the flag for OpenCL not to be built.
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0
CMake variables:
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
CMake Error: The source directory "/home/hphi344/Documents/arrayfire/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
-- Cache values
AF_BUILD_CPU:BOOL=OFF
AF_BUILD_CUDA:BOOL=ON
AF_BUILD_DOCS:BOOL=OFF
AF_BUILD_EXAMPLES:BOOL=OFF
AF_BUILD_FORGE:BOOL=OFF
AF_BUILD_ONEAPI:BOOL=OFF
AF_BUILD_OPENCL:BOOL=OFF
AF_BUILD_UNIFIED:BOOL=ON
AF_COMPUTE_LIBRARY:STRING=FFTW/LAPACK/BLAS
AF_CTEST_SEPARATED:BOOL=OFF
AF_STACKTRACE_TYPE:STRING=Basic
AF_WITH_CUDNN:BOOL=OFF
AF_WITH_EXTERNAL_PACKAGES_ONLY:BOOL=OFF
AF_WITH_FAST_MATH:BOOL=OFF
AF_WITH_FMT_HEADER_ONLY:BOOL=OFF
AF_WITH_SPDLOG_HEADER_ONLY:BOOL=OFF
AF_WITH_STATIC_CUDA_NUMERIC_LIBS:BOOL=OFF
BUILD_TESTING:BOOL=ON
CLBlast_DIR:PATH=CLBlast_DIR-NOTFOUND
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_INSTALL_PREFIX:PATH=/usr/local
CUDA_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-11.3
FETCHCONTENT_UPDATES_DISCONNECTED_SPAN-LITE:BOOL=OFF
GTest_DIR:PATH=GTest_DIR-NOTFOUND
MKL_Core_LINK_LIBRARY:FILEPATH=MKL_Core_LINK_LIBRARY-NOTFOUND
MKL_DIR:PATH=MKL_DIR-NOTFOUND
MKL_FFTW_INCLUDE_DIR:PATH=MKL_FFTW_INCLUDE_DIR-NOTFOUND
MKL_INCLUDE_DIR:PATH=MKL_INCLUDE_DIR-NOTFOUND
MKL_Interface_LINK_LIBRARY:FILEPATH=MKL_Interface_LINK_LIBRARY-NOTFOUND
MKL_RT_LINK_LIBRARY:FILEPATH=MKL_RT_LINK_LIBRARY-NOTFOUND
MKL_THREAD_LAYER:STRING=Intel OpenMP
MKL_ThreadLayer_LINK_LIBRARY:FILEPATH=MKL_ThreadLayer_LINK_LIBRARY-NOTFOUND
MKL_ThreadingLibrary_LINK_LIBRARY:FILEPATH=MKL_ThreadingLibrary_LINK_LIBRARY-NOTFOUND
MKL_mkl_avx2_LINK_LIBRARY:FILEPATH=MKL_mkl_avx2_LINK_LIBRARY-NOTFOUND
MKL_mkl_avx512_LINK_LIBRARY:FILEPATH=MKL_mkl_avx512_LINK_LIBRARY-NOTFOUND
MKL_mkl_avx_LINK_LIBRARY:FILEPATH=MKL_mkl_avx_LINK_LIBRARY-NOTFOUND
MKL_mkl_def_LINK_LIBRARY:FILEPATH=MKL_mkl_def_LINK_LIBRARY-NOTFOUND
MKL_mkl_mc3_LINK_LIBRARY:FILEPATH=MKL_mkl_mc3_LINK_LIBRARY-NOTFOUND
MKL_mkl_mc_LINK_LIBRARY:FILEPATH=MKL_mkl_mc_LINK_LIBRARY-NOTFOUND
NVPRUNE:FILEPATH=/usr/local/cuda-11.3/bin/nvprune
I'm running cmake .. -DCMAKE_BUILD_TYPE=Release -DAF_BUILD_OPENCL=OFF -DAF_BUILD_CPU=OFF -DAF_BUILD_EXAMPLES=OFF
Yet I get the error below: which indicated that arrayfire is still trying to use opencl anyways (which I don't have installed!)
Also the errors in the build seem to relate to the AF_COMPUTE_LIBRARY variable - yet wouldn't this be irrelevant since I'm not intending to use a CPU?
CMake Warning (dev) at CMakeLists.txt:64 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake
--help-policy CMP0146" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeModules/FindcuDNN.cmake:88 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake
--help-policy CMP0146" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
Call Stack (most recent call first):
CMakeLists.txt:65 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find cuDNN (missing: cuDNN_LINK_LIBRARY cuDNN_INCLUDE_DIRS) (Required is at least version "4.0")
-- Could NOT find OpenCL (missing: OpenCL_LIBRARY OpenCL_INCLUDE_DIR) (Required is at least version "1.2")
-- Could NOT find FreeImage (missing: FreeImage_INCLUDE_DIR FreeImage_LINK_LIBRARY)
-- Checking for module 'fftw3'
-- No package 'fftw3' found
-- Could NOT find FFTW (missing: FFTW_INCLUDE_DIR FFTW_LIBRARY FFTWF_LIBRARY)
-- Checking for module 'cblas'
-- No package 'cblas' found
-- Checking for [Accelerate]
-- Checking for [vecLib]
-- Checking for [cblas - atlas]
-- Checking for [openblas]
-- Checking for [cblas]
-- Checking for [blas]
-- CBLAS library not found.
-- Could NOT find LAPACKE (missing: LAPACKE_LIB LAPACKE_INCLUDES)
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- MKL: Thread Layer(Intel OpenMP) Interface(4-byte Integer)
-- Could NOT find MKL: Source the compilervars.sh or mklvars.sh scripts included with your installation of MKL. This script searches for the libraries in MKLROOT, LIBRARY_PATHS(Linux), and LIB(Windows) environment variables (missing: MKL_INCLUDE_DIR MKL_Core_LINK_LIBRARY MKL_Interface_LINK_LIBRARY MKL_ThreadLayer_LINK_LIBRARY)
-- Could NOT find MKL: Source the compilervars.sh or mklvars.sh scripts included with your installation of MKL. This script searches for the libraries in MKLROOT, LIBRARY_PATHS(Linux), and LIB(Windows) environment variables (missing: MKL_INCLUDE_DIR MKL_Core_STATIC_LINK_LIBRARY MKL_Interface_STATIC_LINK_LIBRARY MKL_ThreadLayer_STATIC_LINK_LIBRARY)
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
CMake Warning (dev) at CMakeLists.txt:81 (find_package):
Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake
--help-policy CMP0167" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning at CMakeLists.txt:144 (find_package):
By not providing "FindMKL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "MKL", but
CMake did not find one.
Could not find a package configuration file provided by "MKL" (requested
version 2023.1) with any of the following names:
MKLConfig.cmake
mkl-config.cmake
Add the installation prefix of "MKL" to CMAKE_PREFIX_PATH or set "MKL_DIR"
to a directory containing one of the above files. If "MKL" provides a
separate development package or SDK, be sure it has been installed.
-- Build spdlog: 1.9.2
-- Build type: Release
-- Project 'span_lite', package 'span-lite' version: '0.10.2'
-- Autodetected CUDA architecture(s): 8.6 8.6
-- Autodetected CUDA architecture(s): 8.6 8.6
-- Configuring done (3.1s)
CMake Error:
Error evaluating generator expression:
$<TARGET_PROPERTY:OpenCL::OpenCL,INTERFACE_INCLUDE_DIRECTORIES>
Target "OpenCL::OpenCL" not found.
-- Generating done (0.5s)
CMake Generate step failed. Build files cannot be regenerated correctly.
Upvotes: 2
Views: 199
Reputation: 61
So turns out my issue is already known by the ArrayFire development team, except this pull request to fix it hasn't yet been accepted. Please refer to this PR for the fix.
I made the changes from the PR myself and it built fine.
Upvotes: 1