diff options
author | jerry73204 | 2020-09-29 05:18:37 +0800 |
---|---|---|
committer | jerry73204 | 2020-09-29 05:18:50 +0800 |
commit | ad833fbb528872b77bfe3a0011958399ec1fdc04 (patch) | |
tree | a8560e443152353a7d10075b5eb801c6e4693d6e | |
download | aur-ad833fbb528872b77bfe3a0011958399ec1fdc04.tar.gz |
Copy cuda-10.2 from ABS
-rw-r--r-- | .SRCINFO | 31 | ||||
-rw-r--r-- | PKGBUILD | 92 | ||||
-rw-r--r-- | cuda-10.2.conf | 3 | ||||
-rw-r--r-- | cuda-10.2.install | 11 | ||||
-rw-r--r-- | cuda-10.2.sh | 2 | ||||
-rw-r--r-- | cuda-findgllib_mk.diff | 22 |
6 files changed, 161 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d3db9a34a9f3 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,31 @@ +pkgbase = cuda-10.2 + pkgdesc = NVIDIA's GPU programming toolkit + pkgver = 10.2.89 + pkgrel = 1 + url = https://developer.nvidia.com/cuda-zone + install = cuda-10.2.install + arch = x86_64 + license = custom:NVIDIA + depends = gcc8-libs + depends = gcc8 + depends = opencl-nvidia + depends = nvidia-utils + optdepends = gdb: for cuda-gdb + optdepends = java-runtime=8: for nsight and nvvp + provides = cuda-toolkit + provides = cuda-sdk + replaces = cuda-toolkit + replaces = cuda-sdk + options = !strip + options = staticlibs + source = http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run + source = cuda-10.2.sh + source = cuda-10.2.conf + source = cuda-findgllib_mk.diff + sha512sums = ad8da539ff5df7caf411d1e497ff3d6978cfa8a1fd9150fa4846089e92a604ea56be8631f3efdfe7229a655b8d2d28e6edb32f5731530a77d6f00241cc7aab6e + sha512sums = c116402ff3c0b42482d1a3896cc462b779ecd6e50f930bb55cb16950a076878057cb6c2623d083c58df8db1cce23c52e30b0d5c026132802210d4a8441136afd + sha512sums = 2e660355c25f0f920fd1e29f7eabbed916e051ab10f39a3b783dfa58166e2d49a00fa2ae09374b2ff46c2b448b068a75421b2a939fe989974387f9ebe77dec17 + sha512sums = 41d6b6cad934f135eafde610d1cbd862033977fd4416a4b6abaa47709a70bab7fcf6f8377c21329084fb9db13f2a8c8c20e93c15292d7d4a6448d70a33b23f1b + +pkgname = cuda-10.2 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..2d62467b7db1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,92 @@ +# Maintainer: jerry73204 <jerry73204@gmail.com> +pkgname=cuda-10.2 +pkgver=10.2.89 +_driverver=440.33.01 +pkgrel=1 +pkgdesc="NVIDIA's GPU programming toolkit" +arch=('x86_64') +url="https://developer.nvidia.com/cuda-zone" +license=('custom:NVIDIA') +depends=('gcc8-libs' 'gcc8' 'opencl-nvidia' 'nvidia-utils') +replaces=('cuda-toolkit' 'cuda-sdk') +provides=('cuda-toolkit' 'cuda-sdk') +optdepends=('gdb: for cuda-gdb' + 'java-runtime=8: for nsight and nvvp') +options=(!strip staticlibs) +install=cuda-10.2.install +source=(http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_${pkgver}_${_driverver}_linux.run + cuda-10.2.sh + cuda-10.2.conf + cuda-findgllib_mk.diff) +sha512sums=('ad8da539ff5df7caf411d1e497ff3d6978cfa8a1fd9150fa4846089e92a604ea56be8631f3efdfe7229a655b8d2d28e6edb32f5731530a77d6f00241cc7aab6e' + 'c116402ff3c0b42482d1a3896cc462b779ecd6e50f930bb55cb16950a076878057cb6c2623d083c58df8db1cce23c52e30b0d5c026132802210d4a8441136afd' + '2e660355c25f0f920fd1e29f7eabbed916e051ab10f39a3b783dfa58166e2d49a00fa2ae09374b2ff46c2b448b068a75421b2a939fe989974387f9ebe77dec17' + '41d6b6cad934f135eafde610d1cbd862033977fd4416a4b6abaa47709a70bab7fcf6f8377c21329084fb9db13f2a8c8c20e93c15292d7d4a6448d70a33b23f1b') + +prepare() { + sh cuda_${pkgver}_${_driverver}_linux.run --target "${srcdir}" --noexec + + # Fix up samples tht use findgllib_mk + for f in builds/cuda-samples/*/*/findgllib.mk; do + patch $f cuda-findgllib_mk.diff + done +} + +package() { + install_prefix="${pkgdir}/opt/cuda-10.2" + mkdir -p "${pkgdir}/opt" + + cd "${srcdir}/builds" + cp -r cuda-toolkit "${install_prefix}" + cp -r cublas/include/* "${install_prefix}/include/" + cp -r cublas/lib64/* "${install_prefix}/lib64/" + cp -r cuda-samples "${install_prefix}/samples" + ln -s /opt/cuda-10.2/targets/x86_64-linux/lib "${install_prefix}/lib" + ln -s /opt/cuda-10.2/nvvm/lib64 "${install_prefix}/nvvm/lib" + + # Define compilers for CUDA to use. + # This allows us to use older versions of GCC if we have to. + ln -s /usr/bin/gcc-8 "${install_prefix}/bin/gcc" + ln -s /usr/bin/g++-8 "${install_prefix}/bin/g++" + + # Create soname links. + # We have to be weird about this since for some reason the ELF SONAME is incorrect or at least partially incorrect for some libs. + # Best we can do is create all symlinks and hope for the best. + # Their installer used to perform this for us but now it's all manual and I think this is what we'll be stuck with for now. + find cuda-toolkit/targets -type f -name '*.so*' ! -path '*stubs/*' -print0 | while read -rd $'\0' _lib; do + _base=${_lib%.so.*} + _current_soname=$(basename ${_lib%.*}) + while [[ $_current_soname != $(basename $_base) ]]; do + ln -sf "${_lib##*/}" "${install_prefix}/lib64/$_current_soname" + _current_soname="${_current_soname%.*}" + done + done + + # Install profile and ld.so.config files + install -Dm755 "${srcdir}/cuda-10.2.sh" "${pkgdir}/etc/profile.d/cuda-10.2.sh" + install -Dm644 "${srcdir}/cuda-10.2.conf" "${pkgdir}/etc/ld.so.conf.d/cuda-10.2.conf" + + mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}" + ln -s "/opt/cuda-10.2/doc/pdf/EULA.pdf" "${pkgdir}/usr/share/licenses/${pkgname}/EULA.pdf" + + # Remove included copy of java and link to system java 8 + rm -fr "${install_prefix}/jre" + sed 's|../jre/bin/java|/usr/lib/jvm/java-8-openjdk/jre/bin/java|g' \ + -i "${install_prefix}/libnsight/nsight.ini" \ + -i "${install_prefix}/libnvvp/nvvp.ini" + + # Allow newer compilers to work. This is not officially supported in the Arch package but + # if users want to try, let them try. + # See https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements + # for official requirements + sed -i "/.*unsupported GNU version.*/d" "${install_prefix}"/targets/x86_64-linux/include/crt/host_config.h + sed -i "/.*unsupported clang version.*/d" "${install_prefix}"/targets/x86_64-linux/include/crt/host_config.h + + # Fix Makefile paths to CUDA + for f in $(find "${install_prefix}/" -name Makefile); do + sed -i "s|/usr/local/cuda|/opt/cuda-10.2|g" "$f" + done +} + +# vim:set ts=2 sw=2 et: + diff --git a/cuda-10.2.conf b/cuda-10.2.conf new file mode 100644 index 000000000000..df7875f52880 --- /dev/null +++ b/cuda-10.2.conf @@ -0,0 +1,3 @@ +/opt/cuda-10.2/lib64 +/opt/cuda-10.2/nvvm/lib64 +/opt/cuda-10.2/extras/CUPTI/lib64 diff --git a/cuda-10.2.install b/cuda-10.2.install new file mode 100644 index 000000000000..9fe2b2a61db5 --- /dev/null +++ b/cuda-10.2.install @@ -0,0 +1,11 @@ +post_install() { + echo "The cuda binaries are in /opt/cuda-10.2/bin" + echo "The cuda samples are in /opt/cuda-10.2/samples" + echo "The cuda docs are in /opt/cuda-10.2/doc" + echo "You need to relogin in order for the cuda binaries to appear in your PATH" + post_upgrade +} + +post_upgrade() { + ldconfig -r . +} diff --git a/cuda-10.2.sh b/cuda-10.2.sh new file mode 100644 index 000000000000..5363400c1f0c --- /dev/null +++ b/cuda-10.2.sh @@ -0,0 +1,2 @@ +export CUDA_PATH=/opt/cuda-10.2 +export PATH=$PATH:/opt/cuda-10.2/bin diff --git a/cuda-findgllib_mk.diff b/cuda-findgllib_mk.diff new file mode 100644 index 000000000000..dee993b28dfb --- /dev/null +++ b/cuda-findgllib_mk.diff @@ -0,0 +1,22 @@ +--- ./opt/cuda/samples/3_Imaging/bicubicTexture/findgllib.mk 2017-09-28 09:07:30.310563874 +0200 ++++ findgllib.mk 2017-09-28 14:40:50.638930881 +0200 +@@ -60,6 +60,7 @@ + RHEL = $(shell echo $(DISTRO) | grep -i 'red\|rhel' >/dev/null 2>&1; echo $$?) + CENTOS = $(shell echo $(DISTRO) | grep -i centos >/dev/null 2>&1; echo $$?) + SUSE = $(shell echo $(DISTRO) | grep -i 'suse\|sles' >/dev/null 2>&1; echo $$?) ++ ARCHLX = $(shell echo $(DISTRO) | grep -i arch >/dev/null 2>&1; echo $$?) + ifeq ("$(UBUNTU)","0") + ifeq ($(HOST_ARCH)-$(TARGET_ARCH),x86_64-armv7l) + GLPATH := /usr/arm-linux-gnueabihf/lib +@@ -100,6 +101,11 @@ + GLPATH ?= /usr/lib64/nvidia + GLLINK ?= -L/usr/lib64/nvidia + DFLT_PATH ?= /usr/lib64 ++ endif ++ ifeq ("$(ARCHLX)","0") ++ GLPATH ?= /usr/lib64/nvidia ++ GLLINK ?= -L/usr/lib64/nvidia ++ DFLT_PATH ?= /usr/lib64 + endif + + # find libGL, libGLU, libXi, |