IntelPython / dpctl

Python SYCL bindings and SYCL-based Python Array API library
https://intelpython.github.io/dpctl/
Apache License 2.0
99 stars 29 forks source link

Could NOT find IntelSycl (missing: IntelSycl_SYCL_LIBRARY #1153

Open yurivict opened 1 year ago

yurivict commented 1 year ago

cmake first finds IntelSycl and then fails:

===>  Building for py39-dpctl-0.14.2
* Getting build dependencies for wheel...
* Building wheel...

--------------------------------------------------------------------------------
-- Trying 'Ninja' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- The C compiler identification is Clang 14.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/libexec/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is Clang 14.0.5
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/libexec/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2/_cmake_test_compile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Ninja' generator - success
--------------------------------------------------------------------------------

Configuring Project
  Working directory:
    /usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2/_skbuild/freebsd-13.1-STABLE-amd64-3.9/cmake-build
  Command:
    /usr/local/bin/cmake /usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2 -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2/_skbuild/freebsd-13.1-STABLE-amd64-3.9/cmake-install -DPYTHON_VERSION_STRING:STRING=3.9.16 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/usr/local/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/usr/local/bin/python3.9 -DPYTHON_INCLUDE_DIR:PATH=/usr/local/include/python3.9 -DPYTHON_LIBRARY:PATH=/usr/local/lib/libpython3.9.so -DPython_EXECUTABLE:PATH=/usr/local/bin/python3.9 -DPython_ROOT_DIR:PATH=/usr/local -DPython_INCLUDE_DIR:PATH=/usr/local/include/python3.9 -DPython_FIND_REGISTRY:STRING=NEVER -DPython_NumPy_INCLUDE_DIRS:PATH=/usr/local/lib/python3.9/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/usr/local/bin/python3.9 -DPython3_ROOT_DIR:PATH=/usr/local -DPython3_INCLUDE_DIR:PATH=/usr/local/include/python3.9 -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_NumPy_INCLUDE_DIRS:PATH=/usr/local/lib/python3.9/site-packages/numpy/core/include -DCMAKE_BUILD_TYPE:STRING=Release

-- The CXX compiler identification is Clang 14.0.5
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/libexec/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Echo from /usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2/IntelDPCPPConfig.cmake
-- The SYCL compiler is /usr/local/libexec/ccache/c++
-- The SYCL Flags are -fsycl 
-- The SYCL Language Version is 202001
-- Found IntelDPCPP: /usr/local/include (found version "202001") 
-- The C compiler identification is Clang 14.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/libexec/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /usr/local/bin/git (found version "2.40.0") 
-- Echo from /usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2/libsyclinterface/IntelDPCPPConfig.cmake
-- The SYCL compiler is /usr/local/libexec/ccache/c++
-- The SYCL Flags are -fsycl 
-- The SYCL Language Version is 202001
-- Echo from /usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2/libsyclinterface/IntelDPCPPConfig.cmake
-- The SYCL compiler is /usr/local/libexec/ccache/c++
-- The SYCL Flags are -fsycl 
-- The SYCL Language Version is 202001
-- dpcpp ver[0]: FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
-- dpcpp ver[1]: Target: x86_64-unknown-freebsd13.1
-- dpcpp ver[2]: Thread model: posix
-- dpcpp ver[3]: InstalledDir: /usr/bin
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find IntelSycl (missing: IntelSycl_SYCL_LIBRARY
  IntelSycl_OPENCL_LIBRARY)
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  libsyclinterface/cmake/modules/FindIntelSycl.cmake:160 (find_package_handle_standard_args)
  libsyclinterface/CMakeLists.txt:49 (find_package)

-- Configuring incomplete, errors occurred!
See also "/usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2/_skbuild/freebsd-13.1-STABLE-amd64-3.9/cmake-build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 634, in setup
    env = cmkr.configure(
  File "/usr/local/lib/python3.9/site-packages/skbuild/cmaker.py", line 332, in configure
    raise SKBuildError(

An error occurred while configuring with CMake.
  Command:
    /usr/local/bin/cmake /usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2 -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2/_skbuild/freebsd-13.1-STABLE-amd64-3.9/cmake-install -DPYTHON_VERSION_STRING:STRING=3.9.16 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/usr/local/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/usr/local/bin/python3.9 -DPYTHON_INCLUDE_DIR:PATH=/usr/local/include/python3.9 -DPYTHON_LIBRARY:PATH=/usr/local/lib/libpython3.9.so -DPython_EXECUTABLE:PATH=/usr/local/bin/python3.9 -DPython_ROOT_DIR:PATH=/usr/local -DPython_INCLUDE_DIR:PATH=/usr/local/include/python3.9 -DPython_FIND_REGISTRY:STRING=NEVER -DPython_NumPy_INCLUDE_DIRS:PATH=/usr/local/lib/python3.9/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/usr/local/bin/python3.9 -DPython3_ROOT_DIR:PATH=/usr/local -DPython3_INCLUDE_DIR:PATH=/usr/local/include/python3.9 -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_NumPy_INCLUDE_DIRS:PATH=/usr/local/lib/python3.9/site-packages/numpy/core/include -DCMAKE_BUILD_TYPE:STRING=Release
  Source directory:
    /usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2
  Working directory:
    /usr/ports/misc/py-dpctl/work-py39/dpctl-0.14.2/_skbuild/freebsd-13.1-STABLE-amd64-3.9/cmake-build
Please see CMake's output for more information.

ERROR Backend subprocess exited when trying to invoke build_wheel
*** Error code 1

Version: 0.14.2 opensycl-0.9.4 cmake-3.25.1 Python-3.9 FreeBSD 13.1

oleksandr-pavlyk commented 1 year ago

@yurivict Thank you for the report. It appears that our cmake script is failing to locate libraries libsycl.so and libOpenCL.so in the folder SYCL_LIBRARY_DIR as set by find_package(IntelDPCPP REQUIRED).

The SYCL_LIBRARY_DIR is found as follows:

  find_file(SYCL_LIBRARY_DIR
    NAMES
      lib lib64
    HINTS
      ${SYCL_PACKAGE_DIR} $ENV{SYCL_LIBRARY_DIR_HINT}
    NO_DEFAULT_PATH
      )

Where the SYCL_PACKAGE_DIR is the parent folder of the bin/ folder containing the compiler executable.

The expected compiler layout is aligned with that of oneAPI DPC++, or open-source SYCL bundle downloadable from https://github.com/intel/llvm/releases

If the opensycl layout is different, perhaps use SYCL_LIBRARY_DIR_HINT environment variable to assist cmake in locating the library directory.

Please do let us know if you are running into additional issues.