/[gentoo-x86]/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-6.5.19.ebuild
Gentoo

Contents of /dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-6.5.19.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Mon Jan 26 07:12:37 2015 UTC (3 years, 7 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +4 -3 lines
dev-util/nvidia-cuda-sdk: Restrict nvidia-drivers dependency for x86 to <346.35 because of missing uvm support, #534156

(Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-6.5.19.ebuild,v 1.3 2014/11/18 12:32:56 jlec Exp $
4
5 EAPI=5
6
7 inherit cuda eutils flag-o-matic portability toolchain-funcs unpacker versionator
8
9 MYD=$(get_version_component_range 1)_$(get_version_component_range 2)
10
11 DESCRIPTION="NVIDIA CUDA Software Development Kit"
12 HOMEPAGE="http://developer.nvidia.com/cuda"
13 CURI="http://developer.download.nvidia.com/compute/cuda/${MYD}/rel/installers"
14 SRC_URI="
15 amd64? ( ${CURI}/cuda_${PV}_linux_64.run )
16 x86? ( ${CURI}/cuda_${PV}_linux_32.run )"
17
18 LICENSE="CUDPP"
19 SLOT="0"
20 KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux"
21 IUSE="debug +doc +examples opencl +cuda"
22
23 RDEPEND="
24 ~dev-util/nvidia-cuda-toolkit-${PV}
25 media-libs/freeglut
26 examples? (
27 media-libs/freeimage
28 media-libs/glew
29 virtual/mpi
30 >=x11-drivers/nvidia-drivers-340.32[uvm]
31 x86? ( <x11-drivers/nvidia-drivers-346.35[uvm] )
32 )"
33 DEPEND="${RDEPEND}"
34
35 RESTRICT="test"
36
37 S=${WORKDIR}/cuda-samples
38
39 QA_EXECSTACK=(
40 opt/cuda/sdk/0_Simple/cdpSimplePrint/cdpSimplePrint
41 opt/cuda/sdk/0_Simple/cdpSimpleQuicksort/cdpSimpleQuicksort
42 opt/cuda/sdk/bin/x86_64/linux/release/cdpSimplePrint
43 opt/cuda/sdk/bin/x86_64/linux/release/cdpSimpleQuicksort
44 )
45
46 src_unpack() {
47 unpacker
48 unpacker run_files/cuda-samples*run
49 }
50
51 pkg_setup() {
52 if use cuda || use opencl; then
53 cuda_pkg_setup
54 fi
55
56 if use x86; then
57 ewarn "Starting with version 6.5 NVIDIA dropped more and more"
58 ewarn "the support for 32bit linux."
59 ewarn "Be aware that bugfixes and new features may not be available."
60 ewarn "http://dev.gentoo.org/~jlec/distfiles/CUDA_Toolkit_Release_Notes.pdf"
61 fi
62 }
63
64 src_prepare() {
65 export RAWLDFLAGS="$(raw-ldflags)"
66 # epatch "${FILESDIR}"/${P}-asneeded.patch
67
68 sed \
69 -e 's:-O2::g' \
70 -e 's:-O3::g' \
71 -e "/LINK/s:gcc:$(tc-getCC) ${LDFLAGS}:g" \
72 -e "/LINK/s:g++:$(tc-getCXX) ${LDFLAGS}:g" \
73 -e "/CC/s:gcc:$(tc-getCC):g" \
74 -e "/GCC/s:g++:$(tc-getCXX):g" \
75 -e "/NVCC /s|\(:=\).*|:= ${EPREFIX}/opt/cuda/bin/nvcc|g" \
76 -e "/ CFLAGS/s|\(:=\)|\1 ${CFLAGS}|g" \
77 -e "/ CXXFLAGS/s|\(:=\)|\1 ${CXXFLAGS}|g" \
78 -e "/NVCCFLAGS/s|\(:=\)|\1 ${NVCCFLAGS} |g" \
79 -e 's:-Wimplicit::g' \
80 -e "s|../../common/lib/linux/\$(OS_ARCH)/libGLEW.a|$(pkg-config --libs glew)|g" \
81 -e "s|../../common/lib/\$(OSLOWER)/libGLEW.a|$(pkg-config --libs glew)|g" \
82 -e "s|../../common/lib/\$(OSLOWER)/\$(OS_ARCH)/libGLEW.a|$(pkg-config --libs glew)|g" \
83 -i $(find . -type f -name "Makefile") || die
84
85 # -e "/ALL_LDFLAGS/s|:=|:= ${RAWLDFLAGS} |g" \
86 find common/inc/GL -delete || die
87 find . -type f -name "*\.a" -delete || die
88 }
89
90 src_compile() {
91 use examples || return
92 local myopts verbose="verbose=1"
93 use debug && myopts+=" dbg=1"
94 export FAKEROOTKEY=1 # Workaround sandbox issue in #462602
95 emake \
96 cuda-install="${EPREFIX}/opt/cuda" \
97 CUDA_PATH="${EPREFIX}/opt/cuda/" \
98 MPI_GCC=10 \
99 ${myopts} ${verbose}
100 }
101
102 src_test() {
103 local _dir _subdir
104
105 addwrite /dev/nvidiactl
106 addwrite /dev/nvidia0
107
108 for _dir in {0..9}*; do
109 pushd ${_dir} > /dev/null
110 for _subdir in *; do
111 emake -C ${_subdir} run
112 done
113 popd > /dev/null
114 done
115 }
116
117 src_install() {
118 local i j f t crap=""
119
120 if use doc; then
121 ebegin "Installing docs ..."
122 treecopy $(find -type f \( -name readme.txt -o -name "*.pdf" \)) "${ED}"/usr/share/doc/${PF}/
123 docompress -x $(find "${ED}"/usr/share/doc/${PF}/ -type f -name readme.txt | sed -e "s:${ED}::")
124 eend
125 fi
126
127 crap+=" *.txt Samples.htm*"
128
129 ebegin "Cleaning before installation..."
130 for i in ${crap}; do
131 if [[ -e ${i} ]]; then
132 find ${i} -delete || die
133 fi
134 done
135 find -type f \( -name "*.o" -o -name "*.pdf" -o -name "readme.txt" \) -delete || die
136 eend
137
138 ebegin "Moving files..."
139 for f in $(find .); do
140 local t="$(dirname ${f})"
141 if [[ ${t/obj\/} != ${t} || ${t##*.} == a ]]; then
142 continue
143 fi
144 if [[ ! -d ${f} ]]; then
145 if [[ -x ${f} ]]; then
146 exeinto /opt/cuda/sdk/${t}
147 doexe ${f}
148 else
149 insinto /opt/cuda/sdk/${t}
150 doins ${f}
151 fi
152 fi
153 done
154 eend
155 }

  ViewVC Help
Powered by ViewVC 1.1.20