# Copyright (C) 2020 Dave love, University of Manchester # Licence: MIT %global commit ecbe6c0a79876f367a3b01ef9cfa325b788d79df %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global sover .0 %{?el7:%global dts devtoolset-9} Name: relapack Version: 1.0 Release: 2.git%shortcommit%{?dist} Summary: LAPACK with recursive kernel algorithms License: MIT URL: https://github.com/HPAC/ReLAPACK Source0: https://github.com/HPAC/ReLAPACK/archive/%commit/%name-%shortcommit.tar.gz BuildRequires: %{?dts:%dts-}gcc-gfortran lapack lapack-static %description ReLAPACK offers a collection of recursive algorithms for many of LAPACK's compute kernels. Since it preserves LAPACK's established interfaces, ReLAPACK integrates effortlessly into existing application codes. ReLAPACK's routines not only outperform the reference LAPACK but also improve upon the performance of tuned implementations, such as OpenBLAS and MKL. %package devel Summary: Development files for %name Requires: %name = %version-%release %description devel Development files for %name. %prep %setup -q -n ReLAPACK-%commit cat <README.Fedora Fedora ReLAPACK packaging ------------------------- The package contains librelapack, to be linked explicitly, and also a liblapack.so.3 in %_libdir/%name which may be dynamically linked in place of the reference liblapack (via LD_LIBRARY_PATH or ld.so.conf). The latter is built from reference lapack with the relevant routines replaced by the ReLAPACK ones, to be linked with a libblas (which might be as supplied similarly by the blis package, for instance). EOF %build %{?el7:source /opt/rh/%dts/enable} %make_build CFLAGS="%build_cflags -O3 -ffast-math -fPIC" mkdir obj; cd obj ar x ../librelapack.a gcc -shared -Wl,-soname=librelapack.so%sover -o librelapack.so%sover *.o %build_ldflags -lblas ln -s librelapack.so%sover librelapack.so ar x %_libdir/liblapack_pic.a ar x ../librelapack.a gcc -shared -Wl,-soname=liblapack.so.3 -o liblapack.so.3 *.o %build_ldflags -lblas %install %{?el7:source /opt/rh/%dts/enable} mkdir -p %buildroot%_libdir/%name %buildroot%_includedir cp -a obj/librelapack.so* %buildroot%_libdir cp -a obj/liblapack.so* %buildroot%_libdir/%name cp -a inc/relapack.h %buildroot%_includedir %check %{?el7:source /opt/rh/%dts/enable} %make_build test CFLAGS="%build_cflags -O3 -ffast-math" LDFLAGS="%build_ldflags" # Ensure we can actually link Fortran cd examples gfortran linsys.c chegv.f ../librelapack.a -llapack -lblas ./a.out %ldconfig_scriptlets %files %license LICENSE %doc README.md coverage.md README.Fedora %_libdir/librelapack.so%sover %_libdir/relapack/liblapack.so.3 %files devel %_includedir/relapack.h %_libdir/librelapack.so %changelog * Wed Jul 8 2020 Dave Love - 1.0-2.git%shortcommit - Update to new snapshot