Date: Thursday, October 1, 2020 @ 21:54:12 Author: kgizdov Revision: 714405
archrelease: copy trunk to community-staging-x86_64 Added: magma/repos/community-staging-x86_64/ magma/repos/community-staging-x86_64/PKGBUILD (from rev 714404, magma/trunk/PKGBUILD) magma/repos/community-staging-x86_64/cuda11.1.patch (from rev 714404, magma/trunk/cuda11.1.patch) magma/repos/community-staging-x86_64/disable_magma_sparse.patch (from rev 714404, magma/trunk/disable_magma_sparse.patch) ----------------------------+ PKGBUILD | 60 ++++++++++++++++++++++++++++++ cuda11.1.patch | 84 +++++++++++++++++++++++++++++++++++++++++++ disable_magma_sparse.patch | 69 +++++++++++++++++++++++++++++++++++ 3 files changed, 213 insertions(+) Copied: magma/repos/community-staging-x86_64/PKGBUILD (from rev 714404, magma/trunk/PKGBUILD) =================================================================== --- community-staging-x86_64/PKGBUILD (rev 0) +++ community-staging-x86_64/PKGBUILD 2020-10-01 21:54:12 UTC (rev 714405) @@ -0,0 +1,60 @@ +# Maintainer: Sven-Hendrik Haase <svenst...@gmail.com> +# Contributor: bartus <arch-user-repoᘓbartus.33mail.com> +# Contributor: pingplug <pingp...@foxmail.com> +# Contributor: cornholio <vigo.the.unholy.carpath...@gmail.com> + +pkgname=magma +pkgver=2.5.3 +pkgrel=4 +pkgdesc="Matrix Algebra on GPU and Multicore Architectures" +arch=('x86_64') +url="https://icl.cs.utk.edu/magma/" +license=('custom') +depends=('blas' 'lapack' 'cuda') +makedepends=('gcc-fortran' 'cmake' 'ninja') +optdepends=('python: for examples and tests' + 'gcc-fortran: Fortran interface') +source=("${pkgname}-${pkgver}.tar.gz::http://icl.cs.utk.edu/projectsfiles/${pkgname}/downloads/${pkgname}-${pkgver}.tar.gz" + 'cuda11.1.patch' + 'disable_magma_sparse.patch') +sha256sums=('c602d269a9f9a3df28f6a4f593be819abb12ed3fa413bba1ff8183de721c5ef6' + '4d6e7e844a5aa5a771480a1fa61daaf85981f52d852ee444d7ffda63ac9a2db2' + '259c38004b26395278cdaf431591974e0589dedc0f8bfc14413f854c2a10424f') + +prepare() { + cd ${pkgname}-${pkgver} + patch -Np1 -i "${srcdir}/cuda11.1.patch" + + # 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 ${pkgname}-${pkgver} + + CC=/usr/bin/gcc \ + CXX=/usr/bin/g++ \ + FC=/usr/bin/gfortran \ + cmake \ + -Bbuild \ + -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=ON \ + -DGPU_TARGET="sm_52 sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75 sm_80 sm_86" + ninja -C build +} + +package() { + cd ${pkgname}-${pkgver} + 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: Copied: magma/repos/community-staging-x86_64/cuda11.1.patch (from rev 714404, magma/trunk/cuda11.1.patch) =================================================================== --- community-staging-x86_64/cuda11.1.patch (rev 0) +++ community-staging-x86_64/cuda11.1.patch 2020-10-01 21:54:12 UTC (rev 714405) @@ -0,0 +1,84 @@ +diff -aur --color magma-2.5.3-old/CMakeLists.txt magma-2.5.3-new/CMakeLists.txt +--- magma-2.5.3-old/CMakeLists.txt 2020-10-01 23:41:29.087168262 +0300 ++++ magma-2.5.3-new/CMakeLists.txt 2020-10-01 23:46:00.735320487 +0300 +@@ -101,7 +101,7 @@ + + # ---------------------------------------- + # locate CUDA libraries +-set( GPU_TARGET "Kepler Maxwell Pascal" CACHE STRING "CUDA architectures to compile for; one or more of Fermi, Kepler, Maxwell, Pascal, Volta, or valid sm_[0-9][0-9]" ) ++set( GPU_TARGET "Kepler Maxwell Pascal" CACHE STRING "CUDA architectures to compile for; one or more of Fermi, Kepler, Maxwell, Pascal, Volta, Turing, Ampere or valid sm_[0-9][0-9]" ) + find_package( CUDA ) + if (CUDA_FOUND) + message( STATUS "Found CUDA ${CUDA_VERSION}" ) +@@ -136,21 +136,25 @@ + endif() + + if (${GPU_TARGET} MATCHES Maxwell) +- set( GPU_TARGET "${GPU_TARGET} sm_50" ) ++ set( GPU_TARGET "${GPU_TARGET} sm_50 sm_52 sm_53" ) + endif() + + if (${GPU_TARGET} MATCHES Pascal) +- set( GPU_TARGET "${GPU_TARGET} sm_60" ) ++ set( GPU_TARGET "${GPU_TARGET} sm_60 sm_61 sm_62" ) + endif() + + if (${GPU_TARGET} MATCHES Volta) +- set( GPU_TARGET "${GPU_TARGET} sm_70" ) ++ set( GPU_TARGET "${GPU_TARGET} sm_70 sm_72" ) + endif() + + if (${GPU_TARGET} MATCHES Turing) + set( GPU_TARGET "${GPU_TARGET} sm_75" ) + endif() + ++ if (${GPU_TARGET} MATCHES Ampere) ++ set( GPU_TARGET "${GPU_TARGET} sm_80 sm_86" ) ++ endif() ++ + if (${GPU_TARGET} MATCHES sm_20) + if (NOT MIN_ARCH) + set( MIN_ARCH 200 ) +@@ -259,8 +263,26 @@ + message( STATUS " compile for CUDA arch 7.5 (Turing)" ) + endif() + ++ if (${GPU_TARGET} MATCHES sm_80) ++ if (NOT MIN_ARCH) ++ set( MIN_ARCH 800 ) ++ endif() ++ set( NV_SM ${NV_SM} -gencode arch=compute_80,code=sm_80 ) ++ set( NV_COMP -gencode arch=compute_80,code=compute_80 ) ++ message( STATUS " compile for CUDA arch 8.0 (Ampere)" ) ++ endif() ++ ++ if (${GPU_TARGET} MATCHES sm_86) ++ if (NOT MIN_ARCH) ++ set( MIN_ARCH 860 ) ++ endif() ++ set( NV_SM ${NV_SM} -gencode arch=compute_86,code=sm_86 ) ++ set( NV_COMP -gencode arch=compute_86,code=compute_86 ) ++ message( STATUS " compile for CUDA arch 8.6 (Ampere)" ) ++ endif() ++ + if (NOT MIN_ARCH) +- message( FATAL_ERROR "GPU_TARGET must contain one or more of Fermi, Kepler, Maxwell, Pascal, Volta, Turing, or valid sm_[0-9][0-9]" ) ++ message( FATAL_ERROR "GPU_TARGET must contain one or more of Fermi, Kepler, Maxwell, Pascal, Volta, Turing, Ampere or valid sm_[0-9][0-9]" ) + endif() + + set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -DHAVE_CUBLAS ${NV_SM} ${NV_COMP} ${FORTRAN_CONVENTION} ) +diff -aur --color magma-2.5.3-old/interface_cuda/interface.cpp magma-2.5.3-new/interface_cuda/interface.cpp +--- magma-2.5.3-old/interface_cuda/interface.cpp 2020-03-30 03:48:24.000000000 +0300 ++++ magma-2.5.3-new/interface_cuda/interface.cpp 2020-06-22 15:48:15.192500739 +0300 +@@ -458,7 +458,11 @@ + err = cudaPointerGetAttributes( &attr, const_cast<void*>( A )); + if ( ! err ) { + // definitely know type ++#if (CUDA_VERSION >= 10000) ++ return (attr.type == cudaMemoryTypeDevice); ++#else + return (attr.memoryType == cudaMemoryTypeDevice); ++#endif + } + else if ( err == cudaErrorInvalidValue ) { + // clear error; see http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=529 Copied: magma/repos/community-staging-x86_64/disable_magma_sparse.patch (from rev 714404, magma/trunk/disable_magma_sparse.patch) =================================================================== --- community-staging-x86_64/disable_magma_sparse.patch (rev 0) +++ community-staging-x86_64/disable_magma_sparse.patch 2020-10-01 21:54:12 UTC (rev 714405) @@ -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 )