summaryrefslogtreecommitdiffstats
path: root/dev-util/nvidia-cuda-sdk
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/nvidia-cuda-sdk')
-rw-r--r--dev-util/nvidia-cuda-sdk/Manifest2
-rw-r--r--dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-10.1.168.ebuild137
2 files changed, 139 insertions, 0 deletions
diff --git a/dev-util/nvidia-cuda-sdk/Manifest b/dev-util/nvidia-cuda-sdk/Manifest
new file mode 100644
index 0000000..85b76d4
--- /dev/null
+++ b/dev-util/nvidia-cuda-sdk/Manifest
@@ -0,0 +1,2 @@
+DIST cuda_10.1.168_418.67_linux.run 2526901749 BLAKE2B ed2207400730600c63895cc894e02a14dce59c6293f198ea2a94f6dd0fab25a005d4754f91376c267cb95f3fdc66ee08e4353ec17b69d28881c59190b9eb4746 SHA512 85635012ec7081e200fb46f973852939f9709e802f495c288d5f31ff1fbd283a578fdaca0afa8955e6e0c7ca6c4862428da5168e0938b48390952d8633350910
+EBUILD nvidia-cuda-sdk-10.1.168.ebuild 3636 BLAKE2B a47fed140a65075281d0c21203cd26ed255a33756455352d5c361a1fe142e41aaea81ae8b3f9ca390b856e74fb493c10a9a299cbf4bf19a4ce7b63a50b9839c1 SHA512 28fc13b9986fd54922c58f3dc408e6f6e8de67fc9b1d74c71be8526d8c35d2a5ac3a7562a74848c0a74d071a38efb36c91544bad297b29a32f4b1d90838e2c95
diff --git a/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-10.1.168.ebuild b/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-10.1.168.ebuild
new file mode 100644
index 0000000..64d25cd
--- /dev/null
+++ b/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-10.1.168.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cuda flag-o-matic portability toolchain-funcs unpacker versionator
+
+MYD=$(get_version_component_range 1-2)
+DRIVER_PV="418.67"
+
+DESCRIPTION="NVIDIA CUDA Software Development Kit"
+HOMEPAGE="https://developer.nvidia.com/cuda-zone"
+SRC_URI="https://developer.nvidia.com/compute/cuda/${MYD}/Prod/local_installers/cuda_${PV}_${DRIVER_PV}_linux -> cuda_${PV}_${DRIVER_PV}_linux.run"
+
+LICENSE="CUDPP"
+SLOT="0"
+KEYWORDS="~amd64 ~amd64-linux"
+IUSE="+cuda debug +doc +examples opencl mpi"
+
+RDEPEND="
+ ~dev-util/nvidia-cuda-toolkit-${PV}
+ media-libs/freeglut
+ examples? (
+ media-libs/freeimage
+ media-libs/glew:0=
+ >=x11-drivers/nvidia-drivers-396.24[uvm]
+ mpi? ( virtual/mpi )
+ )"
+DEPEND="${RDEPEND}"
+
+RESTRICT="test"
+
+S=${WORKDIR}/builds/cuda-samples
+
+QA_EXECSTACK=(
+ opt/cuda/sdk/0_Simple/cdpSimplePrint/cdpSimplePrint
+ opt/cuda/sdk/0_Simple/cdpSimpleQuicksort/cdpSimpleQuicksort
+ opt/cuda/sdk/bin/x86_64/linux/release/cdpSimplePrint
+ opt/cuda/sdk/bin/x86_64/linux/release/cdpSimpleQuicksort
+ )
+
+pkg_setup() {
+ if use cuda || use opencl; then
+ cuda_pkg_setup
+ fi
+}
+
+src_prepare() {
+ export RAWLDFLAGS="$(raw-ldflags)"
+# epatch "${FILESDIR}"/${P}-asneeded.patch
+
+ local file
+ while IFS="" read -d $'\0' -r file; do
+ sed \
+ -e 's:-O[23]::g' \
+ -e "/LINK/s:gcc:$(tc-getCC) ${LDFLAGS}:g" \
+ -e "/LINK/s:g++:$(tc-getCXX) ${LDFLAGS}:g" \
+ -e "/CC/s:gcc:$(tc-getCC):g" \
+ -e "/GCC/s:g++:$(tc-getCXX):g" \
+ -e "/NVCC /s|\(:=\).*|:= ${EPREFIX}/opt/cuda/bin/nvcc|g" \
+ -e "/ CFLAGS/s|\(:=\)|\1 ${CFLAGS}|g" \
+ -e "/ CXXFLAGS/s|\(:=\)|\1 ${CXXFLAGS}|g" \
+ -e "/NVCCFLAGS/s|\(:=\)|\1 ${NVCCFLAGS} |g" \
+ -e 's:-Wimplicit::g' \
+ -e "s|../../common/lib/linux/\$(OS_ARCH)/libGLEW.a|$($(tc-getPKG_CONFIG) --libs glew)|g" \
+ -e "s|../../common/lib/\$(OSLOWER)/libGLEW.a|$($(tc-getPKG_CONFIG) --libs glew)|g" \
+ -e "s|../../common/lib/\$(OSLOWER)/\$(OS_ARCH)/libGLEW.a|$($(tc-getPKG_CONFIG) --libs glew)|g" \
+ -i "${file}" || die
+ # -e "/ALL_LDFLAGS/s|:=|:= ${RAWLDFLAGS} |g" \
+ done < <(find . -type f -name 'Makefile' -print0)
+
+ rm -rf common/inc/GL || die
+ find . -type f -name '*.a' -delete || die
+
+ eapply_user
+}
+
+src_compile() {
+ use examples || return
+ local myopts=("verbose=1")
+ use debug && myopts+=("dbg=1")
+ export FAKEROOTKEY=1 # Workaround sandbox issue in #462602
+ emake \
+ cuda-install="${EPREFIX}/opt/cuda" \
+ CUDA_PATH="${EPREFIX}/opt/cuda/" \
+ MPI_GCC=10 \
+ "${myopts[@]}"
+}
+
+src_test() {
+ addwrite /dev/nvidiactl
+ addwrite /dev/nvidia0
+
+ local i
+ for i in {0..9}*/*; do
+ emake -C "${i}" run
+ done
+}
+
+src_install() {
+ local f t crap=( *.txt Samples.htm* )
+
+ if use doc; then
+ ebegin "Installing docs ..."
+ while IFS="" read -d $'\0' -r f; do
+ treecopy "${f}" "${ED%/}"/usr/share/doc/${PF}/
+ done < <(find -type f \( -name 'readme.txt' -o -name '*.pdf' \) -print0)
+
+ while IFS="" read -d $'\0' -r f; do
+ docompress -x "${f#${ED%/}}"
+ done < <(find "${ED%/}"/usr/share/doc/${PF}/ -type f -name 'readme.txt' -print0)
+ eend
+ fi
+
+ ebegin "Cleaning before installation..."
+ for f in "${crap[@]}"; do
+ rm -f "${f}" || die
+ done
+ find -type f \( -name '*.o' -o -name '*.pdf' -o -name 'readme.txt' \) -delete || die
+ eend
+
+ ebegin "Moving files..."
+ while IFS="" read -d $'\0' -r f; do
+ t="$(dirname ${f})"
+ if [[ ${t/obj\/} != ${t} || ${t##*.} == a ]]; then
+ continue
+ fi
+ if [[ -x ${f} ]]; then
+ exeinto /opt/cuda/sdk/"${t}"
+ doexe "${f}"
+ else
+ insinto /opt/cuda/sdk/"${t}"
+ doins "${f}"
+ fi
+ done < <(find . -type f -print0)
+ eend
+}