Skip to content

Building with oneAPI for non-standard compiler installation #480

Closed

Description

@oleksandr-pavlyk

For the default value of --sycl-compiler-prefix option to develop/install setup commands we require ONEAPI_ROOT and do not set DPCTL_CUSTOM_DPCPP_INSTALL_DIR.

The logic is all built assuming that setting DPCTL_CUSTOM_DPCPP_INSTALL_DIR signals use of custom-built DPC++ toolchain.

When oneAPI compiler bits are installed into Python environment, we can not use ONEAPI_ROOT, since compiler's location is no longer ${ONEAPI_ROOT}/compiler/latest/linux but ${CONDA_PREFIX} instead, and must rely on --sycl-compiler-prefix which sets DPCTL_CUSTOM_DPCPP_INSTALL_DIR and CMake script starts assuming that we build with OS DPC++ toolchain.

@AndresGuzman-Ballen

Activity

  1. changed the title [-]Building with oneAPI without ONEAPI_ROOT[/-] [+]Building with oneAPI for non-standard compiler installation[/+] on May 27, 2021
  2. diptorupd commented on May 27, 2021

    @diptorupd
    Contributor

    I propose the following: in FindIntelSycl.cmake the option DPCTL_CUSTOM_DPCPP_INSTALL_DIR should only indicate the compiler root that may or may not be a oneAPI installation. We rename it to DPCTL_DPCPP_HOME_DIR

    Next we add another CMake option: DPCTL_DPCPP_FROM_ONEAPI=ON that will indicate that the DPCTL_DPCPP_HOME_DIR is a oneAPI install. For using a truly custom Intel Sycl compiler, we will need to set DPCTL_DPCPP_FROM_ONEAPI=OFF.

  3. oleksandr-pavlyk commented on May 27, 2021

    @oleksandr-pavlyk
    ContributorAuthor

    I like the renaming idea. In #481 I implemented detection of oneAPI by matching for "dpcpp" in ${CMAKE_CXX_COMPILER}.

  4. diptorupd commented on May 27, 2021

    @diptorupd
    Contributor

    We will need to add a setup.py option too to setup the flag to indicate we use custom compiler.

  5. oleksandr-pavlyk commented on May 27, 2021

    @oleksandr-pavlyk
    ContributorAuthor

    In FindIntelSycl we query clang or dpcpp to query version. We can drop this branching. clang --version will give the right version. In oneAPI:

    (idp) [10:15:53 ansatnuc04 dpctl-capi]$ clang --version
    Intel(R) oneAPI DPC++ Compiler 2021.2.0 (2021.2.0.20210317)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /localdisk/intel/oneapi/compiler/2021.2.0/linux/bin
    

    In DPC++ toolchain:

    (build_sycl) [10:17:03 ansatnuc04 sycl_workspace]$ export PATH=$DPCPP_HOME/llvm/build/bin:$PATH
    (build_sycl) [10:18:15 ansatnuc04 sycl_workspace]$ export LD_LIBRARY_PATH=$DPCPP_HOME/llvm/build/lib:$LD_LIBRARY_PATH
    (build_sycl) [10:18:16 ansatnuc04 sycl_workspace]$ clang --version
    clang version 13.0.0 (https://github.com/intel/llvm 9b61592812e3a58d8d1b995cc0fef730cd817d43)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /localdisk/work/opavlyk/sycl_workspace/llvm/build/bin
    
  6. oleksandr-pavlyk commented on May 27, 2021

    @oleksandr-pavlyk
    ContributorAuthor

    The only other branching is the minimum version we require.

  7. oleksandr-pavlyk commented on May 27, 2021

    @oleksandr-pavlyk
    ContributorAuthor

    Implemented in both DPCTL_DPCPP_HOME_DIR and DPCTL_DPCPP_FROM_ONEAPI in #481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions