summaryrefslogtreecommitdiff
path: root/community/cuda-sdk/PKGBUILD
blob: 152b3add97b9c3b6bdd2da667c983fc8476f4ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Thomas Jost <schnouki@schnouki.net>
# Contributor: Carson Reynolds <carson@k2.t.u-tokyo.ac.jp>

pkgname=cuda-sdk
pkgver=4.2.9
pkgrel=1
pkgdesc="NVIDIA's GPU programming sdk"
arch=('i686' 'x86_64')
url="http://www.nvidia.com/object/cuda_home.html"
license=('custom')
depends=('cuda-toolkit' 'nvidia' 'opencl-nvidia' 'freeglut' 'libxmu')
makedepends=('perl')
source=(http://developer.download.nvidia.com/compute/cuda/4_2/rel/sdk/gpucomputingsdk_${pkgver}_linux.run)
md5sums=('693d969aca8bb06a5a1d51ef5c3ca04b')

build() {
  cd "$srcdir"

  sh gpucomputingsdk_${pkgver}_linux.run --noexec --keep --nox11 --nochown --target sdk >/dev/null
  cd sdk
  
  find . -name *.cu | xargs sed -i "1 i #undef _GLIBCXX_ATOMIC_BUILTINS"
  find . -name *.cu | xargs sed -i "1 i #undef _GLIBCXX_USE_INT128"

  #find . -name 'Makefile*' -exec sed -i 's/^\tmake /\t$(MAKE) /g; s/^\t@make /\t@$(MAKE) /g' "{}" +

  # Sadly we need to install this first and compile afterwards, this is why we only have build()
  install -dm755 "$pkgdir/opt/cuda-sdk"
  ./install-sdk-linux.pl --prefix="$pkgdir/opt/cuda-sdk" --cudaprefix="/opt/cuda-toolkit" >/dev/null

  cd "$pkgdir/opt/cuda-sdk"
  make CUDA_INSTALL_PATH=/opt/cuda-toolkit NO_MPI=1
  # simpleMPI sometimes causes segfaults when building...

  install -Dm755 "$pkgdir/opt/cuda-sdk/License.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}