summaryrefslogtreecommitdiff
path: root/cuda/Pkgfile
blob: 609119fe4dd0864ee7507a16b10e375e6af58bff (plain)
    1 # Description: NVIDIA's GPU programming toolkit
    2 # URL: https://developer.nvidia.com/cuda-zone
    3 # Maintainer: Danny Rawlins, crux at romster dot me
    4 # Depends on: nvidia lsb-release
    5 
    6 name=cuda
    7 version=11.2.0
    8 _driverver=460.27.04
    9 release=1
   10 source=(http://developer.download.nvidia.com/compute/cuda/${version}/local_installers/cuda_${version}_${_driverver}_linux.run
   11 	cuda.sh cuda.conf cuda.revdep
   12 	cuda-findgllib_mk.diff
   13 	*.pc)
   14 
   15 build() {
   16 	sh cuda_${version}_${_driverver}_linux.run --target "${SRC}" --noexec
   17 
   18 	# Fix up samples that use findgllib_mk
   19 	for f in builds/cuda_samples/*/*/findgllib.mk; do
   20 		patch $f cuda-findgllib_mk.diff
   21 	done
   22 
   23 	cd builds
   24 
   25 	rm -r NVIDIA*.run bin
   26 	mkdir -p "${PKG}/opt/cuda/extras"
   27 	mv cuda_samples "${PKG}/opt/cuda/samples"
   28 	mv integration nsight_compute nsight_systems EULA.txt "${PKG}/opt/cuda"
   29 	mv cuda_sanitizer_api/compute-sanitizer "${PKG}/opt/cuda/extras/compute-sanitizer"
   30 	rmdir cuda_sanitizer_api
   31 	for lib in *; do
   32 		cp -r $lib/* "${PKG}/opt/cuda/"
   33 	done
   34 
   35 	# Define compilers for CUDA to use.
   36 	# This allows us to use older versions of GCC if we have to.
   37 	ln -s /usr/bin/gcc "${PKG}/opt/cuda/bin/gcc"
   38 	ln -s /usr/bin/g++ "${PKG}/opt/cuda/bin/g++"
   39 
   40 	# Install profile and ld.so.config files
   41 	install -Dm755 "${SRC}/cuda.sh" "${PKG}/etc/profile.d/cuda.sh"
   42 	install -Dm644 "${SRC}/cuda.conf" "${PKG}/etc/ld.so.conf.d/cuda.conf"
   43 
   44 	# Install pkgconfig files
   45 	mkdir -p "$PKG"/usr/lib/pkgconfig
   46 	cp "${SRC}"/*.pc "${PKG}"/usr/lib/pkgconfig
   47 
   48 	mkdir -p "${PKG}/usr/share/licenses/${name}"
   49 	ln -s /opt/cuda/doc/pdf/EULA.pdf "${PKG}/usr/share/licenses/${pkgname}/EULA.pdf"
   50 
   51 	# Allow newer compilers to work. This is not officially supported in the Arch package but
   52 	# if users want to try, let them try.
   53 	# See https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements
   54 	# for official requirements
   55 	sed -i "/.*unsupported GNU version.*/d" "${PKG}"/opt/cuda/targets/x86_64-linux/include/crt/host_config.h
   56 	sed -i "/.*unsupported clang version.*/d" "${PKG}"/opt/cuda/targets/x86_64-linux/include/crt/host_config.h
   57 
   58 	# Fix Makefile paths to CUDA
   59 	for f in $(find "$PKG"/opt/cuda -name Makefile); do
   60 		sed -i "s|/usr/local/cuda|/opt/cuda|g" "$f"
   61 	done
   62 
   63 	# NVIDIA has trouble with counting and numbering 
   64 	# as well as the elusive concept of a SONAME so...
   65 	ln -s /opt/cuda/targets/x86_64-linux/lib/libcudart.so.11.1.74 "${PKG}/opt/cuda/targets/x86_64-linux/lib/libcudart.so.11.1"
   66 
   67 	install -d $PKG/etc/revdep.d
   68 	install -m644 $SRC/$name.revdep $PKG/etc/revdep.d/$name
   69 
   70 	find $PKG -iname 'README' -iname 'README.txt' -exec rm '{}' \+
   71 }

Generated by cgit