diff options
author | acxz | 2020-12-11 12:06:25 -0500 |
---|---|---|
committer | acxz | 2020-12-11 12:06:25 -0500 |
commit | e2147001ef5feb770398fbc43bb71713670a7861 (patch) | |
tree | e8ffcb51aaf0140dbcf15a307b06991545288982 | |
download | aur-e2147001ef5feb770398fbc43bb71713670a7861.tar.gz |
create hipmagma package
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 70 | ||||
-rw-r--r-- | disable_magma_sparse.patch | 69 |
3 files changed, 162 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..3ff506d2149b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = hipmagma + pkgdesc = Matrix Algebra on GPU and Multicore Architectures + pkgver = 2.0.0 + pkgrel = 1 + url = https://icl.cs.utk.edu/magma/ + arch = x86_64 + license = custom + makedepends = gcc-fortran + makedepends = cmake + makedepends = ninja + depends = blas + depends = lapack + depends = rocm + depends = rocm-libs + optdepends = python: for examples and tests + optdepends = gcc-fortran: Fortran interface + source = hipmagma-2.0.0.tar.gz::https://bitbucket.org/icl/magma/get/hipMAGMAv2.0.0.tar.gz + source = disable_magma_sparse.patch + sha256sums = 81a16042b81561155189c1450f08d9282ad1ac1e7212ec5015a2063ee52ba3b2 + sha256sums = 259c38004b26395278cdaf431591974e0589dedc0f8bfc14413f854c2a10424f + +pkgname = hipmagma + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..54c60f8b9136 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: acxz <akashpatel2008 at yahoo dot com> +# Contributor: Sven-Hendrik Haase <svenstaro@gmail.com> +# Contributor: bartus <arch-user-repoᘓbartus.33mail.com> +# Contributor: pingplug <pingplug@foxmail.com> +# Contributor: cornholio <vigo.the.unholy.carpathian@gmail.com> + +pkgname=hipmagma +pkgver=2.0.0 +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' 'rocm' 'rocm-libs') +makedepends=('gcc-fortran' 'cmake' 'ninja') +optdepends=('python: for examples and tests' + 'gcc-fortran: Fortran interface') +source=("${pkgname}-${pkgver}.tar.gz::https://bitbucket.org/icl/magma/get/hipMAGMAv${pkgver}.tar.gz" + 'disable_magma_sparse.patch') +sha256sums=('81a16042b81561155189c1450f08d9282ad1ac1e7212ec5015a2063ee52ba3b2' + '259c38004b26395278cdaf431591974e0589dedc0f8bfc14413f854c2a10424f') + +_dir="icl-magma-dda09490fbae" + +prepare() { + cd ${_dir} + + # Temporarily disable magma-sparse until it's fixed by magma upstream: + # https://bugs.archlinux.org/task/67094 + patch -Np1 -i "${srcdir}/disable_magma_sparse.patch" +} + +build() { + cd ${_dir} + mkdir -p build + + cp make.inc-examples/make.inc.hip_openblas make.inc + + export CC=/usr/bin/gcc + export CXX=/usr/bin/g++ + export FC=/usr/bin/gfortran + export OPENBLASDIR=/usr + + make -f make.gen.hipMAGMA + make generate + + cmake \ + -B build \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=ON \ + . + + ninja -C build + +} + +package() { + cd ${_dir} + DESTDIR="${pkgdir}" ninja -Cbuild install + + install -d "${pkgdir}"/usr/share/magma/example + cp -r "${srcdir}"/magma-${pkgver}/example/* "${pkgdir}"/usr/share/magma/example/ + install -d "${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: diff --git a/disable_magma_sparse.patch b/disable_magma_sparse.patch new file mode 100644 index 000000000000..2be63c412a34 --- /dev/null +++ b/disable_magma_sparse.patch @@ -0,0 +1,69 @@ +diff -ruN magma-2.5.3/CMakeLists.txt magma-2.5.3-patched/CMakeLists.txt +--- magma-2.5.3/CMakeLists.txt 2020-03-30 02:48:20.000000000 +0200 ++++ magma-2.5.3-patched/CMakeLists.txt 2020-07-13 02:39:59.957710966 +0200 +@@ -491,19 +504,19 @@ + # compile MAGMA sparse library + + # sparse doesn't have Fortran at the moment, so no need for above shenanigans +-include_directories( sparse/include ) +-include_directories( sparse/control ) +-include_directories( testing ) +-cuda_add_library( magma_sparse ${libsparse_all} ) +-target_link_libraries( magma_sparse +- magma +- ${blas_fix} +- ${LAPACK_LIBRARIES} +- ${CUDA_CUDART_LIBRARY} +- ${CUDA_CUBLAS_LIBRARIES} +- ${CUDA_cusparse_LIBRARY} +-) +-add_custom_target( sparse-lib DEPENDS magma_sparse ) ++# include_directories( sparse/include ) ++# include_directories( sparse/control ) ++# include_directories( testing ) ++# cuda_add_library( magma_sparse ${libsparse_all} ) ++# target_link_libraries( magma_sparse ++# magma ++# ${blas_fix} ++# ${LAPACK_LIBRARIES} ++# ${CUDA_CUDART_LIBRARY} ++# ${CUDA_CUBLAS_LIBRARIES} ++# ${CUDA_cusparse_LIBRARY} ++# ) ++# add_custom_target( sparse-lib DEPENDS magma_sparse ) + + + # ---------------------------------------- +@@ -534,21 +547,21 @@ + + # ---------------------------------------- + # compile each sparse tester +-set( CMAKE_RUNTIME_OUTPUT_DIRECTORY sparse/testing ) +-foreach( TEST ${sparse_testing_all} ) +- string( REGEX REPLACE "\\.(cpp|f90|F90)" "" EXE ${TEST} ) +- string( REGEX REPLACE "sparse/testing/" "" EXE ${EXE} ) +- #message( "${TEST} --> ${EXE}" ) +- add_executable( ${EXE} ${TEST} ) +- target_link_libraries( ${EXE} magma_sparse magma ) +- list( APPEND sparse-testing ${EXE} ) +-endforeach() +-add_custom_target( sparse-testing DEPENDS ${sparse-testing} ) ++# set( CMAKE_RUNTIME_OUTPUT_DIRECTORY sparse/testing ) ++# foreach( TEST ${sparse_testing_all} ) ++# string( REGEX REPLACE "\\.(cpp|f90|F90)" "" EXE ${TEST} ) ++# string( REGEX REPLACE "sparse/testing/" "" EXE ${EXE} ) ++# #message( "${TEST} --> ${EXE}" ) ++# add_executable( ${EXE} ${TEST} ) ++# target_link_libraries( ${EXE} magma_sparse magma ) ++# list( APPEND sparse-testing ${EXE} ) ++# endforeach() ++# add_custom_target( sparse-testing DEPENDS ${sparse-testing} ) + + + # ---------------------------------------- + # what to install +-install( TARGETS magma magma_sparse ${blas_fix} ++install( TARGETS magma ${blas_fix} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib ) |