Created
January 26, 2012 11:06
-
-
Save hauptmech/1682269 to your computer and use it in GitHub Desktop.
Archlinux AUR cuda-sdk 4.1 PKGBUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com> | |
pkgname=cuda-sdk | |
pkgver=4.1.21 | |
pkgrel=1 | |
_fedver=14 | |
pkgdesc="NVIDIA's GPU programming toolkit" | |
arch=('i686' 'x86_64') | |
url="http://www.nvidia.com/object/cuda_home.html" | |
license=('custom') | |
depends=('gcc-libs') | |
source=(http://developer.download.nvidia.com/compute/cuda/4_1/RC2/sdk/gpucomputingsdk_4.1.21_linux.run) | |
build() { | |
cd "$srcdir" | |
# Extract the SDK | |
msg2 "Uncompressing the CUDA SDK..." | |
sh gpucomputingsdk_${pkgver}_linux.run --noexec --keep --nox11 >/dev/null | |
# Inspection hook | |
#echo "Inspect srcdir" | |
#read | |
# Patch Makefiles. It used to be simple, but CUDALibraries is a mess. Really. | |
msg2 "Patching Makefiles..." | |
# patch -p0 -i "$srcdir/makefiles.patch" | |
sed -i 's/^CUDA_INSTALL_PATH.*$/CUDA_INSTALL_PATH ?= \/opt\/cuda-toolkit/g' \ | |
pkg/sdk/C/common/common.mk \ | |
pkg/sdk/CUDALibraries/common/UtilNPP/defines.mk \ | |
pkg/sdk/CUDALibraries/common/common_cudalib.mk \ | |
pkg/sdk/CUDALibraries/src/imageSegmentationNPP/Makefile \ | |
pkg/sdk/CUDALibraries/src/freeImageInteropNPP/Makefile \ | |
pkg/sdk/CUDALibraries/src/histEqualizationNPP/Makefile \ | |
pkg/sdk/CUDALibraries/src/boxFilterNPP/Makefile \ | |
pkg/sdk/OpenCL/common/common_opencl.mk \ | |
pkg/sdk/shared/common.mk | |
# Ease building for people with hybrid nVidia graphics and "bumblebee" | |
# installed (courtesy of yl3gdy) | |
if [ -d /usr/lib/nvidia-bumblebee ]; then | |
export LIBRARY_PATH=/usr/lib:/usr/lib/nvidia-bumblebee | |
fi | |
# Build all the examples. The little "sed" lines are here to enable parallel | |
# builds and to avoid being spammed with a warning message (see | |
# http://www.gnu.org/s/hello/manual/make/Error-Messages.html for details) | |
msg2 "Building the CUDA libraries examples..." | |
cd "$srcdir/pkg/sdk/CUDALibraries" | |
sed -i 's/make/$(MAKE)/' Makefile | |
make | |
msg2 "Building the CUDA C examples..." | |
cd "$srcdir/pkg/sdk/C" | |
sed -i 's/make/$(MAKE)/' Makefile | |
make | |
msg2 "Building the OpenCL examples..." | |
cd "$srcdir/pkg/sdk/OpenCL" | |
sed -i 's/make/$(MAKE)/' Makefile | |
cd $srcdir/pkg/sdk | |
make | |
#Strip out object files, etc | |
find . -type d -name obj -exec rm -rf {} \; | |
} | |
package() { | |
cd "$srcdir"/pkg | |
./install-sdk-linux.pl --prefix=$pkgdir/opt/cuda-sdk --cudaprefix=/opt/cuda-toolkit | |
} | |
md5sums=('272ffb1c6a30cb63b3e67583b91f5205') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment