From b4683254cb47efb8df6f7707e41c80c7469e7e82 Mon Sep 17 00:00:00 2001 From: Sergey Shalnov Date: Sat, 5 Dec 2020 13:17:50 -0600 Subject: [PATCH 1/2] Change default compiler name Try to avoid error ``` error: kernel name cannot be a type in the "std" namespace ``` --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 15b75d02ed2a..aeae69f421e6 100644 --- a/setup.py +++ b/setup.py @@ -113,8 +113,8 @@ Set compiler for the project """ # default variables (for Linux) -_project_compiler = "clang++" -_project_linker = "clang++" +_project_compiler = "dpcpp" +_project_linker = "dpcpp" _project_cmplr_flag_sycl_devel = ["-fsycl-device-code-split=per_kernel"] _project_cmplr_flag_sycl = ["-fsycl"] _project_cmplr_flag_compatibility = ["-Wl,--enable-new-dtags"] From 7cc1008cae336c86cfc2cdb25c7711c780b7c37f Mon Sep 17 00:00:00 2001 From: sergey shalnov Date: Sat, 5 Dec 2020 15:22:30 -0600 Subject: [PATCH 2/2] adjust the backend linker name and make python extensions compiler default --- dpnp/backend/backend_pstl.hpp | 6 +++--- dpnp/backend/queue_sycl.hpp | 3 +++ setup.py | 26 +++++++++++++------------- utils/command_build_clib.py | 3 +++ 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/dpnp/backend/backend_pstl.hpp b/dpnp/backend/backend_pstl.hpp index a066000aa463..a54dfa43010c 100644 --- a/dpnp/backend/backend_pstl.hpp +++ b/dpnp/backend/backend_pstl.hpp @@ -39,10 +39,10 @@ #define BACKEND_PSTL_H #pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-local-typedef" -#pragma clang diagnostic ignored "-Wunknown-pragmas" +// #pragma clang diagnostic ignored "-Wunused-local-typedef" +// #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wsign-compare" -#pragma clang diagnostic ignored "-Wunused-variable" +// #pragma clang diagnostic ignored "-Wunused-variable" #pragma clang diagnostic ignored "-Wunused-parameter" #pragma clang diagnostic ignored "-Wshadow" diff --git a/dpnp/backend/queue_sycl.hpp b/dpnp/backend/queue_sycl.hpp index 66afb337d874..3874eb81faf8 100644 --- a/dpnp/backend/queue_sycl.hpp +++ b/dpnp/backend/queue_sycl.hpp @@ -27,7 +27,10 @@ #ifndef QUEUE_SYCL_H // Cython compatibility #define QUEUE_SYCL_H +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpass-failed" #include +#pragma clang diagnostic pop #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-parameter" diff --git a/setup.py b/setup.py index aeae69f421e6..b2fe3707e0f0 100644 --- a/setup.py +++ b/setup.py @@ -176,19 +176,19 @@ _sdl_ldflags = ["-NXCompat", "-DynamicBase"] -try: - """ - set environment variables to control setuptools build procedure - """ - # check if we have preset variables in environment - os.environ["CC"] == _project_compiler - os.environ["CXX"] == _project_compiler - os.environ["LD"] == _project_linker -except KeyError: - # set variables if not presented in environment - os.environ["CC"] = _project_compiler - os.environ["CXX"] = _project_compiler - os.environ["LD"] = _project_linker +# try: +# """ +# set environment variables to control setuptools build procedure +# """ +# # check if we have preset variables in environment +# os.environ["CC"] == _project_compiler +# os.environ["CXX"] == _project_compiler +# os.environ["LD"] == _project_linker +# except KeyError: +# # set variables if not presented in environment +# os.environ["CC"] = _project_compiler +# os.environ["CXX"] = _project_compiler +# os.environ["LD"] = _project_linker """ diff --git a/utils/command_build_clib.py b/utils/command_build_clib.py index d9d1c557c81d..d4ae77facc35 100644 --- a/utils/command_build_clib.py +++ b/utils/command_build_clib.py @@ -90,7 +90,10 @@ def build_libraries(self, libraries): # set compiler and options self.compiler.compiler_so = compiler + default_flags + self.compiler.compiler = self.compiler.compiler_so + self.compiler.compiler_cxx = self.compiler.compiler_so self.compiler.linker_so = linker + default_flags + self.compiler.linker_exe = self.compiler.linker_so objects = [] """