1 |
commit: 9798f1a204499b1c54a58aeaa8fbc962c20590b9 |
2 |
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed Aug 3 13:32:40 2022 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 22 01:07:56 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9798f1a2 |
7 |
|
8 |
dev-libs/rccl: add 5.1.3, using rocm.eclass |
9 |
|
10 |
relax SLOT dependency on dev-util/hip, since rccl is also part of high |
11 |
level ROCm libraries. |
12 |
|
13 |
This unlocks the exact SLOT dependency of the lower and higher level |
14 |
ROCm tools to make version bumps easier. |
15 |
|
16 |
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com> |
17 |
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org> |
18 |
|
19 |
dev-libs/rccl/Manifest | 1 + |
20 |
.../rccl/files/rccl-5.1.3-remove-chrpath.patch | 32 ++++++++++++++ |
21 |
dev-libs/rccl/rccl-5.1.3.ebuild | 51 ++++++++++++++++++++++ |
22 |
3 files changed, 84 insertions(+) |
23 |
|
24 |
diff --git a/dev-libs/rccl/Manifest b/dev-libs/rccl/Manifest |
25 |
index b50fab6d5c7b..801fbb23f13b 100644 |
26 |
--- a/dev-libs/rccl/Manifest |
27 |
+++ b/dev-libs/rccl/Manifest |
28 |
@@ -1,3 +1,4 @@ |
29 |
DIST rccl-4.0.0.tar.gz 741814 BLAKE2B c20178e45fb7787ef7f5e20326f91f11a1b2a575277b5f28591b0be6efa6730c3509b11255372648f1df50e33b5e593dbe9c3334c5001f39423fc70acfa49d07 SHA512 d25754895d7b5695e46031642c2550cf2b6b5c42628d8381a23d6d1a48699a14a4fdf842205a14b96bdd1339341f9e558492ef9366a63036d8a8a7011d2c1b05 |
30 |
DIST rccl-4.3.0.tar.gz 836631 BLAKE2B c7fede9cf92d3e75b79da2874c0a1e45c5fd4ad9d24b11c9870e9fdef8d571a286cbf54ae0a033f2aec3d21b06cafc2b1c097aaf87ecd628f0c33e9267103be1 SHA512 1a27e6441955f01c853861f83743da2fc9597978c3ff99f238734d4bafb1e277d626811b72c6a12563d69b2b8265960b8a2566df618921557837035b92993f0e |
31 |
DIST rccl-5.0.2.tar.gz 888060 BLAKE2B f75d83b0f52487b4f7a2d30763ae4fb0d216fc353e62de981057cb855d5b26c7b846622c76330029c1ed5bd195695308bcef5c67d39526032dfee254084a40f7 SHA512 ee62720926008f67fcae0fc9a6ace23ca593a156f74fce6012ff2a6fcffdc2e2dc70d48cd3830b217e68449ba3e677b4005d20bd4554aeccf17cba56713cb00f |
32 |
+DIST rccl-5.1.3.tar.gz 908274 BLAKE2B 46bff7b6e3d60d5884ccd7e19c54b2f47f90a337a8fdc6dca1a3cfee147e3652e1f912642cc134d4a82bf8daabd9f1391edff139d0517ab1078bd3d9650481d7 SHA512 20deb27c7ef3e6b6b73409950ac0d51286b4634f7002ce36a9a02cdd1d5b1f2db51f6decf773af83364c94f58cc96837da25299f5f5494fc15d8559a1b3c7fcc |
33 |
|
34 |
diff --git a/dev-libs/rccl/files/rccl-5.1.3-remove-chrpath.patch b/dev-libs/rccl/files/rccl-5.1.3-remove-chrpath.patch |
35 |
new file mode 100644 |
36 |
index 000000000000..26bad572c7d8 |
37 |
--- /dev/null |
38 |
+++ b/dev-libs/rccl/files/rccl-5.1.3-remove-chrpath.patch |
39 |
@@ -0,0 +1,32 @@ |
40 |
+Manually chrpath not needed in CMakeLists since CMAKE_SKIP_RPATH=On |
41 |
+So chrpath dependency is not needed |
42 |
+=================================================================== |
43 |
+--- rccl-rocm-5.1.3.orig/test/CMakeLists.txt |
44 |
++++ rccl-rocm-5.1.3/test/CMakeLists.txt |
45 |
+@@ -5,11 +5,6 @@ if(BUILD_TESTS) |
46 |
+ |
47 |
+ message("Going to build unit tests (Installed in /test/UnitTests)") |
48 |
+ |
49 |
+- find_program(CHRPATH chrpath) |
50 |
+- if(NOT CHRPATH) |
51 |
+- message(FATAL_ERROR "chrpath is required for UnitTests. Please install (e.g. sudo apt-get install chrpath)") |
52 |
+- endif() |
53 |
+- |
54 |
+ include_directories(${GTEST_INCLUDE_DIRS}) |
55 |
+ |
56 |
+ if(BUILD_ALLREDUCE_ONLY) |
57 |
+@@ -88,14 +83,6 @@ if(BUILD_TESTS) |
58 |
+ # HIPCC adds /opt/rocm/lib as RPATH, even though the install process is supposed to |
59 |
+ # remove RPATH. It also occurs before any user-specified rpath, which effectively overrides the user rpath. |
60 |
+ # As a work-around, set the correct RPATH for the unit test executable as a post-install step |
61 |
+- if (CMAKE_INSTALL_PREFIX MATCHES "${ROCM_PATH}") |
62 |
+- # install_prefix/CMAKE_INSTALL_PREFIX was not explicitly specified, so look in build/release |
63 |
+- add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:${ROCM_PATH}/lib ${CMAKE_BINARY_DIR}/test/UnitTests) |
64 |
+- add_custom_command( TARGET UnitTestsMultiProcess POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:${ROCM_PATH}/lib ${CMAKE_BINARY_DIR}/test/UnitTestsMultiProcess) |
65 |
+- else() |
66 |
+- add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:${ROCM_PATH}/lib ${CMAKE_INSTALL_PREFIX}/test/UnitTests) |
67 |
+- add_custom_command( TARGET UnitTestsMultiProcess POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:${ROCM_PATH}/lib ${CMAKE_INSTALL_PREFIX}/test/UnitTestsMultiProcess) |
68 |
+- endif() |
69 |
+ else() |
70 |
+ message("Not building unit tests") |
71 |
+ endif() |
72 |
|
73 |
diff --git a/dev-libs/rccl/rccl-5.1.3.ebuild b/dev-libs/rccl/rccl-5.1.3.ebuild |
74 |
new file mode 100644 |
75 |
index 000000000000..b7256c9d8ed4 |
76 |
--- /dev/null |
77 |
+++ b/dev-libs/rccl/rccl-5.1.3.ebuild |
78 |
@@ -0,0 +1,51 @@ |
79 |
+# Copyright 1999-2022 Gentoo Authors |
80 |
+# Distributed under the terms of the GNU General Public License v2 |
81 |
+ |
82 |
+EAPI=8 |
83 |
+ |
84 |
+ROCM_VERSION=${PV} |
85 |
+ |
86 |
+inherit cmake edo rocm |
87 |
+ |
88 |
+DESCRIPTION="ROCm Communication Collectives Library (RCCL)" |
89 |
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rccl" |
90 |
+SRC_URI="https://github.com/ROCmSoftwarePlatform/rccl/archive/rocm-${PV}.tar.gz -> rccl-${PV}.tar.gz" |
91 |
+ |
92 |
+LICENSE="BSD" |
93 |
+KEYWORDS="~amd64" |
94 |
+SLOT="0/$(ver_cut 1-2)" |
95 |
+IUSE="test" |
96 |
+ |
97 |
+RDEPEND="dev-util/hip |
98 |
+dev-util/rocm-smi:${SLOT}" |
99 |
+DEPEND="${RDEPEND}" |
100 |
+BDEPEND=">=dev-util/cmake-3.22 |
101 |
+ >=dev-util/rocm-cmake-5.0.2-r1 |
102 |
+ test? ( dev-cpp/gtest )" |
103 |
+ |
104 |
+RESTRICT="!test? ( test )" |
105 |
+S="${WORKDIR}/rccl-rocm-${PV}" |
106 |
+ |
107 |
+PATCHES=( |
108 |
+ "${FILESDIR}/${PN}-5.0.2-change_install_location.patch" |
109 |
+ "${FILESDIR}/${PN}-5.1.3-remove-chrpath.patch" |
110 |
+) |
111 |
+ |
112 |
+src_configure() { |
113 |
+ addpredict /dev/kfd |
114 |
+ addpredict /dev/dri/ |
115 |
+ |
116 |
+ local mycmakeargs=( |
117 |
+ -DSKIP_RPATH=On |
118 |
+ -DAMDGPU_TARGETS="$(get_amdgpu_flags)" |
119 |
+ -DBUILD_TESTS=$(usex test ON OFF) |
120 |
+ -Wno-dev |
121 |
+ ) |
122 |
+ |
123 |
+ CXX=hipcc cmake_src_configure |
124 |
+} |
125 |
+ |
126 |
+src_test() { |
127 |
+ check_amdgpu |
128 |
+ LD_LIBRARY_PATH="${BUILD_DIR}" edob test/UnitTests |
129 |
+} |