public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: dev-python/dpnp/, dev-python/dpnp/files/
@ 2022-12-12 15:16 Andrew Ammerlaan
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Ammerlaan @ 2022-12-12 15:16 UTC (permalink / raw
  To: gentoo-commits

commit:     80af1504888fc6b7da1c5c0f3dd78ac0f6d98a65
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 12 15:13:16 2022 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Mon Dec 12 15:13:16 2022 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=80af1504

dev-python/dpnp: add 0.11.0

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 dev-python/dpnp/dpnp-0.11.0.ebuild                 | 57 +++++++++++++++
 .../dpnp/files/dpnp-0.11.0-fix-compile.patch       | 80 ++++++++++++++++++++++
 2 files changed, 137 insertions(+)

diff --git a/dev-python/dpnp/dpnp-0.11.0.ebuild b/dev-python/dpnp/dpnp-0.11.0.ebuild
new file mode 100644
index 000000000..da7abcc88
--- /dev/null
+++ b/dev-python/dpnp/dpnp-0.11.0.ebuild
@@ -0,0 +1,57 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+# Breaks the installation of the backend library
+#DISTUTILS_USE_PEP517=setuptools
+inherit distutils-r1
+
+DESCRIPTION="Data Parallel Extension for NumPy"
+HOMEPAGE="https://github.com/IntelPython/dpnp"
+SRC_URI="https://github.com/IntelPython/dpnp/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+BDEPEND="
+	dev-python/cython[${PYTHON_USEDEP}]
+	dev-util/cmake
+	sys-devel/DPC++
+"
+
+RDEPEND="
+	dev-cpp/tbb
+	dev-python/dpctl[${PYTHON_USEDEP}]
+	dev-python/numpy[${PYTHON_USEDEP}]
+	sci-libs/mkl
+	sys-devel/DPC++:=
+"
+DEPEND="${RDEPEND}
+	sys-devel/oneDPL
+"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+	"${FILESDIR}/${P}-fix-compile.patch"
+)
+
+python_prepare_all() {
+	# DPC++ compiler required for full functionality
+	export CC="${ESYSROOT}/usr/lib/llvm/intel/bin/clang"
+	export CXX="${ESYSROOT}/usr/lib/llvm/intel/bin/clang++"
+	export DPCPPROOT="${ESYSROOT}/usr/lib/llvm/intel"
+	export DPL_ROOT="${ESYSROOT}/usr/include/include/oneapi/dpl"
+	# Parallel build broken
+	export MAKEOPTS="-j1"
+
+	distutils-r1_python_prepare_all
+}
+
+python_compile() {
+	export BUILD_DIR_LIBS="${BUILD_DIR}/lib/dpnp"
+	distutils-r1_python_compile
+}

diff --git a/dev-python/dpnp/files/dpnp-0.11.0-fix-compile.patch b/dev-python/dpnp/files/dpnp-0.11.0-fix-compile.patch
new file mode 100644
index 000000000..2ccc0a6b8
--- /dev/null
+++ b/dev-python/dpnp/files/dpnp-0.11.0-fix-compile.patch
@@ -0,0 +1,80 @@
+diff --git a/dpnp/backend/CMakeLists.txt b/dpnp/backend/CMakeLists.txt
+index 409a29f..11d21f1 100644
+--- a/dpnp/backend/CMakeLists.txt
++++ b/dpnp/backend/CMakeLists.txt
+@@ -98,30 +98,7 @@ string(CONCAT COMMON_LINK_FLAGS
+   "-fsycl "
+   "-fsycl-device-code-split=per_kernel "
+ )
+-if(UNIX)
+-  set(CMAKE_CXX_COMPILER "dpcpp")
+-  # add_compile_options(-fPIC)
+-elseif(WIN32)
+-  set(CMAKE_CXX_COMPILER "dpcpp")
+-  # set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld-link")
+-  # set(CMAKE_LINKER "lld-link")
+-  # include (Platform/Windows-Clang)
+-  # set(CMAKE_LINKER "dpcpp")
+-  # set(CMAKE_AR "llvm-ar")
+-  # set(CMAKE_RANLIB "llvm-ranlib")
+-  # set(CMAKE_CXX_FLAGS "/EHsc")
+ 
+-  string(APPEND COMMON_COMPILER_FLAGS
+-    "/EHsc "
+-#    "/Ox "
+-#    "/W3 "
+-#    "/GL "
+-#    "/DNDEBUG "
+-#    "/MD "
+-  )
+-else()
+-  message(FATAL_ERROR "Unsupported system ${CMAKE_SYSTEM} in compiler selection case")
+-endif()
+ 
+ # set language version
+ set(CMAKE_CXX_STANDARD 17)
+@@ -327,6 +304,7 @@ endif()
+ # set_target_properties(dpnp_backend_c PROPERTIES VERSION ${DPNP_VERSION} SOVERSION ${DPNP_API_VERSION})
+ 
+ install(TARGETS dpnp_backend_c
++        DESTINATION ${DPNP_INSTALL_PREFIX}
+         PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+         )
+ 
+diff --git a/utils/command_build_clib.py b/utils/command_build_clib.py
+index 3d1177b..d8fbdac 100644
+--- a/utils/command_build_clib.py
++++ b/utils/command_build_clib.py
+@@ -61,8 +61,8 @@ else:
+ Set compiler for the project
+ """
+ # default variables (for Linux)
+-_project_compiler = "dpcpp"
+-_project_linker = "dpcpp"
++_project_compiler = os.environ.get("CXX")
++_project_linker = os.environ.get("CXX")
+ _project_cmplr_flag_sycl_devel = ["-fsycl-device-code-split=per_kernel", "-fno-approx-func"]
+ _project_cmplr_flag_sycl = ["-fsycl"]
+ _project_cmplr_flag_stdcpp_static = []  # This brakes TBB ["-static-libstdc++", "-static-libgcc"]
+@@ -114,7 +114,7 @@ except ImportError:
+ 
+ # other OS specific
+ if IS_WIN:
+-    _project_compiler = "dpcpp"
++    _project_compiler = os.environ.get("CXX")
+     _project_linker = "lld-link"
+     _project_cmplr_flag_sycl = []
+     _project_cmplr_flag_stdcpp_static = []
+diff --git a/utils/command_build_cmake_clib.py b/utils/command_build_cmake_clib.py
+index 0ef0e24..84f2469 100644
+--- a/utils/command_build_cmake_clib.py
++++ b/utils/command_build_cmake_clib.py
+@@ -112,7 +112,7 @@ class custom_build_cmake_clib(build_clib.build_clib):
+             "-S" + backend_directory,
+             "-B" + abs_build_temp_path,
+             "-DCMAKE_BUILD_TYPE=" + config,
+-            "-DDPNP_INSTALL_PREFIX=" + install_directory.replace(os.sep, "/"),  # adjust to cmake requirenments
++            "-DDPNP_INSTALL_PREFIX=" + os.environ.get('BUILD_DIR_LIBS'),  # adjust to cmake requirenments
+             "-DDPNP_INSTALL_STRUCTURED=OFF",
+             # "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=" + install_directory,
+             "-DDPNP_SYCL_QUEUE_MGR_ENABLE:BOOL=" + _dpctrl_exists,


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/sci:master commit in: dev-python/dpnp/, dev-python/dpnp/files/
@ 2022-12-12 15:16 Andrew Ammerlaan
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Ammerlaan @ 2022-12-12 15:16 UTC (permalink / raw
  To: gentoo-commits

commit:     663b688fc77db01783400a7e4c2e3c01d44aa00e
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 12 14:40:47 2022 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Mon Dec 12 14:40:47 2022 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=663b688f

dev-python/dpnp: fix installation of backend library

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 dev-python/dpnp/dpnp-0.10.0.ebuild                 |  9 ++++++++-
 .../dpnp/files/dpnp-0.10.0-fix-compile.patch       | 23 +++++++++++++++++++++-
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/dev-python/dpnp/dpnp-0.10.0.ebuild b/dev-python/dpnp/dpnp-0.10.0.ebuild
index 903a2f806..da7abcc88 100644
--- a/dev-python/dpnp/dpnp-0.10.0.ebuild
+++ b/dev-python/dpnp/dpnp-0.10.0.ebuild
@@ -4,7 +4,8 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{8..11} )
-DISTUTILS_USE_PEP517=setuptools
+# Breaks the installation of the backend library
+#DISTUTILS_USE_PEP517=setuptools
 inherit distutils-r1
 
 DESCRIPTION="Data Parallel Extension for NumPy"
@@ -26,6 +27,7 @@ RDEPEND="
 	dev-python/dpctl[${PYTHON_USEDEP}]
 	dev-python/numpy[${PYTHON_USEDEP}]
 	sci-libs/mkl
+	sys-devel/DPC++:=
 "
 DEPEND="${RDEPEND}
 	sys-devel/oneDPL
@@ -48,3 +50,8 @@ python_prepare_all() {
 
 	distutils-r1_python_prepare_all
 }
+
+python_compile() {
+	export BUILD_DIR_LIBS="${BUILD_DIR}/lib/dpnp"
+	distutils-r1_python_compile
+}

diff --git a/dev-python/dpnp/files/dpnp-0.10.0-fix-compile.patch b/dev-python/dpnp/files/dpnp-0.10.0-fix-compile.patch
index 49559afab..deaa95d0b 100644
--- a/dev-python/dpnp/files/dpnp-0.10.0-fix-compile.patch
+++ b/dev-python/dpnp/files/dpnp-0.10.0-fix-compile.patch
@@ -20,7 +20,7 @@ index c089b1d..3bb0739 100755
  ./example3
  
 diff --git a/dpnp/backend/CMakeLists.txt b/dpnp/backend/CMakeLists.txt
-index 81f073c..24c6b65 100644
+index 81f073c..bcc4ecc 100644
 --- a/dpnp/backend/CMakeLists.txt
 +++ b/dpnp/backend/CMakeLists.txt
 @@ -88,24 +88,6 @@ if (CMAKE_VERSION VERSION_EQUAL 3.19.1)
@@ -48,6 +48,14 @@ index 81f073c..24c6b65 100644
  # set language version
  set(CMAKE_CXX_STANDARD 17)
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
+@@ -280,6 +262,7 @@ endif()
+ # set_target_properties(dpnp_backend_c PROPERTIES VERSION ${DPNP_VERSION} SOVERSION ${DPNP_API_VERSION})
+ 
+ install(TARGETS dpnp_backend_c
++        DESTINATION ${DPNP_INSTALL_PREFIX}
+         PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+         )
+ 
 diff --git a/utils/command_build_clib.py b/utils/command_build_clib.py
 index dc9f322..35432fa 100644
 --- a/utils/command_build_clib.py
@@ -74,3 +82,16 @@ index dc9f322..35432fa 100644
      _project_cmplr_flag_sycl = []
      _project_cmplr_flag_stdcpp_static = []
      _project_cmplr_flag_compatibility = []
+diff --git a/utils/command_build_cmake_clib.py b/utils/command_build_cmake_clib.py
+index 0ef0e24..84f2469 100644
+--- a/utils/command_build_cmake_clib.py
++++ b/utils/command_build_cmake_clib.py
+@@ -112,7 +112,7 @@ class custom_build_cmake_clib(build_clib.build_clib):
+             "-S" + backend_directory,
+             "-B" + abs_build_temp_path,
+             "-DCMAKE_BUILD_TYPE=" + config,
+-            "-DDPNP_INSTALL_PREFIX=" + install_directory.replace(os.sep, "/"),  # adjust to cmake requirenments
++            "-DDPNP_INSTALL_PREFIX=" + os.environ.get('BUILD_DIR_LIBS'),  # adjust to cmake requirenments
+             "-DDPNP_INSTALL_STRUCTURED=OFF",
+             # "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=" + install_directory,
+             "-DDPNP_SYCL_QUEUE_MGR_ENABLE:BOOL=" + _dpctrl_exists,


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/sci:master commit in: dev-python/dpnp/, dev-python/dpnp/files/
@ 2023-02-25 14:19 Andrew Ammerlaan
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Ammerlaan @ 2023-02-25 14:19 UTC (permalink / raw
  To: gentoo-commits

commit:     bc9405a1e189d09edb0434aa1729387cd30dc2a2
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 25 14:18:03 2023 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Sat Feb 25 14:18:28 2023 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=bc9405a1

dev-python/dpnp: add 0.11.1_rc1

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 dev-python/dpnp/dpnp-0.11.1_rc1.ebuild             | 65 ++++++++++++++++++++
 .../dpnp/files/dpnp-0.11.1_rc1-fix-compile.patch   | 71 ++++++++++++++++++++++
 2 files changed, 136 insertions(+)

diff --git a/dev-python/dpnp/dpnp-0.11.1_rc1.ebuild b/dev-python/dpnp/dpnp-0.11.1_rc1.ebuild
new file mode 100644
index 000000000..5443b2dfd
--- /dev/null
+++ b/dev-python/dpnp/dpnp-0.11.1_rc1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+# Breaks library installation
+#DISTUTILS_USE_PEP517=setuptools
+inherit distutils-r1
+
+DESCRIPTION="Data Parallel Extension for NumPy"
+HOMEPAGE="https://github.com/IntelPython/dpnp"
+SRC_URI="https://github.com/IntelPython/dpnp/archive/refs/tags/${PV//_rc/dev}.tar.gz -> ${P}.gh.tar.gz"
+S="${WORKDIR}/${PN}-${PV//_rc/dev}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+BDEPEND="
+	dev-python/cython[${PYTHON_USEDEP}]
+	dev-util/cmake
+	sys-devel/DPC++
+"
+
+RDEPEND="
+	dev-cpp/tbb
+	dev-python/dpctl[${PYTHON_USEDEP}]
+	dev-python/numpy[${PYTHON_USEDEP}]
+	sci-libs/mkl
+	sys-devel/DPC++:=
+"
+DEPEND="${RDEPEND}
+	sys-devel/oneDPL
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-fix-compile.patch"
+)
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+	# DPC++ compiler required for full functionality
+	export CC="${ESYSROOT}/usr/lib/llvm/intel/bin/clang"
+	export CXX="${ESYSROOT}/usr/lib/llvm/intel/bin/clang++"
+	export DPCPPROOT="${ESYSROOT}/usr/lib/llvm/intel"
+	export DPL_ROOT="${ESYSROOT}/usr/include/include/oneapi/dpl"
+	# Parallel build broken
+	export MAKEOPTS="-j1"
+
+	distutils-r1_python_prepare_all
+}
+
+python_compile() {
+	export BUILD_DIR_LIBS="${BUILD_DIR}/lib/dpnp"
+	distutils-r1_python_compile
+}
+
+python_test() {
+	export PYTHONPATH="${BUILD_DIR}/lib"
+	elog $PYTHONPATH
+	# We don't use epytest because it overwrites our PYTHONPATH
+	pytest -vv || die
+}

diff --git a/dev-python/dpnp/files/dpnp-0.11.1_rc1-fix-compile.patch b/dev-python/dpnp/files/dpnp-0.11.1_rc1-fix-compile.patch
new file mode 100644
index 000000000..25c0d3484
--- /dev/null
+++ b/dev-python/dpnp/files/dpnp-0.11.1_rc1-fix-compile.patch
@@ -0,0 +1,71 @@
+diff --git a/dpnp/backend/CMakeLists.txt b/dpnp/backend/CMakeLists.txt
+index baee709..3202662 100644
+--- a/dpnp/backend/CMakeLists.txt
++++ b/dpnp/backend/CMakeLists.txt
+@@ -99,30 +99,6 @@ string(CONCAT COMMON_LINK_FLAGS
+   "-fsycl "
+   "-fsycl-device-code-split=per_kernel "
+ )
+-if(UNIX)
+-  set(CMAKE_CXX_COMPILER "icpx")
+-  # add_compile_options(-fPIC)
+-elseif(WIN32)
+-  set(CMAKE_CXX_COMPILER "icx")
+-  # set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld-link")
+-  # set(CMAKE_LINKER "lld-link")
+-  # include (Platform/Windows-Clang)
+-  # set(CMAKE_LINKER "dpcpp")
+-  # set(CMAKE_AR "llvm-ar")
+-  # set(CMAKE_RANLIB "llvm-ranlib")
+-  # set(CMAKE_CXX_FLAGS "/EHsc")
+-
+-  string(APPEND COMMON_COMPILE_FLAGS
+-    "/EHsc "
+-#    "/Ox "
+-#    "/W3 "
+-#    "/GL "
+-#    "/DNDEBUG "
+-#    "/MD "
+-  )
+-else()
+-  message(FATAL_ERROR "Unsupported system ${CMAKE_SYSTEM} in compiler selection case")
+-endif()
+ 
+ # set language version
+ set(CMAKE_CXX_STANDARD 17)
+@@ -334,6 +310,7 @@ endif()
+ # set_target_properties(dpnp_backend_c PROPERTIES VERSION ${DPNP_VERSION} SOVERSION ${DPNP_API_VERSION})
+ 
+ install(TARGETS dpnp_backend_c
++        DESTINATION ${DPNP_INSTALL_PREFIX}
+         PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+         )
+ 
+diff --git a/utils/command_build_clib.py b/utils/command_build_clib.py
+index d16bab3..7fd2afa 100644
+--- a/utils/command_build_clib.py
++++ b/utils/command_build_clib.py
+@@ -61,8 +61,8 @@ else:
+ Set compiler for the project
+ """
+ # default variables (for Linux)
+-_project_compiler = "icpx"
+-_project_linker = "icpx"
++_project_compiler = os.environ.get("CXX")
++_project_linker = os.environ.get("CXX")
+ _project_cmplr_flag_sycl_devel = ["-fsycl-device-code-split=per_kernel", "-fno-approx-func", "-fno-finite-math-only"]
+ _project_cmplr_flag_sycl = ["-fsycl"]
+ _project_cmplr_flag_stdcpp_static = []  # This brakes TBB ["-static-libstdc++", "-static-libgcc"]
+diff --git a/utils/command_build_cmake_clib.py b/utils/command_build_cmake_clib.py
+index 0ef0e24..84f2469 100644
+--- a/utils/command_build_cmake_clib.py
++++ b/utils/command_build_cmake_clib.py
+@@ -112,7 +112,7 @@ class custom_build_cmake_clib(build_clib.build_clib):
+             "-S" + backend_directory,
+             "-B" + abs_build_temp_path,
+             "-DCMAKE_BUILD_TYPE=" + config,
+-            "-DDPNP_INSTALL_PREFIX=" + install_directory.replace(os.sep, "/"),  # adjust to cmake requirenments
++            "-DDPNP_INSTALL_PREFIX=" + os.environ.get('BUILD_DIR_LIBS'),  # adjust to cmake requirenments
+             "-DDPNP_INSTALL_STRUCTURED=OFF",
+             # "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=" + install_directory,
+             "-DDPNP_SYCL_QUEUE_MGR_ENABLE:BOOL=" + _dpctrl_exists,


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-25 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-25 14:19 [gentoo-commits] proj/sci:master commit in: dev-python/dpnp/, dev-python/dpnp/files/ Andrew Ammerlaan
  -- strict thread matches above, loose matches on Subject: below --
2022-12-12 15:16 Andrew Ammerlaan
2022-12-12 15:16 Andrew Ammerlaan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox