From a278e0b9c404af96c2cd9236feac89ef1eadb667 Mon Sep 17 00:00:00 2001 From: D Woodfall Date: Wed, 17 May 2023 00:39:43 +0100 Subject: development/cudatoolkit: Fix ARCH sect. amd symlinks. Signed-off-by: bedlam Signed-off-by: Willy Sudiarto Raharjo --- development/cudatoolkit/cudatoolkit.SlackBuild | 68 ++++++++++++++------------ development/cudatoolkit/cudatoolkit.info | 2 +- development/cudatoolkit/doinst.sh | 13 +++-- 3 files changed, 47 insertions(+), 36 deletions(-) diff --git a/development/cudatoolkit/cudatoolkit.SlackBuild b/development/cudatoolkit/cudatoolkit.SlackBuild index 6de824743b2a..61efdddb0335 100644 --- a/development/cudatoolkit/cudatoolkit.SlackBuild +++ b/development/cudatoolkit/cudatoolkit.SlackBuild @@ -22,6 +22,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 2023-05-16 DW +# Removed LIBDIRSUFFIX and made 'lib64' hard-coded as we're 64bit only +# Simplified/moved ARCH parts +# Moved broken symlinks out of doinst.sh to slackbuild +# NOTE download page shows newer version available, but all file and +# subdirectory locations have changed + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=cudatoolkit @@ -32,12 +39,14 @@ BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} +if [ -z "$ARCH" ]; then + ARCH=$( uname -m ) +fi -case "$( uname -m )" in - i?86) ARCH=i386 ;; - arm*) ARCH=arm ;; - *) ARCH=$( uname -m ) ;; -esac +if [ "$ARCH" != "x86_64" ]; then + echo "$ARCH architecture is unsupported." >/dev/stderr + exit 1 +fi # If the variable PRINT_PACKAGE_NAME is set, then this script will report what # the name of the created package would be, and then exit. This information @@ -53,13 +62,6 @@ OUTPUT=${OUTPUT:-/tmp} set -e -if [ "$ARCH" = "x86_64" ]; then - LIBDIRSUFFIX="64" -else - printf "\n\n$ARCH is not supported... \n" - exit 1 -fi - rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP @@ -75,14 +77,9 @@ cd $PRGNAM-$VERSION/builds cp -r cuda-toolkit "$PKG/usr/share/cuda" cp -r cublas/include/* "$PKG/usr/share/cuda/include/" mkdir -p $PKG/usr/lib64 -cp -r cublas/lib64/* "$PKG/usr/lib$LIBDIRSUFFIX/" +cp -r cublas/lib64/* "$PKG/usr/lib64/" cp -r cuda-samples "$PKG/usr/share/cuda/samples" -# 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 "${PKG}/usr/share/cuda/bin/gcc" -# ln -s /usr/bin/g++-8 "${PKG}/usr/share/cuda/bin/g++" - # Put man in the standard place mv $PKG/usr/share/cuda/doc/man $PKG/usr/ find $PKG/usr/man -type f -exec gzip -9 {} \; @@ -99,18 +96,18 @@ find cuda-toolkit/targets -type f -name '*.so*' ! -path '*stubs/*' -print0 | whi _base=${_lib%.so.*} _current_soname=$(basename ${_lib%.*}) while [[ $_current_soname != $(basename $_base) ]]; do - ln -sf ${_lib##*/} ${PKG}/usr/share/cuda/lib$LIBDIRSUFFIX/$_current_soname + ln -sf ${_lib##*/} ${PKG}/usr/share/cuda/lib64/$_current_soname _current_soname=${_current_soname%.*} done done -# Install profile and ld.so.config files -install -Dm755 "${CWD}/files/cuda.sh" "${PKG}/etc/profile.d/cuda.sh" -install -Dm755 "${CWD}/files/cuda.csh" "${PKG}/etc/profile.d/cuda.csh" +# Install profiles +install -D -m 755 "${CWD}/files/cuda.sh" "${PKG}/etc/profile.d/cuda.sh" +install -D -m 755 "${CWD}/files/cuda.csh" "${PKG}/etc/profile.d/cuda.csh" # Install pkgconfig files -mkdir -p "$PKG"/usr/lib${LIBDIRSUFFIX}/pkgconfig -cp "${CWD}"/files/*.pc "${PKG}"/usr/lib${LIBDIRSUFFIX}/pkgconfig +mkdir -p "$PKG"/usr/lib64/pkgconfig +cp "${CWD}"/files/*.pc "${PKG}"/usr/lib64/pkgconfig # Remove included copy of java and link to system java 8 rm -fr "${PKG}/usr/share/cuda/jre" @@ -130,13 +127,13 @@ for f in $(find "$PKG"/usr/share/cuda -name Makefile); do done # Put libraries in the standard place -mkdir -p $PKG/usr/lib${LIBDIRSUFFIX} -mv -fn $PKG/usr/share/cuda/targets/x86_64-linux/lib/* $PKG/usr/lib${LIBDIRSUFFIX}/ +mkdir -p $PKG/usr/lib64 +mv -fn $PKG/usr/share/cuda/targets/x86_64-linux/lib/* $PKG/usr/lib64/ rm -rf $PKG/usr/share/cuda/targets/x86_64-linux/lib cd $PKG/usr/share/cuda -ln -sf ../../lib${LIBDIRSUFFIX} lib${LIBDIRSUFFIX} +ln -sf ../../lib64 lib64 -# Register application NVVP and NSIGHT +# Register application NVVP and NSIGHT mkdir -p $PKG/usr/share/applications cp $CWD/files/*.desktop $PKG/usr/share/applications @@ -144,17 +141,24 @@ cp $CWD/files/*.desktop $PKG/usr/share/applications mkdir -p $PKG/usr/include mv -fn $PKG/usr/share/cuda/targets/x86_64-linux/include/* $PKG/usr/include/ rm -rf $PKG/usr/share/cuda/targets/x86_64-linux/include -cd $PKG/usr/share/cuda/ -ln -sf ../../include include +( cd $PKG/usr/share/cuda/ ; ln -sf ../../include include ) +find $PKG/usr/include -type f | xargs chmod -c 0644 + +# DW: moved here from doinst.sh. Link to 15.0 gcc +( + cd $PKG/usr/share/cuda/bin/ + ln -sf /usr/bin/gcc-11.2.0 gcc + ln -sf /usr/bin/g++-gcc-11.2.0 g++ +) rm -rf $PKG/usr/share/cuda/targets # These are already in the nvidia-driver package -rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libOpenCL.s* +rm -f $PKG/usr/lib64/libOpenCL.s* mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -c n -l y $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/development/cudatoolkit/cudatoolkit.info b/development/cudatoolkit/cudatoolkit.info index 5c1c6e0e6cf2..f846b402d82c 100644 --- a/development/cudatoolkit/cudatoolkit.info +++ b/development/cudatoolkit/cudatoolkit.info @@ -3,7 +3,7 @@ VERSION="10.2.89" HOMEPAGE="https://developer.nvidia.com/cuda-toolkit" DOWNLOAD="UNSUPPORTED" MD5SUM="" -DOWNLOAD_x86_64="http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run" +DOWNLOAD_x86_64="https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run" MD5SUM_x86_64="3d816c583759efa8567a92c1a2af90db" REQUIRES="nvidia-driver zulu-openjdk8" MAINTAINER="Giorgio Peron" diff --git a/development/cudatoolkit/doinst.sh b/development/cudatoolkit/doinst.sh index ec40b576fe52..98a8e99da0dc 100644 --- a/development/cudatoolkit/doinst.sh +++ b/development/cudatoolkit/doinst.sh @@ -1,3 +1,10 @@ -# install GCC 6 and link the compiler in cuda bin folder -ln -sf usr/bin/gcc-6 usr/share/cuda/bin/gcc -ln -sf usr/bin/g++-6 usr/share/cuda/bin/g++ +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + -- cgit v1.2.3