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 cuda3-sdk" 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')
18 [ "$CARCH" = "i686" ] && ARCH=x86
19 [ "$CARCH" = "x86_64" ] && ARCH=x86_64
20 url="http://www.nvidia.com/object/cuda_home.html"
22 depends=("cuda3-toolkit>=${pkgver}"
26 provides=("cuda-sdk=$pkgver")
27 conflicts=('cuda-sdk')
28 source=(http://developer.download.nvidia.com/compute/cuda/${_shortver}_prod/sdk/gpucomputingsdk_${pkgver}_linux.run
30 md5sums=('6f58a696627a236aed20c1f2cd9c74bf'
31 'cdfaddbd4c69f4f25a84e91991b2c45d')
36 sh gpucomputingsdk_${pkgver}_linux.run --noexec --keep --nox11 &> /dev/null
39 #echo "Inspect srcdir"
43 cp pkg/sdk/C/common/common.mk pkg/sdk/C/common/common.mk.original
44 patch -p0 -i $srcdir/common.mk.patch
50 # Build the OpenCL SDK
51 cd $srcdir/pkg/sdk/OpenCL
57 mkdir -p $pkgdir/usr/share/licenses/cuda-sdk
58 mkdir -p $pkgdir/usr/share/doc/cuda-sdk/{C,OpenCL}/releaseNotesData
59 mkdir -p $pkgdir/usr/share/cuda-sdk/{C,OpenCL}/bin/data
61 # Install the binaries
62 install -m755 $srcdir/pkg/sdk/C/bin/linux/release/* $pkgdir/usr/share/cuda-sdk/C/bin
63 install -m755 $srcdir/pkg/sdk/OpenCL/bin/linux/release/* $pkgdir/usr/share/cuda-sdk/OpenCL/bin
65 # Install license information
66 install -m644 $srcdir/pkg/sdk/cudpp_license.txt $pkgdir/usr/share/licenses/cuda-sdk
67 install -m644 $srcdir/pkg/sdk/License.txt $pkgdir/usr/share/licenses/cuda-sdk
69 # Install documentation files
70 install -m644 $srcdir/pkg/sdk/C/doc/*.rtf $srcdir/pkg/sdk/C/Samples.html $pkgdir/usr/share/doc/cuda-sdk/C
71 install -m644 $srcdir/pkg/sdk/OpenCL/doc/*.pdf $srcdir/pkg/sdk/OpenCL/Samples.html $pkgdir/usr/share/doc/cuda-sdk/OpenCL
72 install -m644 $srcdir/pkg/sdk/C/releaseNotesData/* $pkgdir/usr/share/doc/cuda-sdk/C/releaseNotesData
73 install -m644 $srcdir/pkg/sdk/OpenCL/releaseNotesData/* $pkgdir/usr/share/doc/cuda-sdk/OpenCL/releaseNotesData
75 # Copy over source and lib folders
76 cp -R $srcdir/pkg/sdk/C/{common,lib,src} $pkgdir/usr/share/cuda-sdk/C
77 cp -R $srcdir/pkg/sdk/OpenCL/{common,src} $pkgdir/usr/share/cuda-sdk/OpenCL
78 cp -R $srcdir/pkg/sdk/shared $pkgdir/usr/share/cuda-sdk
80 # Remove left-over object and ptx files
81 find $pkgdir/usr/share/cuda-sdk -depth -type d -name 'obj' -exec rm -rf \{\} \;
82 find $pkgdir/usr/share/cuda-sdk -type f -name '*.ptx' -exec rm -rf \{\} \;
84 # Copy data files for SDK
85 find $srcdir/pkg/sdk/C/src/ | grep '/data/' | \
86 xargs -I '{}' cp '{}' $pkgdir/usr/share/cuda-sdk/C/bin/data
87 find $srcdir/pkg/sdk/OpenCL/src/ | grep '/data/' | \
88 xargs -I '{}' cp '{}' $pkgdir/usr/share/cuda-sdk/OpenCL/bin/data
91 # NOTE: demos such as bandwidthTest, dxtc and simpleTexture may pass tests
92 # when run as root since the data directory is not writable by default.
93 # NOTE: if building with nvcc use the following flags:
94 # --compiler-options -fpermissive --compiler-bindir=/opt/gcc-4.4