1 |
commit: 0cbbfe38a4875e65712e97f5fd2572053e65e17d |
2 |
Author: Pastafarianist <mr.pastafarianist <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Feb 1 14:59:08 2016 +0000 |
4 |
Commit: Maxim Koltsov <maksbotan <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 1 14:59:08 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/dev/maksbotan.git/commit/?id=0cbbfe38 |
7 |
|
8 |
dev-util/nvidia-cuda-toolkit: added to the repo |
9 |
|
10 |
Added version 7.0 of CUDA toolkit, as required by TensorFlow. |
11 |
|
12 |
dev-util/nvidia-cuda-toolkit/Manifest | 4 + |
13 |
dev-util/nvidia-cuda-toolkit/files/cuda-config.in | 28 ++++ |
14 |
dev-util/nvidia-cuda-toolkit/metadata.xml | 12 ++ |
15 |
.../nvidia-cuda-toolkit-7.0.28.ebuild | 144 +++++++++++++++++++++ |
16 |
4 files changed, 188 insertions(+) |
17 |
|
18 |
diff --git a/dev-util/nvidia-cuda-toolkit/Manifest b/dev-util/nvidia-cuda-toolkit/Manifest |
19 |
new file mode 100644 |
20 |
index 0000000..4418375 |
21 |
--- /dev/null |
22 |
+++ b/dev-util/nvidia-cuda-toolkit/Manifest |
23 |
@@ -0,0 +1,4 @@ |
24 |
+AUX cuda-config.in 406 SHA256 7271463891ff75dd83f4cb42bb3004d3204243d0e38f9cbd5b4ec4560865496a SHA512 df6d16bd2e800868bdf8401b6f82a387b701ea297ddf6e8feb0daf5222e62a33f156e5f45cf1ee4e1aa51559dfbd56b897c257dae1bb9568e839bf806bfebd5b WHIRLPOOL 4a26ee11d97676827cb01644891fdca495c3373585ddfbb5fab9f988186da384f27482c4be9e27d834036ffa87f7ee19f9ad7da2d8536babe874dda4ff991147 |
25 |
+DIST cuda_7.0.28_linux.run 1118797679 SHA256 d1292e9c2bbaddad24c46e0b0d15a7130831bfac0382f7159321f41ae385a5ce SHA512 f002433133e40000cbb78283e08c25f7397612957c0440605311f8921bcebd54a808069ca36b218be66a054e8afab4871b2bf1bd4d419c6f98a0d74b00a9bc78 WHIRLPOOL dcf21d2e356a1797b9e79ac9edfb3924a1d4a2914382dbe21b2172c200dd4f7d93905ac44fbc2e994ce14b7ab28e78163f4c81ddcc6cbb97e4ce085efd2d8475 |
26 |
+EBUILD nvidia-cuda-toolkit-7.0.28.ebuild 3393 SHA256 44d5f203a7b49c61d020a0e9b65bb12958d5cb2663c3215d06c18ac207846c76 SHA512 d99cc4cf16294209a405859d86a55e8bc6e55c5509e91d895814cef3196a4f01fb015a6646c795fbd22fff8bb015666155dda64905aadf401807daea2a18f5be WHIRLPOOL 754a2f5ae7b581237061cb9e48896e7bb8f37cbed0c5f6845588987e3f05b49973da022fb08dbf4ec821176dc53d495a1b7d68e9ce9603385bb906c319bbf1a2 |
27 |
+MISC metadata.xml 334 SHA256 7f82f3ac64a875b388a50a2b73d8f527a394d557058b2768c4b8413a0c8e2a62 SHA512 66ce6d1667d4a432f10e0eeb2969905a0ef98390ec362ac96b48206ed62c524addc84e849304a41b724d00a1996b9f1f19a6a84bee6bdd847d64438de1d3ccaa WHIRLPOOL a6d86d69a4fde02eba43d35d8fb38f6288ab9835a427ad6afa5a36c348060c1e84f492ca6c4b03b2bff7a7b735799970c9a54479030af711ca5ad047778c8496 |
28 |
|
29 |
diff --git a/dev-util/nvidia-cuda-toolkit/files/cuda-config.in b/dev-util/nvidia-cuda-toolkit/files/cuda-config.in |
30 |
new file mode 100644 |
31 |
index 0000000..ca0d1d7 |
32 |
--- /dev/null |
33 |
+++ b/dev-util/nvidia-cuda-toolkit/files/cuda-config.in |
34 |
@@ -0,0 +1,28 @@ |
35 |
+#!/bin/bash |
36 |
+ |
37 |
+SUPPORT_GCC_VERSIONS_BY_CUDA="CUDA_SUPPORTED_GCC" |
38 |
+ |
39 |
+_print_help() { |
40 |
+ cat <<- EOF |
41 |
+ Usage: |
42 |
+ $(basename $0) [options] |
43 |
+ |
44 |
+ -s | --supported Returns by current CUDA supported gcc versions |
45 |
+ -h | --help Shows this help |
46 |
+ EOF |
47 |
+} |
48 |
+ |
49 |
+case ${1} in |
50 |
+ -s|--supported) |
51 |
+ echo "${SUPPORT_GCC_VERSIONS_BY_CUDA}" |
52 |
+ exit 0 |
53 |
+ ;; |
54 |
+ -h|--help) |
55 |
+ _print_help |
56 |
+ exit -1 |
57 |
+ ;; |
58 |
+ *) |
59 |
+ _print_help |
60 |
+ exit 1 |
61 |
+ ;; |
62 |
+esac |
63 |
|
64 |
diff --git a/dev-util/nvidia-cuda-toolkit/metadata.xml b/dev-util/nvidia-cuda-toolkit/metadata.xml |
65 |
new file mode 100644 |
66 |
index 0000000..62ab4c3 |
67 |
--- /dev/null |
68 |
+++ b/dev-util/nvidia-cuda-toolkit/metadata.xml |
69 |
@@ -0,0 +1,12 @@ |
70 |
+<?xml version="1.0" encoding="UTF-8"?> |
71 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
72 |
+<pkgmetadata> |
73 |
+<maintainer> |
74 |
+ <email>maksbotan@g.o</email> |
75 |
+ <name>Maxim Koltsov</name> |
76 |
+</maintainer> |
77 |
+<maintainer> |
78 |
+ <email>mr.pastafarianist@×××××.com</email> |
79 |
+ <name>Dmitry Nikulin</name> |
80 |
+</maintainer> |
81 |
+</pkgmetadata> |
82 |
\ No newline at end of file |
83 |
|
84 |
diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-7.0.28.ebuild b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-7.0.28.ebuild |
85 |
new file mode 100644 |
86 |
index 0000000..ce138f0 |
87 |
--- /dev/null |
88 |
+++ b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-7.0.28.ebuild |
89 |
@@ -0,0 +1,144 @@ |
90 |
+# Copyright 1999-2016 Gentoo Foundation |
91 |
+# Distributed under the terms of the GNU General Public License v2 |
92 |
+# $Id$ |
93 |
+ |
94 |
+EAPI=5 |
95 |
+ |
96 |
+inherit check-reqs cuda unpacker versionator |
97 |
+ |
98 |
+MYD=$(get_version_component_range 1)_$(get_version_component_range 2) |
99 |
+ |
100 |
+DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)" |
101 |
+HOMEPAGE="http://developer.nvidia.com/cuda" |
102 |
+SRC_URI="http://developer.download.nvidia.com/compute/cuda/${MYD}/Prod/local_installers/cuda_${PV}_linux.run" |
103 |
+ |
104 |
+SLOT="0/${PV}" |
105 |
+LICENSE="NVIDIA-CUDA" |
106 |
+KEYWORDS="-* ~amd64 ~amd64-linux" |
107 |
+IUSE="debugger doc eclipse profiler" |
108 |
+ |
109 |
+DEPEND="" |
110 |
+RDEPEND="${DEPEND} |
111 |
+ >=sys-devel/gcc-4.7[cxx] |
112 |
+ <sys-devel/gcc-5[cxx] |
113 |
+ >=x11-drivers/nvidia-drivers-352.39[uvm] |
114 |
+ debugger? ( |
115 |
+ sys-libs/libtermcap-compat |
116 |
+ sys-libs/ncurses[tinfo] |
117 |
+ ) |
118 |
+ eclipse? ( >=virtual/jre-1.6 ) |
119 |
+ profiler? ( >=virtual/jre-1.6 )" |
120 |
+ |
121 |
+S="${WORKDIR}" |
122 |
+ |
123 |
+QA_PREBUILT="opt/cuda/*" |
124 |
+ |
125 |
+CHECKREQS_DISK_BUILD="1500M" |
126 |
+ |
127 |
+pkg_setup() { |
128 |
+ # We don't like to run cuda_pkg_setup as it depends on us |
129 |
+ check-reqs_pkg_setup |
130 |
+} |
131 |
+ |
132 |
+src_unpack() { |
133 |
+ unpacker |
134 |
+ unpacker run_files/cuda-linux*.run |
135 |
+} |
136 |
+ |
137 |
+src_prepare() { |
138 |
+ local cuda_supported_gcc |
139 |
+ |
140 |
+ cuda_supported_gcc="4.7 4.8 4.9" |
141 |
+ |
142 |
+ sed \ |
143 |
+ -e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc}:g" \ |
144 |
+ "${FILESDIR}"/cuda-config.in > "${T}"/cuda-config || die |
145 |
+} |
146 |
+ |
147 |
+src_install() { |
148 |
+ local i j |
149 |
+ local remove="doc jre run_files install-linux.pl " |
150 |
+ local cudadir=/opt/cuda |
151 |
+ local ecudadir="${EPREFIX}"${cudadir} |
152 |
+ |
153 |
+ # dodoc doc/*txt |
154 |
+ if use doc; then |
155 |
+ dodoc doc/pdf/* |
156 |
+ dohtml -r doc/html/* |
157 |
+ fi |
158 |
+ |
159 |
+ mv doc/man/man3/{,cuda-}deprecated.3 || die |
160 |
+ doman doc/man/man*/* |
161 |
+ |
162 |
+ use debugger || remove+=" bin/cuda-gdb extras/Debugger" |
163 |
+ ( use profiler || use eclipse ) || remove+=" libnsight" |
164 |
+ remove+=" cuda-installer.pl" |
165 |
+ |
166 |
+ if use profiler; then |
167 |
+ # hack found in install-linux.pl |
168 |
+ for j in nvvp nsight; do |
169 |
+ cat > bin/${j} <<- EOF |
170 |
+ #!${EPREFIX}/bin/sh |
171 |
+ LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${ecudadir}/lib:${ecudadir}/lib64 \ |
172 |
+ UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 \ |
173 |
+ ${ecudadir}/lib${j}/${j} -vm ${EPREFIX}/usr/bin/java |
174 |
+ EOF |
175 |
+ chmod a+x bin/${j} |
176 |
+ done |
177 |
+ else |
178 |
+ use eclipse || remove+=" libnvvp" |
179 |
+ remove+=" extras/CUPTI" |
180 |
+ fi |
181 |
+ |
182 |
+ for i in ${remove}; do |
183 |
+ ebegin "Cleaning ${i}..." |
184 |
+ if [[ -e ${i} ]]; then |
185 |
+ find ${i} -delete || die |
186 |
+ eend |
187 |
+ else |
188 |
+ eend $1 |
189 |
+ fi |
190 |
+ done |
191 |
+ |
192 |
+ ln -sf lib lib32 || die |
193 |
+ |
194 |
+ dodir ${cudadir} |
195 |
+ mv * "${ED}"${cudadir} || die |
196 |
+ |
197 |
+ cat > "${T}"/99cuda <<- EOF |
198 |
+ PATH=${ecudadir}/bin$(use profiler && echo ":${ecudadir}/libnvvp") |
199 |
+ ROOTPATH=${ecudadir}/bin |
200 |
+ LDPATH=${ecudadir}/lib64:${ecudadir}/lib:${ecudadir}/nvvm/lib64 |
201 |
+ EOF |
202 |
+ doenvd "${T}"/99cuda |
203 |
+ |
204 |
+ use profiler && \ |
205 |
+ make_wrapper nvprof "${EPREFIX}"${cudadir}/bin/nvprof "." ${ecudadir}/lib64:${ecudadir}/lib |
206 |
+ |
207 |
+ dobin "${T}"/cuda-config |
208 |
+} |
209 |
+ |
210 |
+pkg_postinst_check() { |
211 |
+ local a b |
212 |
+ a="$(version_sort $(cuda-config -s))"; a=( $a ) |
213 |
+ # greatest supported version |
214 |
+ b=${a[${#a[@]}-1]} |
215 |
+ |
216 |
+ # if gcc and if not gcc-version is at least greatesst supported |
217 |
+ if [[ $(tc-getCC) == *gcc* ]] && \ |
218 |
+ ! version_is_at_least $(gcc-version) ${b}; then |
219 |
+ echo |
220 |
+ ewarn "gcc >= ${b} will not work with CUDA" |
221 |
+ ewarn "Make sure you set an earlier version of gcc with gcc-config" |
222 |
+ ewarn "or append --compiler-bindir= pointing to a gcc bindir like" |
223 |
+ ewarn "--compiler-bindir=${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/gcc${b}" |
224 |
+ ewarn "to the nvcc compiler flags" |
225 |
+ echo |
226 |
+ fi |
227 |
+} |
228 |
+ |
229 |
+pkg_postinst() { |
230 |
+ if [[ ${MERGE_TYPE} != binary ]]; then |
231 |
+ pkg_postinst_check |
232 |
+ fi |
233 |
+} |