summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <sven.eden@gmx.de>2017-05-14 21:33:19 +0200
committerSven Eden <sven.eden@gmx.de>2017-05-14 21:33:19 +0200
commita544252bcea43bab1ec4415f0144ed64e3dcffa6 (patch)
tree1cbfa4981231f334e676c0648c91eda4cd60e4ea
parentapp-emulation/wine : Removed for virtual/wine (diff)
downloadseden-a544252bcea43bab1ec4415f0144ed64e3dcffa6.tar.gz
seden-a544252bcea43bab1ec4415f0144ed64e3dcffa6.tar.bz2
seden-a544252bcea43bab1ec4415f0144ed64e3dcffa6.zip
dev-util/nvidia-cuda-toolkit-8.0.61-r1 : Support gcc-6
-rw-r--r--dev-util/nvidia-cuda-toolkit/Manifest1
-rw-r--r--dev-util/nvidia-cuda-toolkit/files/cuda-config.in28
-rw-r--r--dev-util/nvidia-cuda-toolkit/files/support_gcc6.patch17
-rw-r--r--dev-util/nvidia-cuda-toolkit/metadata.xml17
-rw-r--r--dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-8.0.61-r1.ebuild139
5 files changed, 202 insertions, 0 deletions
diff --git a/dev-util/nvidia-cuda-toolkit/Manifest b/dev-util/nvidia-cuda-toolkit/Manifest
new file mode 100644
index 0000000..7548ba7
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/Manifest
@@ -0,0 +1 @@
+DIST cuda_8.0.61_375.26_linux.run 1465528129 SHA256 9ceca9c2397f841024e03410bfd6eabfd72b384256fbed1c1e4834b5b0ce9dc4 SHA512 d22303719a9feff64f95bf6a966f1caa2bf0cf8c955e475ce08ce54faa5e098d336c2db223ef0185c1f23b9c52b7d2f81a63515485219cfc016d72bda979248b WHIRLPOOL 650a0e8bc9ad2d0637cd4a82a057bf77e613559d1080a86009f594c73adb8879de62b26dac9d8e3f572806556bf878505382479e596d4ce91929ab94b882489a
diff --git a/dev-util/nvidia-cuda-toolkit/files/cuda-config.in b/dev-util/nvidia-cuda-toolkit/files/cuda-config.in
new file mode 100644
index 0000000..ca0d1d7
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/files/cuda-config.in
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+SUPPORT_GCC_VERSIONS_BY_CUDA="CUDA_SUPPORTED_GCC"
+
+_print_help() {
+ cat <<- EOF
+ Usage:
+ $(basename $0) [options]
+
+ -s | --supported Returns by current CUDA supported gcc versions
+ -h | --help Shows this help
+ EOF
+}
+
+case ${1} in
+ -s|--supported)
+ echo "${SUPPORT_GCC_VERSIONS_BY_CUDA}"
+ exit 0
+ ;;
+ -h|--help)
+ _print_help
+ exit -1
+ ;;
+ *)
+ _print_help
+ exit 1
+ ;;
+esac
diff --git a/dev-util/nvidia-cuda-toolkit/files/support_gcc6.patch b/dev-util/nvidia-cuda-toolkit/files/support_gcc6.patch
new file mode 100644
index 0000000..68069f5
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/files/support_gcc6.patch
@@ -0,0 +1,17 @@
+--- a/include/host_config.h 2017-05-14 14:00:39.247227529 +0200
++++ b/include/host_config.h 2017-05-14 14:02:01.105229124 +0200
+@@ -114,11 +114,11 @@
+
+ #if defined(__GNUC__)
+
+-#if __GNUC__ > 5
++#if __GNUC__ > 6
+
+-#error -- unsupported GNU version! gcc versions later than 5 are not supported!
++#error -- unsupported GNU version! gcc versions later than 6 are not supported!
+
+-#endif /* __GNUC__ > 5 */
++#endif /* __GNUC__ > 6 */
+
+ #if defined(__APPLE__) && defined(__MACH__) && !defined(__clang__)
+ #error -- clang and clang++ are the only supported host compilers on Mac OS X!
diff --git a/dev-util/nvidia-cuda-toolkit/metadata.xml b/dev-util/nvidia-cuda-toolkit/metadata.xml
new file mode 100644
index 0000000..ad6a397
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <use>
+ <flag name="profiler">
+ Installs the NVIDIA CUDA visual profiler.
+ </flag>
+ <flag name="debugger">
+ Installs the CUDA debugger.
+ </flag>
+ <flag name="eclipse">Install plugins for eclipse</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-8.0.61-r1.ebuild b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-8.0.61-r1.ebuild
new file mode 100644
index 0000000..855f8b3
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-8.0.61-r1.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit check-reqs cuda toolchain-funcs unpacker versionator
+
+MYD=$(get_version_component_range 1-2)
+DRIVER_PV="375.26"
+
+DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)"
+HOMEPAGE="https://developer.nvidia.com/cuda-zone"
+SRC_URI="https://developer.nvidia.com/compute/cuda/${MYD}/Prod2/local_installers/cuda_${PV}_${DRIVER_PV}_linux-run -> cuda_${PV}_${DRIVER_PV}_linux.run"
+SLOT="0/${PV}"
+LICENSE="NVIDIA-CUDA"
+KEYWORDS="-* ~amd64 ~amd64-linux"
+IUSE="debugger doc eclipse profiler"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ >=sys-devel/gcc-4.7[cxx]
+ >=x11-drivers/nvidia-drivers-375.26[X,uvm]
+ debugger? (
+ sys-libs/libtermcap-compat
+ sys-libs/ncurses:5/5[tinfo]
+ )
+ eclipse? ( >=virtual/jre-1.6 )
+ profiler? ( >=virtual/jre-1.6 )"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="opt/cuda/*"
+
+CHECKREQS_DISK_BUILD="3500M"
+
+PATCHES=(
+ "${FILESDIR}"/support_gcc6.patch
+)
+
+pkg_setup() {
+ # We don't like to run cuda_pkg_setup as it depends on us
+ check-reqs_pkg_setup
+}
+
+src_unpack() {
+ unpacker
+ unpacker run_files/cuda-linux*.run
+}
+
+src_prepare() {
+ local cuda_supported_gcc
+
+ cuda_supported_gcc="4.7 4.8 4.9 5.3 5.4 6.3"
+
+ sed \
+ -e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc}:g" \
+ "${FILESDIR}"/cuda-config.in > "${T}"/cuda-config || die
+
+ default
+}
+
+src_install() {
+ local i remove=( doc jre run_files install-linux.pl cuda-installer.pl )
+ local cudadir=/opt/cuda
+ local ecudadir="${EPREFIX}${cudadir}"
+
+ if use doc; then
+ DOCS+=( doc/pdf/. )
+ HTML_DOCS+=( doc/html/. )
+ fi
+ einstalldocs
+
+ mv doc/man/man3/{,cuda-}deprecated.3 || die
+ doman doc/man/man*/*
+
+ use debugger || remove+=( bin/cuda-gdb extras/Debugger extras/cuda-gdb-${PV}.src.tar.gz )
+
+ if use profiler; then
+ # hack found in install-linux.pl
+ for i in nvvp nsight; do
+ cat > bin/${i} <<- EOF || die
+ #!/usr/bin/env sh
+ LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${ecudadir}/lib:${ecudadir}/lib64 \
+ UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 \
+ ${ecudadir}/lib${i}/${i} -vm ${EPREFIX}/usr/bin/java
+ EOF
+ chmod a+x bin/${i} || die
+ done
+ else
+ use eclipse || remove+=( libnvvp libnsight )
+ remove+=( extras/CUPTI )
+ fi
+
+ for i in "${remove[@]}"; do
+ ebegin "Cleaning ${i}..."
+ rm -rf "${i}" || die
+ eend
+ done
+
+ dodir ${cudadir}
+ mv * "${ED%/}${cudadir}" || die
+
+ cat > "${T}"/99cuda <<- EOF || die
+ PATH=${ecudadir}/bin$(usex profiler ":${ecudadir}/libnvvp" "")
+ ROOTPATH=${ecudadir}/bin
+ LDPATH=${ecudadir}/lib64:${ecudadir}/lib:${ecudadir}/nvvm/lib64
+ EOF
+ doenvd "${T}"/99cuda
+
+ use profiler && \
+ make_wrapper nvprof "${ecudadir}/bin/nvprof" "." "${ecudadir}/lib64:${ecudadir}/lib"
+
+ dobin "${T}"/cuda-config
+}
+
+pkg_postinst_check() {
+ local a b
+ a="$(version_sort $(cuda-config -s))"; a=( $a )
+ # greatest supported version
+ b="${a[${#a[@]}-1]}"
+
+ # if gcc and if not gcc-version is at least greatest supported
+ if tc-is-gcc && \
+ ! version_is_at_least gcc-version ${b}; then
+ ewarn ""
+ ewarn "gcc >= ${b} will not work with CUDA"
+ ewarn "Make sure you set an earlier version of gcc with gcc-config"
+ ewarn "or append --compiler-bindir= pointing to a gcc bindir like"
+ ewarn "--compiler-bindir=${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/gcc${b}"
+ ewarn "to the nvcc compiler flags"
+ ewarn ""
+ fi
+}
+
+pkg_postinst() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ pkg_postinst_check
+ fi
+}