1 # Maintainer: Thomas Jost <schnouki@schnouki.net>
2 # Contributor: Carson Reynolds <carson@k2.t.u-tokyo.ac.jp>
4 # A x86_64 binary version of this package is available from my custom
5 # repository. If you wish to use it, just add the following lines to your
8 # Server = http://repo.schnouki.net/archlinux/$arch
9 # Then run "pacman -Sy cuda-toolkit" as root.
16 pkgdesc="NVIDIA's CUDA architecture can be programmed in the only C language environment that unlocks the processing power of GPUs to solve the most complex compute-intensive challenges."
17 arch=('i686' 'x86_64')
19 url="http://www.nvidia.com/object/cuda_home.html"
22 depends=('gcc44' 'gcc-libs' 'nvidia>=270.41' 'ncurses' 'zlib')
23 optdepends=('libpng12: for the Compute Visual Profiler'
24 'libxext: for the Compute Visual Profiler'
25 'qt: for the Compute Visual Profiler'
26 'qt-assistant-compat: for the Compute Visual Profiler')
28 provides=("opencl-headers" "thrust")
29 conflicts=("opencl-headers" "thrust")
32 if [ "$CARCH" = "i686" ]; then
34 md5sums=('20d69b2d5bb7043ca7c2ad679c2825ed'
35 '6426892e521b931a18b57e3680b1cc4e')
38 md5sums=('152e1069f39fc8bbece875a1b9f576b6'
39 '1fc9673eccb604ed6e386397b995ec25')
40 optdepends=("${optdepends[@]}"
41 'lib32-nvidia-utils: for profiling 32 bits CUDA applications')
44 source=(http://developer.download.nvidia.com/compute/cuda/4_0/toolkit/cudatoolkit_${pkgver}_linux_${_bits}_fedora${_fedver}.run
45 http://developer.download.nvidia.com/compute/cuda/4_0/ToolsSDK/cudatools_${pkgver}_linux_${_bits}.run)
52 msg2 "Uncompressing the CUDA toolkit..."
53 sh cudatoolkit_${pkgver}_linux_${_bits}_fedora${_fedver}.run --noexec --keep --target toolkit >/dev/null
55 msg2 "Uncompressing the CUDA tools SDK..."
56 sh cudatools_${pkgver}_linux_${_bits}.run --noexec --keep --target tools >/dev/null
58 msg2 "Patching nvcc.profile..."
59 # Thanks Valentine Sinitsyn for the idea!
60 echo '' >> toolkit/bin/nvcc.profile
61 echo '# Arch-specific paths' >> toolkit/bin/nvcc.profile
62 echo 'INCLUDES += "-I$(TOP)/include/cuda" $(_SPACE_)' >> toolkit/bin/nvcc.profile
63 echo 'compiler-bindir = /opt/gcc-4.4' >> toolkit/bin/nvcc.profile
66 #echo "Inspect srcdir"
71 # Installing by hand will be easier than using the stupid install scripts. And cleaner too.
74 msg2 "Installing the CUDA Toolkit..."
79 find bin/ -type f -exec install -Dm755 "{}" "$pkgdir/usr/{}" \;
80 chmod 644 "$pkgdir/usr/bin/nvcc.profile"
81 install -Dm755 computeprof/bin/computeprof "$pkgdir/usr/bin/computeprof"
82 install -Dm755 open64/bin/nvopencc "$pkgdir/usr/bin/nvopencc"
87 find . -type f -exec install -Dm644 "{}" "$pkgdir/usr/include/cuda/{}" \;
88 mv "$pkgdir/usr/include/cuda/CL" "$pkgdir/usr/include/CL"
93 find . -type f -exec install -Dm644 "{}" "$pkgdir/usr/share/doc/$pkgname/{}" \;
95 find . -type f -exec install -Dm644 "{}" "$pkgdir/usr/share/doc/$pkgname/computeprof/{}" \;
97 install -Dm644 computeprof/Compute_Visual_Profiler_Release_Notes_Linux.txt "$pkgdir/usr/share/doc/$pkgname/"
98 mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
99 ln -s ../../doc/$pkgname/EULA.txt "$pkgdir/usr/share/licenses/$pkgname/EULA.txt"
103 if [ "$CARCH" = "i686" ]; then
104 find lib/ -type f -exec install -Dm755 "{}" "$pkgdir/usr/{}" \;
105 install -Dm755 computeprof/bin/cudaapitrace32.so "$pkgdir/usr/lib/"
107 find lib/ lib64/ -type f -exec install -Dm755 "{}" "$pkgdir/usr/{}" \;
108 rm -rf "$pkgdir/usr/lib32"
109 mv "$pkgdir/usr/lib" "$pkgdir/usr/lib32"
110 mv "$pkgdir/usr/lib64" "$pkgdir/usr/lib"
111 install -Dm755 computeprof/bin/cudaapitrace32.so "$pkgdir/usr/lib32/"
112 install -Dm755 computeprof/bin/cudaapitrace64.so "$pkgdir/usr/lib/"
115 find lib/ -type f -exec install -Dm755 "{}" "$pkgdir/usr/{}" \;
120 find computeprof/projects/ src/ -type f -exec install -Dm644 "{}" "$pkgdir/usr/share/$pkgname/{}" \;
123 # (untested, not sure it really belongs in this package)
124 msg2 "Installing the CUDA tools SDK..."
130 find . -type f -exec install -Dm644 "{}" "$pkgdir/usr/include/cuda/cupti/{}" \;
132 find . -type f -exec install -Dm644 "{}" "$pkgdir/usr/share/doc/$pkgname/cupti/{}" \;
134 find lib/ -type f -exec install -Dm755 "{}" "$pkgdir/usr/{}" \;
135 find sample/ -type f -exec install -Dm644 "{}" "$pkgdir/usr/share/$pkgname/cupti/{}" \;
140 find . -type f -exec install -Dm644 "{}" "$pkgdir/usr/share/doc/$pkgname/{}" \;
142 find . -type f -exec install -Dm644 "{}" "$pkgdir/usr/include/cuda/{}" \;
147 find . -type f -name '*.h' -exec install -Dm644 "{}" "$pkgdir/usr/include/cuda/{}" \;
148 find . -type f -name '*.dtd' -exec install -Dm644 "{}" "$pkgdir/usr/share/cuda/nvml/{}" \;
150 find . -type f -exec install -Dm644 "{}" "$pkgdir/usr/share/doc/cuda/nvml/{}" \;
151 # Don't install nvidia-smi, the library and the manpage, they are already in nvidia-utils
154 msg2 "Creating required symlinks..."
156 # Create required symlinks to libraries
157 for _lib in $(find "$pkgdir" -name '*.so*'); do
158 _soname="$(dirname ${_lib})/$(readelf -d "$_lib" | sed -nr 's/.*Library soname: \[(.*)\].*/\1/p')"
159 if [ ! -e "${_soname}" ]; then
160 ln -s "$(basename ${_lib})" "${_soname}"
161 ln -s "$(basename ${_soname})" "${_soname/.[0-9]*/}"
165 # Hack: cuda-gdb needs libtinfo.so.5, which is apparently now in ncurses
166 ln -s libncurses.so.5 "$pkgdir/usr/lib/libtinfo.so.5"
169 #echo "Inspect pkgdir"
174 # pkgbuild-update-sums-on-save: nil