diff --git a/0.build.sh b/0.build.sh index f11286fdeab1..c089b1db87ae 100755 --- a/0.build.sh +++ b/0.build.sh @@ -1,16 +1,16 @@ #!/bin/bash THEDIR=$(dirname $(readlink -e ${BASH_SOURCE[0]})) -. ${THEDIR}/0.env.sh +# . ${THEDIR}/0.env.sh cd ${THEDIR} export DPNP_DEBUG=1 python setup.py clean -python setup.py build_clib +DPLROOT=/opt/intel/oneapi/dpl/latest python setup.py build_clib # inplace build -python setup.py build_ext --inplace +CC=dpcpp python setup.py build_ext --inplace # development build. Root privileges needed # python setup.py develop diff --git a/conda-recipe/activate_env.sh b/conda-recipe/activate_env.sh deleted file mode 100644 index a004b335c79a..000000000000 --- a/conda-recipe/activate_env.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [ ! -z "${ONEAPI_ROOT}" ]; then - . ${ONEAPI_ROOT}/mkl/latest/env/vars.sh - . ${ONEAPI_ROOT}/compiler/2021.1-beta09/env/vars.sh - . ${ONEAPI_ROOT}/tbb/latest/env/vars.sh -fi diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index f631ded8b811..d873320f80f8 100644 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -3,9 +3,9 @@ # if ONEAPI_ROOT is specified (use all from it) if [ -n "${ONEAPI_ROOT}" ]; then export DPCPPROOT=${ONEAPI_ROOT}/compiler/latest - # TODO uncomment when CI will be changed - # export MKLROOT=${ONEAPI_ROOT}/mkl/latest + export MKLROOT=${ONEAPI_ROOT}/mkl/latest export TBBROOT=${ONEAPI_ROOT}/tbb/latest + export DPLROOT=${ONEAPI_ROOT}/dpl/latest fi # if DPCPPROOT is specified (work with custom DPCPP) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 6ea1470a5090..5abf8e057221 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -30,10 +30,11 @@ build: number: {{ GIT_DESCRIBE_NUMBER }} include_recipe: False script_env: - - _ONEAPI_ROOT # renamed for ignore in CI - - _DPCPPROOT # renamed for ignore in CI + - ONEAPI_ROOT + - DPCPPROOT - MKLROOT - TBBROOT + - DPLROOT - WHEELS_OUTPUT_FOLDER test: diff --git a/conda-recipe/run_test.sh b/conda-recipe/run_test.sh index 9aaa0ebc29ad..7780c9b98d14 100644 --- a/conda-recipe/run_test.sh +++ b/conda-recipe/run_test.sh @@ -3,9 +3,9 @@ # if ONEAPI_ROOT is specified (use all from it) if [ -n "${ONEAPI_ROOT}" ]; then export DPCPPROOT=${ONEAPI_ROOT}/compiler/latest - # TODO uncomment when CI will be changed - # export MKLROOT=${ONEAPI_ROOT}/mkl/latest + export MKLROOT=${ONEAPI_ROOT}/mkl/latest export TBBROOT=${ONEAPI_ROOT}/tbb/latest + export DPLROOT=${ONEAPI_ROOT}/dpl/latest fi # if DPCPPROOT is specified (work with custom DPCPP) diff --git a/dpnp/backend/CMakeLists.txt b/dpnp/backend/CMakeLists.txt index a39996e62e23..229f903dbcae 100644 --- a/dpnp/backend/CMakeLists.txt +++ b/dpnp/backend/CMakeLists.txt @@ -38,14 +38,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules") # ----------------------------------------------------------------------------------------------- if(DEFINED ENV{ONEAPI_ROOT}) set(DPNP_ONEAPI_ROOT "$ENV{ONEAPI_ROOT}" CACHE PATH "Folder contains oneapi tool set") -else() - if(UNIX) - set(DPNP_ONEAPI_ROOT "/opt/intel/oneapi" CACHE PATH "Folder contains oneapi tool set") - elseif(WIN32) - set(DPNP_ONEAPI_ROOT "C:/Program Files (x86)/Intel/oneAPI" CACHE PATH "Folder contains oneapi tool set") - else() - message(FATAL_ERROR "Unsupported system ${CMAKE_SYSTEM}") - endif() endif() option(DPNP_STATIC_LIB_ENABLE "Enable build DPNP static library" FALSE) @@ -253,8 +245,8 @@ target_link_libraries(dpnp_backend_c PUBLIC ${DPNP_MATHLIB_DEP_LIBS}) # Parallel STL from DPC++ if(NOT WIN32) - find_package(PSTL REQUIRED) - target_include_directories(dpnp_backend_c PUBLIC ${PSTL_INCLUDE_DIR}) + find_package(DPL REQUIRED) + target_include_directories(dpnp_backend_c PUBLIC ${DPL_INCLUDE_DIR}) endif() # SYCL queue manager diff --git a/dpnp/backend/cmake/Modules/FindPSTL.cmake b/dpnp/backend/cmake/Modules/FindDPL.cmake similarity index 66% rename from dpnp/backend/cmake/Modules/FindPSTL.cmake rename to dpnp/backend/cmake/Modules/FindDPL.cmake index 6babadf06b47..a5301e6fda97 100644 --- a/dpnp/backend/cmake/Modules/FindPSTL.cmake +++ b/dpnp/backend/cmake/Modules/FindDPL.cmake @@ -24,27 +24,30 @@ # ***************************************************************************** # The following variables are optionally searched for defaults -# PSTL_ROOT_DIR: Base directory where all components are found +# DPLROOT: Environment variable to specify custom search place +# ONEAPI_ROOT: Environment variable to specify search place from oneAPI # # The following are set after configuration is done: -# PSTL_FOUND -# PSTL_INCLUDE_DIR +# DPL_FOUND +# DPL_INCLUDE_DIR include(FindPackageHandleStandardArgs) -set(PSTL_ROOT_DIR - "${DPNP_ONEAPI_ROOT}/dpl" - CACHE PATH "Folder contains PSTL headers") +set(DPNP_ONEAPI_DPL "$ENV{DPNP_ONEAPI_ROOT}/dpl/latest" CACHE PATH "Folder contains DPL files from ONEAPI_ROOT") + +if(DEFINED ENV{DPLROOT}) + set(DPNP_DPLROOT "$ENV{DPLROOT}" CACHE PATH "Folder contains DPL files from DPLROOT") +endif() find_path( - PSTL_INCLUDE_DIR oneapi/dpl/algorithm - HINTS ENV CONDA_PREFIX ${PSTL_ROOT_DIR} # search order is important - PATH_SUFFIXES include latest/linux/include - DOC "Path to PSTL include files") + DPL_INCLUDE_DIR oneapi/dpl/algorithm + HINTS ${DPNP_DPLROOT} ${DPNP_ONEAPI_DPL} ENV CONDA_PREFIX ENV PREFIX # search order is important + PATH_SUFFIXES include linux/include + DOC "Path to DPL include files") -find_package_handle_standard_args(PSTL DEFAULT_MSG PSTL_INCLUDE_DIR) +find_package_handle_standard_args(DPL DEFAULT_MSG DPL_INCLUDE_DIR) -if(PSTL_FOUND) - message(STATUS "Found PSTL: (include: ${PSTL_INCLUDE_DIR})") - # mark_as_advanced(PSTL_ROOT_DIR PSTL_INCLUDE_DIR) +if(DPL_FOUND) + message(STATUS "Found DPL: (include: ${DPL_INCLUDE_DIR})") + # mark_as_advanced(DPNP_DPLROOT DPL_INCLUDE_DIR) endif() diff --git a/dpnp/backend/cmake/Modules/FindMathLib.cmake b/dpnp/backend/cmake/Modules/FindMathLib.cmake index 521e79ed3d1e..a5b5e1602e2e 100644 --- a/dpnp/backend/cmake/Modules/FindMathLib.cmake +++ b/dpnp/backend/cmake/Modules/FindMathLib.cmake @@ -24,7 +24,8 @@ # ***************************************************************************** # The following variables are optionally searched for defaults -# MATHLIB_ROOT_DIR: Base directory where all components are found +# MKLROOT: Environment variable to specify custom search place +# ONEAPI_ROOT: Environment variable to specify search place from oneAPI # # The following are set after configuration is done: # MATHLIB_FOUND @@ -33,9 +34,11 @@ include(FindPackageHandleStandardArgs) -set(MATHLIB_ROOT_DIR - "${DPNP_ONEAPI_ROOT}/mkl" - CACHE PATH "Folder contains mathlib") +set(DPNP_ONEAPI_MKL "$ENV{DPNP_ONEAPI_ROOT}/mkl/latest" CACHE PATH "Folder contains Math Lib files from ONEAPI_ROOT") + +if(DEFINED ENV{MKLROOT}) + set(DPNP_MKLROOT "$ENV{MKLROOT}" CACHE PATH "Folder contains Math Lib files from MKLROOT") +endif() if(UNIX) set(MATHLIB_SYCL_LIB @@ -51,14 +54,14 @@ endif() find_path( MATHLIB_INCLUDE_DIR oneapi/mkl.hpp - HINTS ENV CONDA_PREFIX ENV PREFIX ${MATHLIB_ROOT_DIR} # search order is important - PATH_SUFFIXES include latest/include + HINTS ${DPNP_MKLROOT} ${DPNP_ONEAPI_MKL} ENV CONDA_PREFIX ENV PREFIX # search order is important + PATH_SUFFIXES include include DOC "Path to mathlib include files") find_path( MATHLIB_LIBRARY_DIR ${MATHLIB_SYCL_LIB} - HINTS ENV CONDA_PREFIX ENV PREFIX ${MATHLIB_ROOT_DIR} # search order is important - PATH_SUFFIXES lib latest/lib/intel64 + HINTS ${DPNP_MKLROOT} ${DPNP_ONEAPI_MKL} ENV CONDA_PREFIX ENV PREFIX # search order is important + PATH_SUFFIXES lib lib/intel64 DOC "Path to mathlib library files") # TODO implement recurcive searching file (GLOB_RECURSE MY_PATH "/opt/intel/*/mkl.hpp") @@ -68,5 +71,5 @@ find_package_handle_standard_args(MathLib DEFAULT_MSG MATHLIB_INCLUDE_DIR MATHLI if(MathLib_FOUND) message(STATUS "Found MathLib: (include: ${MATHLIB_INCLUDE_DIR}, library: ${MATHLIB_LIBRARY_DIR})") - mark_as_advanced(MATHLIB_ROOT_DIR MATHLIB_INCLUDE_DIR MATHLIB_LIBRARY_DIR) + # mark_as_advanced(DPNP_MKLROOT MATHLIB_INCLUDE_DIR MATHLIB_LIBRARY_DIR) endif()