Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/nvidia-cuda-toolkit/
Date: Fri, 05 Apr 2019 15:41:53
Message-Id: 1554478711.08a12de7e7bbf1184550c35e3f164419b212160f.perfinion@gentoo
1 commit: 08a12de7e7bbf1184550c35e3f164419b212160f
2 Author: Jan Vesely <jano.vesely <AT> gmail <DOT> com>
3 AuthorDate: Sat Mar 23 06:41:21 2019 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 5 15:38:31 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08a12de7
7
8 dev-util/nvidia-cuda-toolkit: Bump to 10.1.105
9
10 Other changes:
11 Bump to EAPI=7
12 Don't use versionator
13 Update SRC_URI file name
14 Don't unpack the source file twice
15 Use dobin + doins instead of mv
16
17 v2: move to toolkit directory before considering docs
18 v3: remove more gdb/profiler/eclipse content
19
20 Closes: https://github.com/gentoo/gentoo/pull/11481
21 Closes: https://bugs.gentoo.org/681694
22 Signed-off-by: Jan Vesely <jano.vesely <AT> gmail.com>
23 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
24
25 dev-util/nvidia-cuda-toolkit/Manifest | 1 +
26 .../nvidia-cuda-toolkit-10.1.105.ebuild | 143 +++++++++++++++++++++
27 2 files changed, 144 insertions(+)
28
29 diff --git a/dev-util/nvidia-cuda-toolkit/Manifest b/dev-util/nvidia-cuda-toolkit/Manifest
30 index 64438f71631..c6ef0b44ee5 100644
31 --- a/dev-util/nvidia-cuda-toolkit/Manifest
32 +++ b/dev-util/nvidia-cuda-toolkit/Manifest
33 @@ -1,4 +1,5 @@
34 DIST cuda_10.0.130_410.48_linux.run 2020126691 BLAKE2B f784f41c06d81b6f89d07e756347fb94148f79e5fd50650fc340feb6b49dcc2bedd05cf4c7c2662da39955f9393efc048aa17fa921aad86e182186fb6d98ec50 SHA512 409ea4cc6aa0fe7063450e77c3b67b9b41aab1bbe556db673fb1a80610b20bd52e2020bf94034a92ab68c721d3d5739500bae4bd7a3558b2d8e73730a3b4ea25
35 +DIST cuda_10.1.105_418.39_linux.run 2423314285 BLAKE2B 924872eaaa4e8ecd6b81765c91d5e538d968e4fc88792a805339dd9cae15dd70372f310d39b9668d76cadbab875e3c4abcfca5a5cf71e4d83c9db056dc02f51c SHA512 07cdc053989758e4cdccaad566cae7127fa79780ad85033ea52d33cc4c43c9de08e88dd087390c58b542e51703f256859cdf51a018ee57e6a412f45fb9561622
36 DIST cuda_6.5.14_linux_32.run 76788277 BLAKE2B 75e79dce6cac5155bde8a3cafa945047c489b10272f8a3b94bf55d499df4b9c8b82506a81a20f9fd816bd4fd0514e515a6435399db1cb62b027c76490bd4dfae SHA512 89649ee0f4543b37037b7c8f5ed0b8bd502512afb4d93e3158b3df4786123be05a5288986b5abbfe15c14eb010777d2527b715225bea96a354a898c34e4a2fcc
37 DIST cuda_6.5.14_linux_64.run 972320904 BLAKE2B 4a4361fb7a90989ec4b4aa433189e7b358e5a2272fb9b9c59429e0014ac14e3b8de1b247ee98dc30c3f3ee4cc009eca4fdd86027bd3b9527a683353d60bdf5c6 SHA512 fecca731b86955f5bc7b09d88b02951e3ee5d4b1f1cf5f92658227a029b87cd35d6ac22956a5fa0afe62dcdc57191f1d12bb08c9f7cc05128727cd8455947b1e
38 DIST cuda_6.5.19_linux_32.run 81882112 BLAKE2B cf55ef7c969503c156431fc56301ed4e9a1234ae0cb867f12649636069f35e56bf6fc9df7482b6baade45d78c8baa2d98c41a28696da59294e0f575c4a0344ce SHA512 1ce9bd6b472b7e4f1fb181eb340dfcb757714d59a89aaa02146cfe1a97c8ccb7eb7699b4ec823276f277eb4d82d95050eaba17e7ed5fd2e47b9b5d78531c5d4e
39
40 diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-10.1.105.ebuild b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-10.1.105.ebuild
41 new file mode 100644
42 index 00000000000..0ba04a3b7cc
43 --- /dev/null
44 +++ b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-10.1.105.ebuild
45 @@ -0,0 +1,143 @@
46 +# Copyright 1999-2018 Gentoo Authors
47 +# Distributed under the terms of the GNU General Public License v2
48 +
49 +EAPI=7
50 +
51 +inherit check-reqs cuda toolchain-funcs unpacker
52 +
53 +MYD=$(ver_cut 1-2 ${PV})
54 +DRIVER_PV="418.39"
55 +
56 +DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)"
57 +HOMEPAGE="https://developer.nvidia.com/cuda-zone"
58 +SRC_URI="https://developer.nvidia.com/compute/cuda/${MYD}/Prod/local_installers/cuda_${PV}_${DRIVER_PV}_linux.run -> cuda_${PV}_${DRIVER_PV}_linux.run"
59 +
60 +LICENSE="NVIDIA-CUDA"
61 +SLOT="0/${PV}"
62 +KEYWORDS="-* ~amd64 ~amd64-linux"
63 +IUSE="debugger doc eclipse profiler"
64 +
65 +DEPEND=""
66 +RDEPEND="${DEPEND}
67 + <sys-devel/gcc-9[cxx]
68 + >=x11-drivers/nvidia-drivers-396.24[X,uvm]
69 + debugger? (
70 + sys-libs/libtermcap-compat
71 + sys-libs/ncurses:5/5[tinfo]
72 + )
73 + eclipse? ( >=virtual/jre-1.6 )
74 + profiler? ( >=virtual/jre-1.6 )"
75 +
76 +S="${WORKDIR}"
77 +
78 +QA_PREBUILT="opt/cuda/*"
79 +
80 +CHECKREQS_DISK_BUILD="6100M"
81 +
82 +pkg_setup() {
83 + # We don't like to run cuda_pkg_setup as it depends on us
84 + check-reqs_pkg_setup
85 +}
86 +
87 +src_prepare() {
88 + local cuda_supported_gcc
89 +
90 + cuda_supported_gcc="4.7 4.8 4.9 5.3 5.4 6.3 6.4 7.2 7.3 8.2 8.3"
91 +
92 + sed \
93 + -e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc}:g" \
94 + "${FILESDIR}"/cuda-config.in > "${T}"/cuda-config || die
95 +
96 + default
97 +}
98 +
99 +src_install() {
100 + local i remove=( doc jre run_files install-linux.pl cuda-installer.pl )
101 + local cudadir=/opt/cuda
102 + local ecudadir="${EPREFIX}${cudadir}"
103 +
104 + cd builds/cuda-toolkit
105 + if use doc; then
106 + DOCS+=( doc/pdf/. )
107 + HTML_DOCS+=( doc/html/. )
108 + fi
109 + einstalldocs
110 +
111 + mv doc/man/man3/{,cuda-}deprecated.3 || die
112 + doman doc/man/man*/*
113 +
114 + use debugger || remove+=( bin/cuda-gdb bin/cuda-gdbserver extras/Debugger share/gdb extras/cuda-gdb-${PV}.src.tar.gz )
115 +
116 + if use profiler; then
117 + # hack found in install-linux.pl
118 + for i in nvvp nsight; do
119 + cat > bin/${i} <<- EOF || die
120 + #!/usr/bin/env sh
121 + LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${ecudadir}/lib:${ecudadir}/lib64 \
122 + UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 \
123 + ${ecudadir}/lib${i}/${i} -vm ${EPREFIX}/usr/bin/java
124 + EOF
125 + chmod a+x bin/${i} || die
126 + done
127 + else
128 + use eclipse || remove+=( libnvvp libnsight nsightee_plugins NsightCompute-2019.1 NsightSystems-2018.3 bin/nsight bin/nsight_ee_plugins_manage.sh bin/nvvp bin/computeprof )
129 + remove+=( extras/CUPTI bin/nvprof )
130 + fi
131 +
132 + for i in "${remove[@]}"; do
133 + ebegin "Cleaning ${i}..."
134 + rm -rf "${i}" || die
135 + eend
136 + done
137 +
138 + dodir ${cudadir} || die
139 + # Install binaries separately to amke sure the X permission is set
140 + into ${cudadir} || die
141 + dobin $(find bin nvvm/bin -type f) || die
142 + find bin nvvm/bin -type f -delete || die
143 +
144 + # Install the rest
145 + insinto ${cudadir} || die
146 + doins -r * || die
147 +
148 + cat > "${T}"/99cuda <<- EOF || die
149 + PATH=${ecudadir}/bin$(usex profiler ":${ecudadir}/libnvvp" "")
150 + ROOTPATH=${ecudadir}/bin
151 + LDPATH=${ecudadir}/lib64:${ecudadir}/lib:${ecudadir}/nvvm/lib64
152 + EOF
153 + doenvd "${T}"/99cuda
154 +
155 + use profiler && \
156 + make_wrapper nvprof "${ecudadir}/bin/nvprof" "." "${ecudadir}/lib64:${ecudadir}/lib"
157 +
158 + dobin "${T}"/cuda-config
159 +}
160 +
161 +pkg_postinst_check() {
162 + local a b
163 + a="$(cuda-config -s)"
164 + b="0.0"
165 + for v in $a; do
166 + if ver_test "${v}" -gt "${b}"; then
167 + b="${v}"
168 + fi
169 + done
170 +
171 + # if gcc and if not gcc-version is at least greatest supported
172 + if tc-is-gcc && \
173 + ver_test $(gcc-version) -gt ${b}; then
174 + ewarn ""
175 + ewarn "gcc >= ${b} will not work with CUDA"
176 + ewarn "Make sure you set an earlier version of gcc with gcc-config"
177 + ewarn "or append --compiler-bindir= pointing to a gcc bindir like"
178 + ewarn "--compiler-bindir=${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/gcc${b}"
179 + ewarn "to the nvcc compiler flags"
180 + ewarn ""
181 + fi
182 +}
183 +
184 +pkg_postinst() {
185 + if [[ ${MERGE_TYPE} != binary ]]; then
186 + pkg_postinst_check
187 + fi
188 +}