From a12e1342edaa20e371bc8c0f12c582b6ed254fc0 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Wed, 6 Nov 2024 00:40:17 -0800 Subject: [PATCH 01/23] rm libonedal_sycl --- BUILD | 1 - makefile | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/BUILD b/BUILD index 1e40ec7a410..69959673d50 100644 --- a/BUILD +++ b/BUILD @@ -34,7 +34,6 @@ release( "@onedal//cpp/oneapi/dal:dynamic_dpc", "@onedal//cpp/oneapi/dal:static_parameters_dpc", "@onedal//cpp/oneapi/dal:dynamic_parameters_dpc", - # TODO: Add onedal_sycl ], "//conditions:default": [], }), diff --git a/makefile b/makefile index 91922e98f0b..50c0d1cc740 100644 --- a/makefile +++ b/makefile @@ -990,19 +990,6 @@ $(foreach x,$(release.PARAMETERS.LIBS_Y.dpc),$(eval $(call .release.y_win,$x,$(R endif endif -ifneq ($(MKLGPUDIR),) -# Copies the file to the destination directory and renames daal -> onedal -# $1: Path to the file to be copied -# $2: Destination directory -define .release.sycl.old -_release_common: $2/$(subst mkl_sycl$d.$a,onedal_sycl$d.$a,$(notdir $1)) -$2/$(subst mkl_sycl$d.$a,onedal_sycl$d.$a,$(notdir $1)): $(call frompf1,$1) | $2/. ; $(value cpy) -endef - -$(foreach t,$(mklgpu.HEADERS),$(eval $(call .release.sycl.old,$t,$(RELEASEDIR.include.mklgpu)))) -$(foreach t,$(daaldep.math_backend.sycl), $(eval $(call .release.sycl.old,$t,$(RELEASEDIR.libia)))) -endif - _release_c: ./deploy/pkg-config/pkg-config.tpl python ./deploy/pkg-config/generate_pkgconfig.py --output_dir $(RELEASEDIR.pkgconfig) --template_name ./deploy/pkg-config/pkg-config.tpl From 18d8e39b484073d87e93c8f32eed94ff9974b549 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Wed, 6 Nov 2024 02:55:55 -0800 Subject: [PATCH 02/23] fixes --- dev/bazel/deps/onedal.bzl | 1 - dev/bazel/deps/onedal.tpl.BUILD | 12 ------------ docs/source/onedal/build_app/build-application.rst | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/dev/bazel/deps/onedal.bzl b/dev/bazel/deps/onedal.bzl index f8ea37776fc..807ee94b5d5 100644 --- a/dev/bazel/deps/onedal.bzl +++ b/dev/bazel/deps/onedal.bzl @@ -26,7 +26,6 @@ onedal_repo = repos.prebuilt_libs_repo_rule( "lib/intel64/libonedal_thread.a", "lib/intel64/libonedal.a", "lib/intel64/libonedal_dpc.a", - "lib/intel64/libonedal_sycl.a", "lib/intel64/libonedal_parameters.a", "lib/intel64/libonedal_parameters_dpc.a", diff --git a/dev/bazel/deps/onedal.tpl.BUILD b/dev/bazel/deps/onedal.tpl.BUILD index 94632276eb6..3a0d617dab1 100644 --- a/dev/bazel/deps/onedal.tpl.BUILD +++ b/dev/bazel/deps/onedal.tpl.BUILD @@ -34,16 +34,6 @@ cc_library( ], ) -cc_library( - name = "onedal_sycl", - srcs = [ - "lib/intel64/libonedal_sycl.a", - ], - deps = [ - ":headers", - ], -) - cc_library( name = "parameters_static", srcs = [ @@ -82,7 +72,6 @@ cc_library( ], deps = [ ":headers", - ":onedal_sycl", ":parameters_static_dpc", ], ) @@ -150,7 +139,6 @@ cc_library( ], deps = [ ":headers", - ":onedal_sycl", ":parameters_dynamic_dpc", ], ) diff --git a/docs/source/onedal/build_app/build-application.rst b/docs/source/onedal/build_app/build-application.rst index 4092a3256ad..b774e56743a 100644 --- a/docs/source/onedal/build_app/build-application.rst +++ b/docs/source/onedal/build_app/build-application.rst @@ -68,7 +68,7 @@ Applications on Linux* OS .. code-block:: text - /dal/latest/lib/libonedal_sycl.a + /mkl/latest/lib/libmkl_sycl.a .. _app_on_win: From 5ede9a46fbca33a515e0107c27884eb2ec4f185e Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Wed, 6 Nov 2024 05:37:11 -0800 Subject: [PATCH 03/23] fixes --- cmake/templates/oneDALConfig.cmake.in | 23 +++++++++++++++++------ samples/oneapi/dpc/ccl/makefile_lnx | 5 +++-- samples/oneapi/dpc/mpi/makefile_lnx | 7 ++++--- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index 397a7b73669..8b832796d07 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -61,8 +61,14 @@ if(NOT DEFINED ONEDAL_SET_TBB_MANUALLY AND DEFINED SET_TBB_MANUALLY) set(ONEDAL_SET_TBB_MANUALLY ${SET_TBB_MANUALLY}) endif() -if ("${ONEDAL_LINK}" STREQUAL "") +if ("${ONEDAL_LINK}" STREQUAL "" OR "${ONEDAL_LINK}" STREQUAL "dynamic") set(ONEDAL_LINK "dynamic") + set(MKL_SYCL_LINK "dynamic") + set(MKL_LINK "dynamic") +elseif ("${ONEDAL_LINK}" STREQUAL "static") + set(ONEDAL_LINK "static") + set(MKL_SYCL_LINK "static") + set(MKL_LINK "static") elseif (NOT "${ONEDAL_LINK}" STREQUAL "static" AND NOT "${ONEDAL_LINK}" STREQUAL "dynamic") message(FATAL_ERROR "ONEDAL_LINK must be 'static' or 'dynamic'") endif() @@ -116,15 +122,20 @@ elseif (@VERSIONS_SET@ STREQUAL "FALSE") string(REGEX REPLACE ".*#define __INTEL_DAAL_MINOR_BINARY__ ([0-9]+).*" "\\1" _dal_ver_minor_bin "${DAL_VERSION_INFO}") endif() +set(MKL_THREADING "tbb_thread") +find_package(MKL REQUIRED MKL::MKL_SYCL) + + if (ONEDAL_USE_DPCPP STREQUAL "yes" AND ONEDAL_INTERFACE STREQUAL "no") - list(APPEND DAL_LIBS onedal_sycl${DAL_DEBUG_SUFFIX}) + list(APPEND oneDAL_IMPORTED_TARGETS MKL::mkl_sycl${DAL_DEBUG_SUFFIX}) elseif (ONEDAL_USE_DPCPP STREQUAL "no" AND ONEDAL_INTERFACE STREQUAL "yes") list(APPEND DAL_LIBS onedal${DAL_DEBUG_SUFFIX}) if(ONEDAL_USE_PARAMETERS_LIBRARY) list(APPEND DAL_LIBS onedal_parameters${DAL_DEBUG_SUFFIX}) endif() elseif (ONEDAL_USE_DPCPP STREQUAL "yes" AND ONEDAL_INTERFACE STREQUAL "yes") - list(APPEND DAL_LIBS onedal_dpc${DAL_DEBUG_SUFFIX} onedal_sycl${DAL_DEBUG_SUFFIX}) + list(APPEND DAL_LIBS onedal_dpc${DAL_DEBUG_SUFFIX}) + list(APPEND oneDAL_IMPORTED_TARGETS MKL::mkl_sycl${DAL_DEBUG_SUFFIX}) if(ONEDAL_USE_PARAMETERS_LIBRARY) list(APPEND DAL_LIBS onedal_parameters_dpc${DAL_DEBUG_SUFFIX}) endif() @@ -134,7 +145,7 @@ list(APPEND DAL_LIBS onedal_core${DAL_DEBUG_SUFFIX}) set(THREADING_TYPE "parallel") set(DAL_THREAD_LIBRARY_NAME onedal_thread${DAL_DEBUG_SUFFIX}) - + if (ONEDAL_SET_TBB_MANUALLY STREQUAL "no") find_package(TBB REQUIRED tbb tbbmalloc) if (NOT TBB_IMPORTED_TARGETS) @@ -212,7 +223,7 @@ foreach (_dal_component ${DAL_LIBS}) set(oneDAL_${_dal_component}_FOUND 0) - if (${ONEDAL_LINK} STREQUAL "static" OR ${_dal_component} STREQUAL "onedal_sycl") + if (${ONEDAL_LINK} STREQUAL "static") add_library(oneDAL::${_dal_component} STATIC IMPORTED) find_library( _dal_lib @@ -233,7 +244,7 @@ foreach (_dal_component ${DAL_LIBS}) INTERFACE_INCLUDE_DIRECTORIES "${_dal_include_dir}") unset(_dal_include_dir) - if (WIN32 AND ${ONEDAL_LINK} STREQUAL "dynamic" AND NOT ${_dal_component} STREQUAL "onedal_sycl") + if (WIN32 AND ${ONEDAL_LINK} STREQUAL "dynamic") find_file(${_dal_component}_dll ${_dal_component}.${_dal_ver_major_bin}.dll PATHS "${_dal_root}/@DLL_REL_PATH@") set_target_properties(oneDAL::${_dal_component} PROPERTIES IMPORTED_LOCATION "${${_dal_component}_dll}" diff --git a/samples/oneapi/dpc/ccl/makefile_lnx b/samples/oneapi/dpc/ccl/makefile_lnx index 41066086b5c..229da5a95d1 100644 --- a/samples/oneapi/dpc/ccl/makefile_lnx +++ b/samples/oneapi/dpc/ccl/makefile_lnx @@ -81,18 +81,19 @@ endif MPI_PATH = $(I_MPI_ROOT) CCL_PATH = $(CCL_ROOT) +MKL_PATH = $(MKL_ROOT) ifeq ($(RES_EXT),so) ONEDAL_LIBS := -lonedal_dpc \ -lonedal_core \ -lonedal_thread \ -lonedal_parameters_dpc \ - "$(DAAL_PATH)"/libonedal_sycl.a + "$(MKL_PATH)"/libmkl_sycl.a else ONEDAL_LIBS := "$(DAAL_PATH)"/libonedal_dpc.a \ "$(DAAL_PATH)"/libonedal_core.a \ "$(DAAL_PATH)"/libonedal_thread.a \ - "$(DAAL_PATH)"/libonedal_sycl.a \ + "$(MKL_PATH)"/libmkl_sycl.a \ "$(DAAL_PATH)"/libonedal_parameters_dpc.a endif diff --git a/samples/oneapi/dpc/mpi/makefile_lnx b/samples/oneapi/dpc/mpi/makefile_lnx index e22e9e9872f..f580d004c62 100644 --- a/samples/oneapi/dpc/mpi/makefile_lnx +++ b/samples/oneapi/dpc/mpi/makefile_lnx @@ -74,19 +74,20 @@ else endif MPI_PATH = $(I_MPI_ROOT) +MKL_PATH = $(MKL_ROOT) ifeq ($(RES_EXT),so) ONEDAL_LIBS := -lonedal_dpc \ -lonedal_core \ -lonedal_thread \ -lonedal_parameters_dpc \ - "$(DAAL_PATH)"/libonedal_sycl.a + "$(MKL_PATH)"/libmkl_sycl.a else ONEDAL_LIBS := "$(DAAL_PATH)"/libonedal_dpc.a \ "$(DAAL_PATH)"/libonedal_core.a \ "$(DAAL_PATH)"/libonedal_thread.a \ - "$(DAAL_PATH)"/libonedal_sycl.a \ - "$(DAAL_PATH)"/libonedal_parameters_dpc.a + "$(DAAL_PATH)"/libonedal_parameters_dpc.a \ + "$(MKL_PATH)"/libmkl_sycl.a endif COPTS := -std=c++17 \ From a37c02541edfde9afb4579802041458f06ea8b2c Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Wed, 6 Nov 2024 07:11:49 -0800 Subject: [PATCH 04/23] fixes --- cmake/templates/oneDALConfig.cmake.in | 4 ++-- dev/bazel/deps/onedal.tpl.BUILD | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index 8b832796d07..08b8858b5da 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -63,8 +63,8 @@ endif() if ("${ONEDAL_LINK}" STREQUAL "" OR "${ONEDAL_LINK}" STREQUAL "dynamic") set(ONEDAL_LINK "dynamic") - set(MKL_SYCL_LINK "dynamic") - set(MKL_LINK "dynamic") + set(MKL_SYCL_LINK "static") + set(MKL_LINK "static") elseif ("${ONEDAL_LINK}" STREQUAL "static") set(ONEDAL_LINK "static") set(MKL_SYCL_LINK "static") diff --git a/dev/bazel/deps/onedal.tpl.BUILD b/dev/bazel/deps/onedal.tpl.BUILD index 3a0d617dab1..439cf78be00 100644 --- a/dev/bazel/deps/onedal.tpl.BUILD +++ b/dev/bazel/deps/onedal.tpl.BUILD @@ -72,6 +72,7 @@ cc_library( ], deps = [ ":headers", + "@mkl//:mkl_dpc", ":parameters_static_dpc", ], ) @@ -139,6 +140,7 @@ cc_library( ], deps = [ ":headers", + "@mkl//:mkl_dpc", ":parameters_dynamic_dpc", ], ) From 47e0c344a6ecd8e19c3894d4470769e569172aed Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Wed, 6 Nov 2024 08:57:03 -0800 Subject: [PATCH 05/23] fix for samples --- samples/oneapi/dpc/ccl/makefile_lnx | 38 +++++++++++++++++++---------- samples/oneapi/dpc/mpi/makefile_lnx | 36 ++++++++++++++++++--------- 2 files changed, 49 insertions(+), 25 deletions(-) diff --git a/samples/oneapi/dpc/ccl/makefile_lnx b/samples/oneapi/dpc/ccl/makefile_lnx index 229da5a95d1..ba12fea91e2 100644 --- a/samples/oneapi/dpc/ccl/makefile_lnx +++ b/samples/oneapi/dpc/ccl/makefile_lnx @@ -82,18 +82,18 @@ endif MPI_PATH = $(I_MPI_ROOT) CCL_PATH = $(CCL_ROOT) MKL_PATH = $(MKL_ROOT) +set(MKL_SYCL_LINK "static") +set(MKL_LINK "static") ifeq ($(RES_EXT),so) ONEDAL_LIBS := -lonedal_dpc \ -lonedal_core \ -lonedal_thread \ - -lonedal_parameters_dpc \ - "$(MKL_PATH)"/libmkl_sycl.a + -lonedal_parameters_dpc else ONEDAL_LIBS := "$(DAAL_PATH)"/libonedal_dpc.a \ "$(DAAL_PATH)"/libonedal_core.a \ "$(DAAL_PATH)"/libonedal_thread.a \ - "$(MKL_PATH)"/libmkl_sycl.a \ "$(DAAL_PATH)"/libonedal_parameters_dpc.a endif @@ -106,6 +106,28 @@ else CCL_INCLUDE_PATH = $(CCL_PATH)/include/oneapi endif +ifeq ($(RES_EXT),so) + LIBS := $(ONEDAL_LIBS) \ + -lmkl_sycl \ + -lmpicxx \ + -lmpi \ + -lccl \ + -ltbb \ + -ltbbmalloc \ + -lpthread \ + -lOpenCL \ + -ldl +else + LIBS := $(ONEDAL_LIBS) \ + -lmpicxx \ + -lmpi \ + -lccl \ + -ltbb \ + -ltbbmalloc \ + -lpthread \ + -lOpenCL \ + -ldl +endif COPTS := -std=c++17 \ -pedantic \ -Wall \ @@ -117,16 +139,6 @@ COPTS := -std=c++17 \ -I$(CCL_INCLUDE_PATH) \ -I"$(DALROOT)/include" -LIBS := $(ONEDAL_LIBS) \ - -lmpicxx \ - -lmpi \ - -lccl \ - -ltbb \ - -ltbbmalloc \ - -lpthread \ - -lOpenCL \ - -ldl - LOPTS := -L"$(DAAL_PATH)" \ -L"$(TBB_PATH)" \ -L"$(MPI_PATH)" \ diff --git a/samples/oneapi/dpc/mpi/makefile_lnx b/samples/oneapi/dpc/mpi/makefile_lnx index f580d004c62..05a75cbfe78 100644 --- a/samples/oneapi/dpc/mpi/makefile_lnx +++ b/samples/oneapi/dpc/mpi/makefile_lnx @@ -75,19 +75,19 @@ endif MPI_PATH = $(I_MPI_ROOT) MKL_PATH = $(MKL_ROOT) +set(MKL_SYCL_LINK "static") +set(MKL_LINK "static") ifeq ($(RES_EXT),so) ONEDAL_LIBS := -lonedal_dpc \ -lonedal_core \ -lonedal_thread \ - -lonedal_parameters_dpc \ - "$(MKL_PATH)"/libmkl_sycl.a + -lonedal_parameters_dpc else ONEDAL_LIBS := "$(DAAL_PATH)"/libonedal_dpc.a \ "$(DAAL_PATH)"/libonedal_core.a \ "$(DAAL_PATH)"/libonedal_thread.a \ - "$(DAAL_PATH)"/libonedal_parameters_dpc.a \ - "$(MKL_PATH)"/libmkl_sycl.a + "$(DAAL_PATH)"/libonedal_parameters_dpc.a endif COPTS := -std=c++17 \ @@ -101,14 +101,26 @@ COPTS := -std=c++17 \ -I$(MPI_PATH)/include \ -I"$(DALROOT)/include" -LIBS := $(ONEDAL_LIBS) \ - -lmpicxx \ - -lmpi \ - -ltbb \ - -ltbbmalloc \ - -lpthread \ - -lOpenCL \ - -ldl +ifeq ($(RES_EXT),so) + LIBS := $(ONEDAL_LIBS) \ + -lmkl_sycl \ + -lmpicxx \ + -lmpi \ + -ltbb \ + -ltbbmalloc \ + -lpthread \ + -lOpenCL \ + -ldl +else + LIBS := $(ONEDAL_LIBS) \ + -lmpicxx \ + -lmpi \ + -ltbb \ + -ltbbmalloc \ + -lpthread \ + -lOpenCL \ + -ldl +endif LOPTS := -L"$(DAAL_PATH)" \ -L"$(TBB_PATH)" \ From 0a9b94c0e5cc79e6dcd5bd970900fc64f892fcb6 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Thu, 7 Nov 2024 05:47:56 -0800 Subject: [PATCH 06/23] fixes --- .ci/pipeline/ci.yml | 8 +++++++ cmake/templates/oneDALConfig.cmake.in | 34 ++++++++++++++++++++------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.ci/pipeline/ci.yml b/.ci/pipeline/ci.yml index 227bc890af7..78e7c2d0c48 100755 --- a/.ci/pipeline/ci.yml +++ b/.ci/pipeline/ci.yml @@ -163,6 +163,7 @@ jobs: export QEMU_CPU="max,sve-default-vector-length=256" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=aarch64 + export MATH_BACKEND=ref .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler gnu --interface daal/cpp --build-system cmake --platform lnxarm --cross-compile --backend ref displayName: 'daal/cpp examples' - script: | @@ -170,6 +171,7 @@ jobs: export QEMU_CPU="max,sve-default-vector-length=256" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=aarch64 + export MATH_BACKEND=ref .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler gnu --interface oneapi/cpp --build-system cmake --platform lnxarm --cross-compile --backend ref displayName: 'oneapi/cpp examples' - task: PublishPipelineArtifact@1 @@ -251,6 +253,7 @@ jobs: export QEMU_CPU="max,sve-default-vector-length=256" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=aarch64 + export MATH_BACKEND=ref export ONEDAL_SYSROOT=$(SYSROOT_CACHE_DIR) .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface daal/cpp --build-system cmake --platform lnxarm --cross-compile --backend ref displayName: 'daal/cpp examples' @@ -259,6 +262,7 @@ jobs: export QEMU_CPU="max,sve-default-vector-length=256" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=aarch64 + export MATH_BACKEND=ref export ONEDAL_SYSROOT=$(SYSROOT_CACHE_DIR) .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface oneapi/cpp --build-system cmake --platform lnxarm --cross-compile --backend ref displayName: 'oneapi/cpp examples' @@ -343,6 +347,7 @@ jobs: export QEMU_CPU="max" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=riscv64 + export MATH_BACKEND=ref export ONEDAL_SYSROOT=$(SYSROOT_CACHE_DIR) .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface daal/cpp --build-system cmake --platform lnxriscv64 --cross-compile --backend ref displayName: 'daal/cpp examples' @@ -351,6 +356,7 @@ jobs: export QEMU_CPU="max" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=riscv64 + export MATH_BACKEND=ref export ONEDAL_SYSROOT=$(SYSROOT_CACHE_DIR) .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface oneapi/cpp --build-system cmake --platform lnxriscv64 --cross-compile --backend ref displayName: 'oneapi/cpp examples' @@ -399,9 +405,11 @@ jobs: displayName: 'Upload build artifacts' continueOnError: true - script: | + export MATH_BACKEND=ref .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler gnu --interface daal/cpp --build-system cmake --backend ref displayName: 'daal/cpp examples' - script: | + export MATH_BACKEND=ref .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler gnu --interface oneapi/cpp --build-system cmake --backend ref displayName: 'oneapi/cpp examples' - task: PublishPipelineArtifact@1 diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index 08b8858b5da..4226524b282 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -29,6 +29,8 @@ endif() # ONEDAL_USE_DPCPP: yes | no. Default is yes # ONEDAL_INTERFACE: yes | no. Default is no # ONEDAL_SET_TBB_MANUALLY: yes | no. Default is no +# MKL_DEPENDENCY: yes | no. Default is no +# MATH_BACKEND: mkl | ref. Default is mkl unset(DAL_LIBS) # default CMAKE_BUILD_TYPE to Release @@ -61,14 +63,20 @@ if(NOT DEFINED ONEDAL_SET_TBB_MANUALLY AND DEFINED SET_TBB_MANUALLY) set(ONEDAL_SET_TBB_MANUALLY ${SET_TBB_MANUALLY}) endif() +if ("${MATH_BACKEND}" STREQUAL "" OR "${MATH_BACKEND}" STREQUAL "mkl") + set(MATH_BACKEND "mkl") +elseif ("${MATH_BACKEND}" STREQUAL "ref") + set(MATH_BACKEND "ref") +elseif (NOT "${MATH_BACKEND}" STREQUAL "mkl" AND NOT "${MATH_BACKEND}" STREQUAL "ref") + message(FATAL_ERROR "MATH_BACKEND must be 'mkl' or 'ref'") +endif() + if ("${ONEDAL_LINK}" STREQUAL "" OR "${ONEDAL_LINK}" STREQUAL "dynamic") set(ONEDAL_LINK "dynamic") - set(MKL_SYCL_LINK "static") - set(MKL_LINK "static") + set(MKL_DEPENDENCY "no") elseif ("${ONEDAL_LINK}" STREQUAL "static") set(ONEDAL_LINK "static") - set(MKL_SYCL_LINK "static") - set(MKL_LINK "static") + set(MKL_DEPENDENCY "yes") elseif (NOT "${ONEDAL_LINK}" STREQUAL "static" AND NOT "${ONEDAL_LINK}" STREQUAL "dynamic") message(FATAL_ERROR "ONEDAL_LINK must be 'static' or 'dynamic'") endif() @@ -98,6 +106,7 @@ message(STATUS "ONEDAL_LINK: ${ONEDAL_LINK}") message(STATUS "ONEDAL_USE_DPCPP: ${ONEDAL_USE_DPCPP}") message(STATUS "ONEDAL_INTERFACE: ${ONEDAL_INTERFACE}") message(STATUS "ONEDAL_SET_TBB_MANUALLY: ${ONEDAL_SET_TBB_MANUALLY}") +message(STATUS "MKL_DEPENDENCY: ${MKL_DEPENDENCY}") message(STATUS "ONEDAL_USE_DPCPP: ${ONEDAL_USE_DPCPP}") if (NOT DAL_LIBRARIES) @@ -122,12 +131,17 @@ elseif (@VERSIONS_SET@ STREQUAL "FALSE") string(REGEX REPLACE ".*#define __INTEL_DAAL_MINOR_BINARY__ ([0-9]+).*" "\\1" _dal_ver_minor_bin "${DAL_VERSION_INFO}") endif() -set(MKL_THREADING "tbb_thread") -find_package(MKL REQUIRED MKL::MKL_SYCL) - +if(MKL_DEPENDENCY STREQUAL "yes" AND MATH_BACKEND STREQUAL "mkl") + set(MKL_THREADING "tbb_thread") + set(MKL_SYCL_LINK "static") + set(MKL_LINK "static") + find_package(MKL REQUIRED MKL::MKL_SYCL) +endif() if (ONEDAL_USE_DPCPP STREQUAL "yes" AND ONEDAL_INTERFACE STREQUAL "no") - list(APPEND oneDAL_IMPORTED_TARGETS MKL::mkl_sycl${DAL_DEBUG_SUFFIX}) + if(MKL_DEPENDENCY STREQUAL "yes" AND MATH_BACKEND STREQUAL "mkl") + list(APPEND oneDAL_IMPORTED_TARGETS MKL::mkl_sycl${DAL_DEBUG_SUFFIX}) + endif() elseif (ONEDAL_USE_DPCPP STREQUAL "no" AND ONEDAL_INTERFACE STREQUAL "yes") list(APPEND DAL_LIBS onedal${DAL_DEBUG_SUFFIX}) if(ONEDAL_USE_PARAMETERS_LIBRARY) @@ -135,7 +149,9 @@ elseif (ONEDAL_USE_DPCPP STREQUAL "no" AND ONEDAL_INTERFACE STREQUAL "yes") endif() elseif (ONEDAL_USE_DPCPP STREQUAL "yes" AND ONEDAL_INTERFACE STREQUAL "yes") list(APPEND DAL_LIBS onedal_dpc${DAL_DEBUG_SUFFIX}) - list(APPEND oneDAL_IMPORTED_TARGETS MKL::mkl_sycl${DAL_DEBUG_SUFFIX}) + if(MKL_DEPENDENCY STREQUAL "yes" AND MATH_BACKEND STREQUAL "mkl") + list(APPEND oneDAL_IMPORTED_TARGETS MKL::mkl_sycl${DAL_DEBUG_SUFFIX}) + endif() if(ONEDAL_USE_PARAMETERS_LIBRARY) list(APPEND DAL_LIBS onedal_parameters_dpc${DAL_DEBUG_SUFFIX}) endif() From 8c2dad3ebf4e38269e8d6eaf79a490c7d98f21b8 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Mon, 11 Nov 2024 03:19:41 -0800 Subject: [PATCH 07/23] fixes for CI --- cmake/templates/oneDALConfig.cmake.in | 6 +++++- samples/oneapi/dpc/ccl/makefile_lnx | 2 +- samples/oneapi/dpc/mpi/makefile_lnx | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index 4226524b282..fc1b43d5ece 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -76,7 +76,11 @@ if ("${ONEDAL_LINK}" STREQUAL "" OR "${ONEDAL_LINK}" STREQUAL "dynamic") set(MKL_DEPENDENCY "no") elseif ("${ONEDAL_LINK}" STREQUAL "static") set(ONEDAL_LINK "static") - set(MKL_DEPENDENCY "yes") + if("${MATH_BACKEND}" STREQUAL "mkl") + set(MKL_DEPENDENCY "yes") + elseif("${MATH_BACKEND}" STREQUAL "ref") + set(MKL_DEPENDENCY "no") + endif() elseif (NOT "${ONEDAL_LINK}" STREQUAL "static" AND NOT "${ONEDAL_LINK}" STREQUAL "dynamic") message(FATAL_ERROR "ONEDAL_LINK must be 'static' or 'dynamic'") endif() diff --git a/samples/oneapi/dpc/ccl/makefile_lnx b/samples/oneapi/dpc/ccl/makefile_lnx index ba12fea91e2..ea770222ba2 100644 --- a/samples/oneapi/dpc/ccl/makefile_lnx +++ b/samples/oneapi/dpc/ccl/makefile_lnx @@ -108,7 +108,6 @@ endif ifeq ($(RES_EXT),so) LIBS := $(ONEDAL_LIBS) \ - -lmkl_sycl \ -lmpicxx \ -lmpi \ -lccl \ @@ -119,6 +118,7 @@ ifeq ($(RES_EXT),so) -ldl else LIBS := $(ONEDAL_LIBS) \ + -lmkl_sycl \ -lmpicxx \ -lmpi \ -lccl \ diff --git a/samples/oneapi/dpc/mpi/makefile_lnx b/samples/oneapi/dpc/mpi/makefile_lnx index 05a75cbfe78..114639774dd 100644 --- a/samples/oneapi/dpc/mpi/makefile_lnx +++ b/samples/oneapi/dpc/mpi/makefile_lnx @@ -103,7 +103,6 @@ COPTS := -std=c++17 \ ifeq ($(RES_EXT),so) LIBS := $(ONEDAL_LIBS) \ - -lmkl_sycl \ -lmpicxx \ -lmpi \ -ltbb \ @@ -113,6 +112,7 @@ ifeq ($(RES_EXT),so) -ldl else LIBS := $(ONEDAL_LIBS) \ + -lmkl_sycl \ -lmpicxx \ -lmpi \ -ltbb \ From 3096a2c09c8a5b4ffe0eb574e4fa743c4d3a4dc5 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Mon, 11 Nov 2024 05:26:48 -0800 Subject: [PATCH 08/23] fixes for cmake config --- .ci/pipeline/ci.yml | 8 -------- cmake/templates/oneDALConfig.cmake.in | 16 +++++++++------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.ci/pipeline/ci.yml b/.ci/pipeline/ci.yml index 8be7a1bf4c5..b0d1433d9d5 100755 --- a/.ci/pipeline/ci.yml +++ b/.ci/pipeline/ci.yml @@ -163,7 +163,6 @@ jobs: export QEMU_CPU="max,sve-default-vector-length=256" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=aarch64 - export MATH_BACKEND=ref .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler gnu --interface daal/cpp --build-system cmake --platform lnxarm --cross-compile --backend ref displayName: 'daal/cpp examples' - script: | @@ -171,7 +170,6 @@ jobs: export QEMU_CPU="max,sve-default-vector-length=256" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=aarch64 - export MATH_BACKEND=ref .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler gnu --interface oneapi/cpp --build-system cmake --platform lnxarm --cross-compile --backend ref displayName: 'oneapi/cpp examples' - task: PublishPipelineArtifact@1 @@ -253,7 +251,6 @@ jobs: export QEMU_CPU="max,sve-default-vector-length=256" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=aarch64 - export MATH_BACKEND=ref export ONEDAL_SYSROOT=$(SYSROOT_CACHE_DIR) .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface daal/cpp --build-system cmake --platform lnxarm --cross-compile --backend ref displayName: 'daal/cpp examples' @@ -262,7 +259,6 @@ jobs: export QEMU_CPU="max,sve-default-vector-length=256" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=aarch64 - export MATH_BACKEND=ref export ONEDAL_SYSROOT=$(SYSROOT_CACHE_DIR) .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface oneapi/cpp --build-system cmake --platform lnxarm --cross-compile --backend ref displayName: 'oneapi/cpp examples' @@ -347,7 +343,6 @@ jobs: export QEMU_CPU="max" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=riscv64 - export MATH_BACKEND=ref export ONEDAL_SYSROOT=$(SYSROOT_CACHE_DIR) .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface daal/cpp --build-system cmake --platform lnxriscv64 --cross-compile --backend ref displayName: 'daal/cpp examples' @@ -356,7 +351,6 @@ jobs: export QEMU_CPU="max" export TBBROOT=$(TBB_CACHE_DIR) export ARCH_ONEDAL=riscv64 - export MATH_BACKEND=ref export ONEDAL_SYSROOT=$(SYSROOT_CACHE_DIR) .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface oneapi/cpp --build-system cmake --platform lnxriscv64 --cross-compile --backend ref displayName: 'oneapi/cpp examples' @@ -405,11 +399,9 @@ jobs: displayName: 'Upload build artifacts' continueOnError: true - script: | - export MATH_BACKEND=ref .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler gnu --interface daal/cpp --build-system cmake --backend ref displayName: 'daal/cpp examples' - script: | - export MATH_BACKEND=ref .ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler gnu --interface oneapi/cpp --build-system cmake --backend ref displayName: 'oneapi/cpp examples' - task: PublishPipelineArtifact@1 diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index fc1b43d5ece..87e390ec0a6 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -63,12 +63,12 @@ if(NOT DEFINED ONEDAL_SET_TBB_MANUALLY AND DEFINED SET_TBB_MANUALLY) set(ONEDAL_SET_TBB_MANUALLY ${SET_TBB_MANUALLY}) endif() -if ("${MATH_BACKEND}" STREQUAL "" OR "${MATH_BACKEND}" STREQUAL "mkl") +if ("${REF_BACKEND}" STREQUAL "" OR "${REF_BACKEND}" STREQUAL "OFF") set(MATH_BACKEND "mkl") -elseif ("${MATH_BACKEND}" STREQUAL "ref") +if ("${REF_BACKEND}" STREQUAL "ON") set(MATH_BACKEND "ref") -elseif (NOT "${MATH_BACKEND}" STREQUAL "mkl" AND NOT "${MATH_BACKEND}" STREQUAL "ref") - message(FATAL_ERROR "MATH_BACKEND must be 'mkl' or 'ref'") +elseif (NOT "${REF_BACKEND}" STREQUAL "OFF" AND NOT "${REF_BACKEND}" STREQUAL "ON") + message(FATAL_ERROR "REF_BACKEND must be 'ON' or 'OFF'") endif() if ("${ONEDAL_LINK}" STREQUAL "" OR "${ONEDAL_LINK}" STREQUAL "dynamic") @@ -110,6 +110,8 @@ message(STATUS "ONEDAL_LINK: ${ONEDAL_LINK}") message(STATUS "ONEDAL_USE_DPCPP: ${ONEDAL_USE_DPCPP}") message(STATUS "ONEDAL_INTERFACE: ${ONEDAL_INTERFACE}") message(STATUS "ONEDAL_SET_TBB_MANUALLY: ${ONEDAL_SET_TBB_MANUALLY}") +message(STATUS "MATH_BACKEND: ${MATH_BACKEND}") +message(STATUS "REF_BACKEND: ${REF_BACKEND}") message(STATUS "MKL_DEPENDENCY: ${MKL_DEPENDENCY}") message(STATUS "ONEDAL_USE_DPCPP: ${ONEDAL_USE_DPCPP}") @@ -135,7 +137,7 @@ elseif (@VERSIONS_SET@ STREQUAL "FALSE") string(REGEX REPLACE ".*#define __INTEL_DAAL_MINOR_BINARY__ ([0-9]+).*" "\\1" _dal_ver_minor_bin "${DAL_VERSION_INFO}") endif() -if(MKL_DEPENDENCY STREQUAL "yes" AND MATH_BACKEND STREQUAL "mkl") +if(MKL_DEPENDENCY STREQUAL "yes") set(MKL_THREADING "tbb_thread") set(MKL_SYCL_LINK "static") set(MKL_LINK "static") @@ -143,7 +145,7 @@ if(MKL_DEPENDENCY STREQUAL "yes" AND MATH_BACKEND STREQUAL "mkl") endif() if (ONEDAL_USE_DPCPP STREQUAL "yes" AND ONEDAL_INTERFACE STREQUAL "no") - if(MKL_DEPENDENCY STREQUAL "yes" AND MATH_BACKEND STREQUAL "mkl") + if(MKL_DEPENDENCY STREQUAL "yes") list(APPEND oneDAL_IMPORTED_TARGETS MKL::mkl_sycl${DAL_DEBUG_SUFFIX}) endif() elseif (ONEDAL_USE_DPCPP STREQUAL "no" AND ONEDAL_INTERFACE STREQUAL "yes") @@ -153,7 +155,7 @@ elseif (ONEDAL_USE_DPCPP STREQUAL "no" AND ONEDAL_INTERFACE STREQUAL "yes") endif() elseif (ONEDAL_USE_DPCPP STREQUAL "yes" AND ONEDAL_INTERFACE STREQUAL "yes") list(APPEND DAL_LIBS onedal_dpc${DAL_DEBUG_SUFFIX}) - if(MKL_DEPENDENCY STREQUAL "yes" AND MATH_BACKEND STREQUAL "mkl") + if(MKL_DEPENDENCY STREQUAL "yes") list(APPEND oneDAL_IMPORTED_TARGETS MKL::mkl_sycl${DAL_DEBUG_SUFFIX}) endif() if(ONEDAL_USE_PARAMETERS_LIBRARY) From 5e972f30ce06123dd98587a9c22faa3af1fc62ba Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Mon, 11 Nov 2024 06:29:29 -0800 Subject: [PATCH 09/23] fixes --- cmake/templates/oneDALConfig.cmake.in | 2 +- .../get-started/build-and-run-examples.rst | 2 + samples/oneapi/dpc/ccl/makefile_lnx | 41 +++++++------------ samples/oneapi/dpc/mpi/makefile_lnx | 37 ++++++----------- 4 files changed, 31 insertions(+), 51 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index 87e390ec0a6..f1e20055fbd 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -65,7 +65,7 @@ endif() if ("${REF_BACKEND}" STREQUAL "" OR "${REF_BACKEND}" STREQUAL "OFF") set(MATH_BACKEND "mkl") -if ("${REF_BACKEND}" STREQUAL "ON") +elseif ("${REF_BACKEND}" STREQUAL "ON") set(MATH_BACKEND "ref") elseif (NOT "${REF_BACKEND}" STREQUAL "OFF" AND NOT "${REF_BACKEND}" STREQUAL "ON") message(FATAL_ERROR "REF_BACKEND must be 'ON' or 'OFF'") diff --git a/docs/source/get-started/build-and-run-examples.rst b/docs/source/get-started/build-and-run-examples.rst index aef14141ea9..160fb9d9bb4 100644 --- a/docs/source/get-started/build-and-run-examples.rst +++ b/docs/source/get-started/build-and-run-examples.rst @@ -76,6 +76,8 @@ basic usage scenarios of |short_name| with DPCPP. Go to #. Set up the compiler environment for |dpcpp|. See |dpcpp_gsg|_ for details. +#. Draft:For static applications and examples is necesasry to source oneMKL. + #. Build and run examples: .. note:: diff --git a/samples/oneapi/dpc/ccl/makefile_lnx b/samples/oneapi/dpc/ccl/makefile_lnx index ea770222ba2..4e14b4c6ff4 100644 --- a/samples/oneapi/dpc/ccl/makefile_lnx +++ b/samples/oneapi/dpc/ccl/makefile_lnx @@ -81,19 +81,20 @@ endif MPI_PATH = $(I_MPI_ROOT) CCL_PATH = $(CCL_ROOT) -MKL_PATH = $(MKL_ROOT) -set(MKL_SYCL_LINK "static") -set(MKL_LINK "static") +# This file uses an outdated build system that is no longer supported. +# Please use CMake for building, as dependencies for this file are not updated. ifeq ($(RES_EXT),so) ONEDAL_LIBS := -lonedal_dpc \ -lonedal_core \ -lonedal_thread \ - -lonedal_parameters_dpc + -lonedal_parameters_dpc \ + "$(DAAL_PATH)"/libonedal_sycl.a else ONEDAL_LIBS := "$(DAAL_PATH)"/libonedal_dpc.a \ "$(DAAL_PATH)"/libonedal_core.a \ "$(DAAL_PATH)"/libonedal_thread.a \ + "$(DAAL_PATH)"/libonedal_sycl.a \ "$(DAAL_PATH)"/libonedal_parameters_dpc.a endif @@ -106,28 +107,6 @@ else CCL_INCLUDE_PATH = $(CCL_PATH)/include/oneapi endif -ifeq ($(RES_EXT),so) - LIBS := $(ONEDAL_LIBS) \ - -lmpicxx \ - -lmpi \ - -lccl \ - -ltbb \ - -ltbbmalloc \ - -lpthread \ - -lOpenCL \ - -ldl -else - LIBS := $(ONEDAL_LIBS) \ - -lmkl_sycl \ - -lmpicxx \ - -lmpi \ - -lccl \ - -ltbb \ - -ltbbmalloc \ - -lpthread \ - -lOpenCL \ - -ldl -endif COPTS := -std=c++17 \ -pedantic \ -Wall \ @@ -139,6 +118,16 @@ COPTS := -std=c++17 \ -I$(CCL_INCLUDE_PATH) \ -I"$(DALROOT)/include" +LIBS := $(ONEDAL_LIBS) \ + -lmpicxx \ + -lmpi \ + -lccl \ + -ltbb \ + -ltbbmalloc \ + -lpthread \ + -lOpenCL \ + -ldl + LOPTS := -L"$(DAAL_PATH)" \ -L"$(TBB_PATH)" \ -L"$(MPI_PATH)" \ diff --git a/samples/oneapi/dpc/mpi/makefile_lnx b/samples/oneapi/dpc/mpi/makefile_lnx index 114639774dd..a06f67889f2 100644 --- a/samples/oneapi/dpc/mpi/makefile_lnx +++ b/samples/oneapi/dpc/mpi/makefile_lnx @@ -74,19 +74,20 @@ else endif MPI_PATH = $(I_MPI_ROOT) -MKL_PATH = $(MKL_ROOT) -set(MKL_SYCL_LINK "static") -set(MKL_LINK "static") +# This file uses an outdated build system that is no longer supported. +# Please use CMake for building, as dependencies for this file are not updated. ifeq ($(RES_EXT),so) ONEDAL_LIBS := -lonedal_dpc \ -lonedal_core \ -lonedal_thread \ - -lonedal_parameters_dpc + -lonedal_parameters_dpc \ + "$(DAAL_PATH)"/libonedal_sycl.a else ONEDAL_LIBS := "$(DAAL_PATH)"/libonedal_dpc.a \ "$(DAAL_PATH)"/libonedal_core.a \ "$(DAAL_PATH)"/libonedal_thread.a \ + "$(DAAL_PATH)"/libonedal_sycl.a \ "$(DAAL_PATH)"/libonedal_parameters_dpc.a endif @@ -101,26 +102,14 @@ COPTS := -std=c++17 \ -I$(MPI_PATH)/include \ -I"$(DALROOT)/include" -ifeq ($(RES_EXT),so) - LIBS := $(ONEDAL_LIBS) \ - -lmpicxx \ - -lmpi \ - -ltbb \ - -ltbbmalloc \ - -lpthread \ - -lOpenCL \ - -ldl -else - LIBS := $(ONEDAL_LIBS) \ - -lmkl_sycl \ - -lmpicxx \ - -lmpi \ - -ltbb \ - -ltbbmalloc \ - -lpthread \ - -lOpenCL \ - -ldl -endif +LIBS := $(ONEDAL_LIBS) \ + -lmpicxx \ + -lmpi \ + -ltbb \ + -ltbbmalloc \ + -lpthread \ + -lOpenCL \ + -ldl LOPTS := -L"$(DAAL_PATH)" \ -L"$(TBB_PATH)" \ From 47677bbfcd19a8b552cd14f99b1d27369c6f89a5 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Mon, 11 Nov 2024 07:57:29 -0800 Subject: [PATCH 10/23] fixes --- cmake/templates/oneDALConfig.cmake.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index f1e20055fbd..87801996394 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -64,22 +64,22 @@ if(NOT DEFINED ONEDAL_SET_TBB_MANUALLY AND DEFINED SET_TBB_MANUALLY) endif() if ("${REF_BACKEND}" STREQUAL "" OR "${REF_BACKEND}" STREQUAL "OFF") - set(MATH_BACKEND "mkl") + set(MATH_BACKEND "mkl" FORCE) elseif ("${REF_BACKEND}" STREQUAL "ON") - set(MATH_BACKEND "ref") + set(MATH_BACKEND "ref" FORCE) elseif (NOT "${REF_BACKEND}" STREQUAL "OFF" AND NOT "${REF_BACKEND}" STREQUAL "ON") message(FATAL_ERROR "REF_BACKEND must be 'ON' or 'OFF'") endif() if ("${ONEDAL_LINK}" STREQUAL "" OR "${ONEDAL_LINK}" STREQUAL "dynamic") set(ONEDAL_LINK "dynamic") - set(MKL_DEPENDENCY "no") + set(MKL_DEPENDENCY "no" FORCE) elseif ("${ONEDAL_LINK}" STREQUAL "static") set(ONEDAL_LINK "static") if("${MATH_BACKEND}" STREQUAL "mkl") - set(MKL_DEPENDENCY "yes") + set(MKL_DEPENDENCY "yes" FORCE) elseif("${MATH_BACKEND}" STREQUAL "ref") - set(MKL_DEPENDENCY "no") + set(MKL_DEPENDENCY "no" FORCE) endif() elseif (NOT "${ONEDAL_LINK}" STREQUAL "static" AND NOT "${ONEDAL_LINK}" STREQUAL "dynamic") message(FATAL_ERROR "ONEDAL_LINK must be 'static' or 'dynamic'") @@ -138,9 +138,9 @@ elseif (@VERSIONS_SET@ STREQUAL "FALSE") endif() if(MKL_DEPENDENCY STREQUAL "yes") - set(MKL_THREADING "tbb_thread") - set(MKL_SYCL_LINK "static") - set(MKL_LINK "static") + set(MKL_THREADING "tbb_thread" CACHE STRING "Threading type for MKL" FORCE) + set(MKL_SYCL_LINK "static" CACHE STRING "SYCL Link type for MKL" FORCE) + set(MKL_LINK "static" CACHE STRING "Link type for MKL" FORCE) find_package(MKL REQUIRED MKL::MKL_SYCL) endif() From d379428de9ec86ea04e9b264fb2cf40fb7493d46 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Mon, 11 Nov 2024 08:38:41 -0800 Subject: [PATCH 11/23] fixes --- cmake/templates/oneDALConfig.cmake.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index 87801996394..0d3f8e41fcf 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -64,22 +64,22 @@ if(NOT DEFINED ONEDAL_SET_TBB_MANUALLY AND DEFINED SET_TBB_MANUALLY) endif() if ("${REF_BACKEND}" STREQUAL "" OR "${REF_BACKEND}" STREQUAL "OFF") - set(MATH_BACKEND "mkl" FORCE) + set(MATH_BACKEND "mkl" CACHE STRING "Backend math library" FORCE) elseif ("${REF_BACKEND}" STREQUAL "ON") - set(MATH_BACKEND "ref" FORCE) + set(MATH_BACKEND "ref" CACHE STRING "Backend math library" FORCE) elseif (NOT "${REF_BACKEND}" STREQUAL "OFF" AND NOT "${REF_BACKEND}" STREQUAL "ON") message(FATAL_ERROR "REF_BACKEND must be 'ON' or 'OFF'") endif() if ("${ONEDAL_LINK}" STREQUAL "" OR "${ONEDAL_LINK}" STREQUAL "dynamic") set(ONEDAL_LINK "dynamic") - set(MKL_DEPENDENCY "no" FORCE) + set(MKL_DEPENDENCY "no" CACHE STRING "MKL_DEPENDENCY math library" FORCE) elseif ("${ONEDAL_LINK}" STREQUAL "static") set(ONEDAL_LINK "static") if("${MATH_BACKEND}" STREQUAL "mkl") - set(MKL_DEPENDENCY "yes" FORCE) + set(MKL_DEPENDENCY "yes" CACHE STRING "MKL_DEPENDENCY math library" FORCE) elseif("${MATH_BACKEND}" STREQUAL "ref") - set(MKL_DEPENDENCY "no" FORCE) + set(MKL_DEPENDENCY "no" CACHE STRING "MKL_DEPENDENCY math library" FORCE) endif() elseif (NOT "${ONEDAL_LINK}" STREQUAL "static" AND NOT "${ONEDAL_LINK}" STREQUAL "dynamic") message(FATAL_ERROR "ONEDAL_LINK must be 'static' or 'dynamic'") From 57ec34d6fff3c85f38f29da52e207d2a13689735 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Tue, 12 Nov 2024 01:06:57 -0800 Subject: [PATCH 12/23] more debug prints --- cmake/templates/oneDALConfig.cmake.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index 0d3f8e41fcf..e2c22e125e4 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -142,6 +142,10 @@ if(MKL_DEPENDENCY STREQUAL "yes") set(MKL_SYCL_LINK "static" CACHE STRING "SYCL Link type for MKL" FORCE) set(MKL_LINK "static" CACHE STRING "Link type for MKL" FORCE) find_package(MKL REQUIRED MKL::MKL_SYCL) + message(STATUS "MKL dependencies are enabled") + message(STATUS "MKL_THREADING: ${MKL_THREADING}") + message(STATUS "MKL_SYCL_LINK: ${MKL_SYCL_LINK}") + message(STATUS "MKL_LINK: ${MKL_LINK}") endif() if (ONEDAL_USE_DPCPP STREQUAL "yes" AND ONEDAL_INTERFACE STREQUAL "no") From 9ace5b9cf4c288284fb640e630aac4ff2195bde1 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Tue, 12 Nov 2024 01:17:16 -0800 Subject: [PATCH 13/23] experimental mkl sycl --- samples/cmake/setup_samples.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/cmake/setup_samples.cmake b/samples/cmake/setup_samples.cmake index abf480f02e9..a1506f827aa 100644 --- a/samples/cmake/setup_samples.cmake +++ b/samples/cmake/setup_samples.cmake @@ -101,9 +101,9 @@ function(add_samples samples_paths) endif() if(UNIX AND NOT APPLE) - target_link_libraries(${sample} PRIVATE -Wl,--start-group ${oneDAL_IMPORTED_TARGETS} ${MPI_DEPENDENCIES} -Wl,--end-group) + target_link_libraries(${sample} PRIVATE -Wl,--start-group ${oneDAL_IMPORTED_TARGETS} ${MPI_DEPENDENCIES} MKL::MKL_SYCL -Wl,--end-group) else() - target_link_libraries(${sample} PRIVATE ${oneDAL_IMPORTED_TARGETS} ${MPI_DEPENDENCIES}) + target_link_libraries(${sample} PRIVATE ${oneDAL_IMPORTED_TARGETS} ${MPI_DEPENDENCIES} MKL::MKL_SYCL) endif() target_compile_options(${sample} PRIVATE ${ONEDAL_CUSTOM_COMPILE_OPTIONS}) From 39101475bfe8d691a4ccdf6c759de144d1b430fb Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Tue, 12 Nov 2024 01:47:51 -0800 Subject: [PATCH 14/23] minor upd --- cmake/templates/oneDALConfig.cmake.in | 2 ++ samples/cmake/setup_samples.cmake | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index e2c22e125e4..d6d420ad721 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -141,6 +141,8 @@ if(MKL_DEPENDENCY STREQUAL "yes") set(MKL_THREADING "tbb_thread" CACHE STRING "Threading type for MKL" FORCE) set(MKL_SYCL_LINK "static" CACHE STRING "SYCL Link type for MKL" FORCE) set(MKL_LINK "static" CACHE STRING "Link type for MKL" FORCE) + set(MKL_SYCL_INTERFACE_FULL "intel_ilp64" CACHE STRING "Link type for MKL" FORCE) + set(MKL_INTERFACE_FULL "intel_ilp64" CACHE STRING "Link type for MKL" FORCE) find_package(MKL REQUIRED MKL::MKL_SYCL) message(STATUS "MKL dependencies are enabled") message(STATUS "MKL_THREADING: ${MKL_THREADING}") diff --git a/samples/cmake/setup_samples.cmake b/samples/cmake/setup_samples.cmake index a1506f827aa..abf480f02e9 100644 --- a/samples/cmake/setup_samples.cmake +++ b/samples/cmake/setup_samples.cmake @@ -101,9 +101,9 @@ function(add_samples samples_paths) endif() if(UNIX AND NOT APPLE) - target_link_libraries(${sample} PRIVATE -Wl,--start-group ${oneDAL_IMPORTED_TARGETS} ${MPI_DEPENDENCIES} MKL::MKL_SYCL -Wl,--end-group) + target_link_libraries(${sample} PRIVATE -Wl,--start-group ${oneDAL_IMPORTED_TARGETS} ${MPI_DEPENDENCIES} -Wl,--end-group) else() - target_link_libraries(${sample} PRIVATE ${oneDAL_IMPORTED_TARGETS} ${MPI_DEPENDENCIES} MKL::MKL_SYCL) + target_link_libraries(${sample} PRIVATE ${oneDAL_IMPORTED_TARGETS} ${MPI_DEPENDENCIES}) endif() target_compile_options(${sample} PRIVATE ${ONEDAL_CUSTOM_COMPILE_OPTIONS}) From 1ae443058717445b2ef6b9f51fe0141f9d9808e2 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Tue, 12 Nov 2024 04:30:53 -0800 Subject: [PATCH 15/23] fixes --- samples/cmake/setup_samples.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cmake/setup_samples.cmake b/samples/cmake/setup_samples.cmake index abf480f02e9..d08ac74971b 100644 --- a/samples/cmake/setup_samples.cmake +++ b/samples/cmake/setup_samples.cmake @@ -114,7 +114,7 @@ function(add_samples samples_paths) set_target_properties(${sample} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/_cmake_results/${CPU_ARCHITECTURE}_${LINK_TYPE}") add_custom_target(run_${sample} - COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} + COMMAND ${MPIEXEC_EXECUTABLE} -localonly ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} -ppn ${MPIEXEC_NUMPROCS_PER_NODE} $ DEPENDS ${sample} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} From 159a78f21e7a6db9d55c5db62888a18f893b0a08 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Tue, 12 Nov 2024 05:39:36 -0800 Subject: [PATCH 16/23] fixes for samples --- samples/oneapi/dpc/ccl/CMakeLists.txt | 8 -------- samples/oneapi/dpc/mpi/CMakeLists.txt | 7 ------- 2 files changed, 15 deletions(-) diff --git a/samples/oneapi/dpc/ccl/CMakeLists.txt b/samples/oneapi/dpc/ccl/CMakeLists.txt index 8836a9cc69e..6c12f0356d6 100644 --- a/samples/oneapi/dpc/ccl/CMakeLists.txt +++ b/samples/oneapi/dpc/ccl/CMakeLists.txt @@ -23,14 +23,6 @@ set(ONEDAL_USE_CCL yes) set(MPIEXEC_MAX_NUMPROCS "1" CACHE STRING "Number of processes") set(MPIEXEC_NUMPROCS_PER_NODE "1" CACHE STRING "Number of processes per node") - -set(CMAKE_C_COMPILER "mpiicx") -if(WIN32) - set(CMAKE_CXX_COMPILER "mpiicx") -elseif(UNIX) - set(CMAKE_CXX_COMPILER "mpiicpx") -endif() - # Add cmake scripts and modules to CMake search path list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/") include(setup_samples) diff --git a/samples/oneapi/dpc/mpi/CMakeLists.txt b/samples/oneapi/dpc/mpi/CMakeLists.txt index 3846bda92f6..a3f3333c8ab 100644 --- a/samples/oneapi/dpc/mpi/CMakeLists.txt +++ b/samples/oneapi/dpc/mpi/CMakeLists.txt @@ -23,13 +23,6 @@ set(ONEDAL_USE_CCL no) set(MPIEXEC_MAX_NUMPROCS "4" CACHE STRING "Number of processes") set(MPIEXEC_NUMPROCS_PER_NODE "4" CACHE STRING "Number of processes per node") -set(CMAKE_C_COMPILER "mpiicx") -if(WIN32) - set(CMAKE_CXX_COMPILER "mpiicx") -elseif(UNIX) - set(CMAKE_CXX_COMPILER "mpiicpx") -endif() - # Add cmake scripts and modules to CMake search path list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/") include(setup_samples) From 82a4416a46f013ca621f3809ccd1fbd030556363 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Wed, 13 Nov 2024 00:54:27 -0800 Subject: [PATCH 17/23] fixes --- cmake/templates/oneDALConfig.cmake.in | 2 +- docs/source/get-started/build-and-run-examples.rst | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index d6d420ad721..34b9a815581 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -173,7 +173,7 @@ list(APPEND DAL_LIBS onedal_core${DAL_DEBUG_SUFFIX}) set(THREADING_TYPE "parallel") set(DAL_THREAD_LIBRARY_NAME onedal_thread${DAL_DEBUG_SUFFIX}) - + if (ONEDAL_SET_TBB_MANUALLY STREQUAL "no") find_package(TBB REQUIRED tbb tbbmalloc) if (NOT TBB_IMPORTED_TARGETS) diff --git a/docs/source/get-started/build-and-run-examples.rst b/docs/source/get-started/build-and-run-examples.rst index 160fb9d9bb4..ba4d40fb78b 100644 --- a/docs/source/get-started/build-and-run-examples.rst +++ b/docs/source/get-started/build-and-run-examples.rst @@ -76,7 +76,11 @@ basic usage scenarios of |short_name| with DPCPP. Go to #. Set up the compiler environment for |dpcpp|. See |dpcpp_gsg|_ for details. -#. Draft:For static applications and examples is necesasry to source oneMKL. +#. Set up oneMKL environment in case of static linking: + + .. code-block:: bash + + source mkl/latest/env/vars.sh #. Build and run examples: From 3f98e5a6d7eeea685ce9f7eaa4fb13b2d7aea8f2 Mon Sep 17 00:00:00 2001 From: "aleksandr.solovev" Date: Wed, 13 Nov 2024 01:12:50 -0800 Subject: [PATCH 18/23] minor fix for localonly --- samples/cmake/setup_samples.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cmake/setup_samples.cmake b/samples/cmake/setup_samples.cmake index d08ac74971b..abf480f02e9 100644 --- a/samples/cmake/setup_samples.cmake +++ b/samples/cmake/setup_samples.cmake @@ -114,7 +114,7 @@ function(add_samples samples_paths) set_target_properties(${sample} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/_cmake_results/${CPU_ARCHITECTURE}_${LINK_TYPE}") add_custom_target(run_${sample} - COMMAND ${MPIEXEC_EXECUTABLE} -localonly ${MPIEXEC_NUMPROC_FLAG} + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} -ppn ${MPIEXEC_NUMPROCS_PER_NODE} $ DEPENDS ${sample} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} From 7d6ac409ae4904952fd600f91ec66b20a8ed37d6 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Wed, 13 Nov 2024 04:53:11 -0800 Subject: [PATCH 19/23] minor fix for cmake vars --- cmake/templates/oneDALConfig.cmake.in | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index 34b9a815581..bd003eae05b 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -64,22 +64,22 @@ if(NOT DEFINED ONEDAL_SET_TBB_MANUALLY AND DEFINED SET_TBB_MANUALLY) endif() if ("${REF_BACKEND}" STREQUAL "" OR "${REF_BACKEND}" STREQUAL "OFF") - set(MATH_BACKEND "mkl" CACHE STRING "Backend math library" FORCE) + set(MATH_BACKEND "mkl") elseif ("${REF_BACKEND}" STREQUAL "ON") - set(MATH_BACKEND "ref" CACHE STRING "Backend math library" FORCE) + set(MATH_BACKEND "ref") elseif (NOT "${REF_BACKEND}" STREQUAL "OFF" AND NOT "${REF_BACKEND}" STREQUAL "ON") message(FATAL_ERROR "REF_BACKEND must be 'ON' or 'OFF'") endif() if ("${ONEDAL_LINK}" STREQUAL "" OR "${ONEDAL_LINK}" STREQUAL "dynamic") set(ONEDAL_LINK "dynamic") - set(MKL_DEPENDENCY "no" CACHE STRING "MKL_DEPENDENCY math library" FORCE) + set(MKL_DEPENDENCY "no") elseif ("${ONEDAL_LINK}" STREQUAL "static") set(ONEDAL_LINK "static") if("${MATH_BACKEND}" STREQUAL "mkl") - set(MKL_DEPENDENCY "yes" CACHE STRING "MKL_DEPENDENCY math library" FORCE) + set(MKL_DEPENDENCY "yes") elseif("${MATH_BACKEND}" STREQUAL "ref") - set(MKL_DEPENDENCY "no" CACHE STRING "MKL_DEPENDENCY math library" FORCE) + set(MKL_DEPENDENCY "no") endif() elseif (NOT "${ONEDAL_LINK}" STREQUAL "static" AND NOT "${ONEDAL_LINK}" STREQUAL "dynamic") message(FATAL_ERROR "ONEDAL_LINK must be 'static' or 'dynamic'") @@ -138,16 +138,12 @@ elseif (@VERSIONS_SET@ STREQUAL "FALSE") endif() if(MKL_DEPENDENCY STREQUAL "yes") - set(MKL_THREADING "tbb_thread" CACHE STRING "Threading type for MKL" FORCE) - set(MKL_SYCL_LINK "static" CACHE STRING "SYCL Link type for MKL" FORCE) - set(MKL_LINK "static" CACHE STRING "Link type for MKL" FORCE) - set(MKL_SYCL_INTERFACE_FULL "intel_ilp64" CACHE STRING "Link type for MKL" FORCE) - set(MKL_INTERFACE_FULL "intel_ilp64" CACHE STRING "Link type for MKL" FORCE) + set(MKL_THREADING "tbb_thread") + set(MKL_SYCL_LINK "static") + set(MKL_LINK "static") + set(MKL_SYCL_INTERFACE_FULL "intel_ilp64") + set(MKL_INTERFACE_FULL "intel_ilp64") find_package(MKL REQUIRED MKL::MKL_SYCL) - message(STATUS "MKL dependencies are enabled") - message(STATUS "MKL_THREADING: ${MKL_THREADING}") - message(STATUS "MKL_SYCL_LINK: ${MKL_SYCL_LINK}") - message(STATUS "MKL_LINK: ${MKL_LINK}") endif() if (ONEDAL_USE_DPCPP STREQUAL "yes" AND ONEDAL_INTERFACE STREQUAL "no") From 71b71db76a7dba9b7fed352c567aaf85612565c7 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Wed, 13 Nov 2024 07:33:21 -0800 Subject: [PATCH 20/23] fixes --- cmake/templates/oneDALConfig.cmake.in | 2 ++ samples/cmake/setup_samples.cmake | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/templates/oneDALConfig.cmake.in b/cmake/templates/oneDALConfig.cmake.in index bd003eae05b..f6aa42bdc7b 100644 --- a/cmake/templates/oneDALConfig.cmake.in +++ b/cmake/templates/oneDALConfig.cmake.in @@ -28,6 +28,8 @@ endif() # ONEDAL_LINK: static | dynamic. Default is dynamic # ONEDAL_USE_DPCPP: yes | no. Default is yes # ONEDAL_INTERFACE: yes | no. Default is no + +# Internal variables: # ONEDAL_SET_TBB_MANUALLY: yes | no. Default is no # MKL_DEPENDENCY: yes | no. Default is no # MATH_BACKEND: mkl | ref. Default is mkl diff --git a/samples/cmake/setup_samples.cmake b/samples/cmake/setup_samples.cmake index abf480f02e9..afef42e3961 100644 --- a/samples/cmake/setup_samples.cmake +++ b/samples/cmake/setup_samples.cmake @@ -28,11 +28,11 @@ endfunction() # Define dependencies for MPI/CCL samples function(find_dependencies) if(ONEDAL_DISTRIBUTED STREQUAL "yes") + # This policy allows finding modules using _ROOT variables + cmake_policy(SET CMP0074 NEW) find_package(MPI REQUIRED) set(MPI_DEPENDENCIES MPI::MPI_C MPI::MPI_CXX PARENT_SCOPE) if(ONEDAL_USE_CCL STREQUAL "yes") - # This policy allows finding modules using _ROOT variables - cmake_policy(SET CMP0074 NEW) find_package(CCL REQUIRED) set(MPI_DEPENDENCIES MPI::MPI_C MPI::MPI_CXX ${CCL_LIBRARY} PARENT_SCOPE) endif() From 8d9572609eb23041d4ca5689832009368ed304da Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Thu, 14 Nov 2024 01:57:58 -0800 Subject: [PATCH 21/23] fix correct compilers for mpi --- samples/oneapi/dpc/ccl/CMakeLists.txt | 7 +++++++ samples/oneapi/dpc/mpi/CMakeLists.txt | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/samples/oneapi/dpc/ccl/CMakeLists.txt b/samples/oneapi/dpc/ccl/CMakeLists.txt index 6c12f0356d6..8a8b5d07078 100644 --- a/samples/oneapi/dpc/ccl/CMakeLists.txt +++ b/samples/oneapi/dpc/ccl/CMakeLists.txt @@ -23,6 +23,13 @@ set(ONEDAL_USE_CCL yes) set(MPIEXEC_MAX_NUMPROCS "1" CACHE STRING "Number of processes") set(MPIEXEC_NUMPROCS_PER_NODE "1" CACHE STRING "Number of processes per node") +set(MPI_C_COMPILER "mpiicx") +if(WIN32) + set(MPI_CXX_COMPILER "mpiicx") +elseif(UNIX) + set(MPI_CXX_COMPILER "mpiicpx") +endif() + # Add cmake scripts and modules to CMake search path list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/") include(setup_samples) diff --git a/samples/oneapi/dpc/mpi/CMakeLists.txt b/samples/oneapi/dpc/mpi/CMakeLists.txt index a3f3333c8ab..f2d4c3df0ea 100644 --- a/samples/oneapi/dpc/mpi/CMakeLists.txt +++ b/samples/oneapi/dpc/mpi/CMakeLists.txt @@ -23,6 +23,13 @@ set(ONEDAL_USE_CCL no) set(MPIEXEC_MAX_NUMPROCS "4" CACHE STRING "Number of processes") set(MPIEXEC_NUMPROCS_PER_NODE "4" CACHE STRING "Number of processes per node") +set(MPI_C_COMPILER "mpiicx") +if(WIN32) + set(MPI_CXX_COMPILER "mpiicx") +elseif(UNIX) + set(MPI_CXX_COMPILER "mpiicpx") +endif() + # Add cmake scripts and modules to CMake search path list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/") include(setup_samples) From f2e7a328ba48c15fd633c43f9485c60852034d00 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Thu, 14 Nov 2024 04:27:46 -0800 Subject: [PATCH 22/23] fixes --- samples/cmake/setup_samples.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/cmake/setup_samples.cmake b/samples/cmake/setup_samples.cmake index afef42e3961..abf480f02e9 100644 --- a/samples/cmake/setup_samples.cmake +++ b/samples/cmake/setup_samples.cmake @@ -28,11 +28,11 @@ endfunction() # Define dependencies for MPI/CCL samples function(find_dependencies) if(ONEDAL_DISTRIBUTED STREQUAL "yes") - # This policy allows finding modules using _ROOT variables - cmake_policy(SET CMP0074 NEW) find_package(MPI REQUIRED) set(MPI_DEPENDENCIES MPI::MPI_C MPI::MPI_CXX PARENT_SCOPE) if(ONEDAL_USE_CCL STREQUAL "yes") + # This policy allows finding modules using _ROOT variables + cmake_policy(SET CMP0074 NEW) find_package(CCL REQUIRED) set(MPI_DEPENDENCIES MPI::MPI_C MPI::MPI_CXX ${CCL_LIBRARY} PARENT_SCOPE) endif() From 82dc19a35c2564ebd2aa8901dc1a6f5914f87a07 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Thu, 14 Nov 2024 07:01:12 -0800 Subject: [PATCH 23/23] fixes for compilers --- samples/oneapi/dpc/ccl/CMakeLists.txt | 3 +++ samples/oneapi/dpc/mpi/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/samples/oneapi/dpc/ccl/CMakeLists.txt b/samples/oneapi/dpc/ccl/CMakeLists.txt index 8a8b5d07078..6a519e5b8d7 100644 --- a/samples/oneapi/dpc/ccl/CMakeLists.txt +++ b/samples/oneapi/dpc/ccl/CMakeLists.txt @@ -24,10 +24,13 @@ set(MPIEXEC_MAX_NUMPROCS "1" CACHE STRING "Number of processes") set(MPIEXEC_NUMPROCS_PER_NODE "1" CACHE STRING "Number of processes per node") set(MPI_C_COMPILER "mpiicx") +set(CMAKE_C_COMPILER "icx") if(WIN32) set(MPI_CXX_COMPILER "mpiicx") + set(CMAKE_CXX_COMPILER "icx") elseif(UNIX) set(MPI_CXX_COMPILER "mpiicpx") + set(CMAKE_CXX_COMPILER "icpx") endif() # Add cmake scripts and modules to CMake search path diff --git a/samples/oneapi/dpc/mpi/CMakeLists.txt b/samples/oneapi/dpc/mpi/CMakeLists.txt index f2d4c3df0ea..007bc97b1e2 100644 --- a/samples/oneapi/dpc/mpi/CMakeLists.txt +++ b/samples/oneapi/dpc/mpi/CMakeLists.txt @@ -24,10 +24,13 @@ set(MPIEXEC_MAX_NUMPROCS "4" CACHE STRING "Number of processes") set(MPIEXEC_NUMPROCS_PER_NODE "4" CACHE STRING "Number of processes per node") set(MPI_C_COMPILER "mpiicx") +set(CMAKE_C_COMPILER "icx") if(WIN32) set(MPI_CXX_COMPILER "mpiicx") + set(CMAKE_CXX_COMPILER "icx") elseif(UNIX) set(MPI_CXX_COMPILER "mpiicpx") + set(CMAKE_CXX_COMPILER "icpx") endif() # Add cmake scripts and modules to CMake search path