[arch-commits] Commit in (magma magma/repos magma/trunk magma/trunk/PKGBUILD)

Sven-Hendrik Haase svenstaro at archlinux.org
Wed Sep 4 00:01:06 UTC 2019


    Date: Wednesday, September 4, 2019 @ 00:00:17
  Author: svenstaro
Revision: 507988

Move magma from AUR for pytorch

Added:
  magma/
  magma/repos/
  magma/trunk/
  magma/trunk/PKGBUILD

----------+
 PKGBUILD |   74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

Added: magma/trunk/PKGBUILD
===================================================================
--- magma/trunk/PKGBUILD	                        (rev 0)
+++ magma/trunk/PKGBUILD	2019-09-04 00:00:17 UTC (rev 507988)
@@ -0,0 +1,74 @@
+# Maintainer: Sven-Hendrik Haase <svenstaro at gmail.com>
+# Contributor: bartus <arch-user-repoᘓbartus.33mail.com>
+# Contributor: pingplug <pingplug at foxmail.com>
+# Contributor: cornholio <vigo.the.unholy.carpathian at gmail.com>
+
+pkgbase=magma
+pkgname=(magma magma-cuda)
+pkgver=2.5.1
+pkgrel=1
+pkgdesc="Matrix Algebra on GPU and Multicore Architectures"
+arch=('x86_64')
+url="https://icl.cs.utk.edu/magma/"
+license=('custom')
+depends=('blas' 'lapack')
+makedepends=('gcc-fortran' 'cmake' 'cuda')
+optdepends=('python2: for examples and tests')
+source=("http://icl.cs.utk.edu/projectsfiles/${pkgname}/downloads/${pkgname}-${pkgver}.tar.gz")
+sha256sums=('ce32c199131515336b30c92a907effe0c441ebc5c5bdb255e4b06b2508de109f')
+
+[ -n "${_GPU_TARGET}" ]                   && _CMAKE_FLAGS+=(-DGPU_TARGET=${_GPU_TARGET})
+[ -f "/usr/lib/ccache/bin/nvcc-ccache" ]  && _CMAKE_FLAGS+=( -DCUDA_NVCC_EXECUTABLE=/usr/lib/ccache/bin/nvcc-ccache )
+
+if _cuda_gcc=$(basename $(readlink /opt/cuda/bin/gcc)) ; then
+  [ -L "/usr/lib/ccache/bin/$_cuda_gcc" ] && _CMAKE_FLAGS+=( -DCUDA_HOST_COMPILER=/usr/lib/ccache/bin/$_cuda_gcc )
+fi
+
+build() {
+  cd "${srcdir}/magma-${pkgver}"
+
+  mkdir -p build build-cuda
+  cd build
+  cmake .. \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DBUILD_SHARED_LIBS=ON
+  make magma magma_sparse
+
+  cd ../build-cuda
+  cmake .. \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DBUILD_SHARED_LIBS=ON \
+    -DGPU_TARGET="sm_30 sm_32 sm_35 sm_37 sm_50 sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75"
+  make magma magma_sparse
+}
+
+package_magma() {
+  cd ${srcdir}/magma-${pkgver}/build
+  # do not build test
+  sed -i "s/install: preinstall/install: magma_sparse/g" Makefile
+  make DESTDIR="${pkgdir}" install
+
+  mkdir -p ${pkgdir}/usr/share/magma/example
+  cp -r ${srcdir}/magma-${pkgver}/example/* ${pkgdir}/usr/share/magma/example/
+  mkdir -p ${pkgdir}/usr/share/magma/testing
+  cp -r ${srcdir}/magma-${pkgver}/testing/* ${pkgdir}/usr/share/magma/testing/
+  install -Dm644 ${srcdir}/magma-${pkgver}/COPYRIGHT ${pkgdir}/usr/share/licenses/magma/LICENSE
+}
+
+package_magma-cuda() {
+  depends+=('cuda')
+  cd ${srcdir}/magma-${pkgver}/build-uda
+  # do not build test
+  sed -i "s/install: preinstall/install: magma_sparse/g" Makefile
+  make DESTDIR="${pkgdir}" install
+
+  mkdir -p ${pkgdir}/usr/share/magma/example
+  cp -r ${srcdir}/magma-${pkgver}/example/* ${pkgdir}/usr/share/magma/example/
+  mkdir -p ${pkgdir}/usr/share/magma/testing
+  cp -r ${srcdir}/magma-${pkgver}/testing/* ${pkgdir}/usr/share/magma/testing/
+  install -Dm644 ${srcdir}/magma-${pkgver}/COPYRIGHT ${pkgdir}/usr/share/licenses/magma/LICENSE
+}
+
+# vim:set ts=2 sw=2 et:


More information about the arch-commits mailing list