diff options
author | William PC <w_calandrini[at]hotmail[dot]com> | 2022-10-18 20:45:28 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-10-18 20:45:28 +0700 |
commit | 459346f491d54c6bb7c0f3718663d26cec251296 (patch) | |
tree | 628948bd85dc23d6d5de0a7258df2bb04df73512 | |
parent | 183cb0c4028d84b26dcb96e2a576a76b321c0b93 (diff) |
libraries/libxsmm: Added (Library for matrix and deep learning).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | libraries/libxsmm/README | 15 | ||||
-rw-r--r-- | libraries/libxsmm/libxsmm.SlackBuild | 120 | ||||
-rw-r--r-- | libraries/libxsmm/libxsmm.info | 10 | ||||
-rw-r--r-- | libraries/libxsmm/slack-desc | 19 |
4 files changed, 164 insertions, 0 deletions
diff --git a/libraries/libxsmm/README b/libraries/libxsmm/README new file mode 100644 index 000000000000..cda6921175c6 --- /dev/null +++ b/libraries/libxsmm/README @@ -0,0 +1,15 @@ + LIBXSMM is a library for specialized dense and sparse matrix +operations as well as for deep learning primitives such as small +convolutions. The library is targeting Intel Architecture with +Intel SSE, Intel AVX, Intel AVX2, Intel AVX512 (with VNNI and +Bfloat16), and Intel AMX (Advanced Matrix Extensions) supported by +future Intel processor code-named Sapphire Rapids. Code generation +is mainly based on Just-In-Time (JIT) code specialization for +compiler-independent performance (matrix multiplications, matrix +transpose/copy, sparse functionality, and deep learning). +LIBXSMM is suitable for "build once and deploy everywhere", +i.e., no special target flags are needed to exploit the available +performance. Supported GEMM datatypes are: FP64, FP32, bfloat16, +int16, and int8. + +NOTE: the library does not support 32-bit architecture (64-bit only) diff --git a/libraries/libxsmm/libxsmm.SlackBuild b/libraries/libxsmm/libxsmm.SlackBuild new file mode 100644 index 000000000000..aa9d6e6c6ab4 --- /dev/null +++ b/libraries/libxsmm/libxsmm.SlackBuild @@ -0,0 +1,120 @@ +#!/bin/bash + +# Slackware build script for libxsmm + +# Copyright 2022 William PC - Seattle, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=libxsmm +VERSION=${VERSION:-1.17} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +SRCNAM="$(printf $PRGNAM | cut -d- -f2-)" + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +case "$ARCH" in + i?86) BUILD_OPT="PLATFORM=1" ;; +esac + +# fix for installing pkconfig files +# it's using LIBDIRSUFFIX, but the program doesn't work on 32-bit +sed -i 's#libdata/#lib'${LIBDIRSUFFIX}'/#' Makefile +# fix for installing libs at lib$LIBDIRSUFFIX +sed -i 's/^OUTDIR := lib/&'${LIBDIRSUFFIX}'/' Makefile + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +SHARED=1 STATIC=0 \ +PDOCDIR=doc/$PRGNAM-$VERSION \ +make install DESTDIR=$PKG PREFIX=/usr $BUILD_OPT + +mkdir -p $PKG/usr/share/$PRGNAM-$VERSION +cp -av samples $PKG/usr/share/$PRGNAM-$VERSION + +# purge empty doc files +find $PKG/usr/doc -size 0 -exec rm '{}' \; + + +# Don't ship .la files: +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG -depth -type d -empty -delete || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/libraries/libxsmm/libxsmm.info b/libraries/libxsmm/libxsmm.info new file mode 100644 index 000000000000..664d2cd380cb --- /dev/null +++ b/libraries/libxsmm/libxsmm.info @@ -0,0 +1,10 @@ +PRGNAM="libxsmm" +VERSION="1.17" +HOMEPAGE="https://github.com/libxsmm/libxsmm" +DOWNLOAD="UNSUPPORTED" +MD5SUM="" +DOWNLOAD_x86_64="https://github.com/libxsmm/libxsmm/archive/1.17/libxsmm-1.17.tar.gz" +MD5SUM_x86_64="bef3b02f8837b0eed1ea334045da0524" +REQUIRES="" +MAINTAINER="William PC" +EMAIL="w_calandrini[at]hotmail[dot]com" diff --git a/libraries/libxsmm/slack-desc b/libraries/libxsmm/slack-desc new file mode 100644 index 000000000000..c21abba72f5b --- /dev/null +++ b/libraries/libxsmm/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +libxsmm: libxsmm (Library for matrix operations and deep learning primitives) +libxsmm: +libxsmm: LIBXSMM is a library for specialized dense and sparse matrix +libxsmm: operations as well as for deep learning primitives such as small +libxsmm: convolutions. The library is targeting Intel Architecture with +libxsmm: Intel SSE, Intel AVX, Intel AVX2, Intel AVX512 (with VNNI and +libxsmm: Bfloat16), and Intel AMX (Advanced Matrix Extensions) supported by +libxsmm: future Intel processor code-named Sapphire Rapids. +libxsmm: +libxsmm: * Note: LIBXSMM is only supported on 64-bit platforms! +libxsmm: |