summaryrefslogtreecommitdiff
path: root/cuda/Pkgfile
blob: 8acc0a91f475a6890faa207ad754c99933080eb5 (plain)
    1 # Description: NVIDIA's GPU programming toolkit (feature branch)
    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.6.2
    8 _driverver=510.47.03
    9 release=1
   10 source=(https://developer.download.nvidia.com/compute/cuda/${version}/local_installers/cuda_${version}_${_driverver}_linux.run
   11 	cuda.sh cuda.conf $name.revdep
   12 	*.pc)
   13 
   14 build() {
   15 	sh cuda_${version}_${_driverver}_linux.run --target "${SRC}" --noexec
   16 
   17 	cd builds
   18 
   19 	rm -r NVIDIA*.run bin
   20 	mkdir -p "${PKG}/opt/cuda/extras"
   21 	mv cuda_samples "${PKG}/opt/cuda/samples"
   22 	mv integration nsight_compute nsight_systems EULA.txt "${PKG}/opt/cuda"
   23 	mv cuda_sanitizer_api/compute-sanitizer "${PKG}/opt/cuda/extras/compute-sanitizer"
   24 	rmdir cuda_sanitizer_api
   25 	for lib in *; do
   26 		if [[ "$lib" =~ .*"version.json".* ]]; then
   27 			continue
   28 		fi
   29 		cp -r $lib/* "${PKG}/opt/cuda/"
   30 	done
   31 
   32 	# Delete some unnecessary files
   33 	rm -r "${PKG}"/opt/cuda/{bin/cuda-uninstaller,samples/bin/cuda-uninstaller}
   34 
   35 	# remove foreign archs
   36 	rm -r "${PKG}"/opt/cuda/nsight_compute/target/linux-desktop-glibc_2_19_0-ppc64le
   37 	rm -r "${PKG}"/opt/cuda/nsight_compute/target/linux-desktop-t210-a64
   38 
   39 	# Define compilers for CUDA to use.
   40 	# This allows us to use older versions of GCC if we have to.
   41 	ln -s /usr/bin/gcc "${PKG}/opt/cuda/bin/gcc"
   42 	ln -s /usr/bin/g++ "${PKG}/opt/cuda/bin/g++"
   43 
   44 	# Install profile and ld.so.config files
   45 	install -Dm755 "${SRC}/cuda.sh" "${PKG}/etc/profile.d/cuda.sh"
   46 	install -Dm644 "${SRC}/cuda.conf" "${PKG}/etc/ld.so.conf.d/cuda.conf"
   47 
   48 	# Install pkgconfig files
   49 	mkdir -p "$PKG"/usr/lib/pkgconfig
   50 	cp "${SRC}"/*.pc "${PKG}"/usr/lib/pkgconfig
   51 
   52 	# Allow newer compilers to work.
   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 	install -d $PKG/etc/revdep.d
   64 	install -m644 $SRC/$name.revdep $PKG/etc/revdep.d/$name
   65 
   66 	find $PKG -iname 'README' -iname 'README.txt' -exec rm '{}' \+
   67 }

Generated by cgit