#2 Build against FlexiBLAS
Merged 2 years ago by decathorpe. Opened 2 years ago by iucar.
rpms/ iucar/root master  into  master

@@ -0,0 +1,31 @@ 

+ From 2f3c530cd8c8b9adc0303e2ae24a069f671aee1c Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?I=C3=B1aki=20=C3=9Acar?= <iucar@fedoraproject.org>

+ Date: Sun, 16 Aug 2020 13:46:21 +0200

+ Subject: [PATCH] add flexiblas detection

+ 

+ ---

+  cmake/modules/SearchInstalledSoftware.cmake | 8 +++++++-

+  1 file changed, 7 insertions(+), 1 deletion(-)

+ 

+ diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake

+ index f1c6ee27..12aa822f 100644

+ --- a/cmake/modules/SearchInstalledSoftware.cmake

+ +++ b/cmake/modules/SearchInstalledSoftware.cmake

+ @@ -1496,7 +1496,13 @@ endif()

+  if(tmva)

+    if(tmva-cpu AND imt)

+      message(STATUS "Looking for BLAS for optional parts of TMVA")

+ -    find_package(BLAS)

+ +    pkg_check_modules(FLEXIBLAS flexiblas)

+ +    set(BLAS_FOUND ${FLEXIBLAS_FOUND})

+ +    set(BLAS_LIBRARIES "${FLEXIBLAS_LIBRARIES}")

+ +    set(BLAS_LINKER_FLAGS)

+ +    if (NOT BLAS_FOUND)

+ +      find_package(BLAS)

+ +    endif()

+      if(NOT BLAS_FOUND)

+        if (GSL_FOUND)

+          message(STATUS "Using GSL CBLAS for optional parts of TMVA")

+ -- 

+ 2.25.2

+ 

file modified
+14 -2
@@ -30,6 +30,12 @@ 

  %global tbb 0

  %endif

  

+ %if 0%{?fedora} >= 33

+ %global blaslib flexiblas

+ %else

+ %global blaslib blas

+ %endif

+ 

  # Do not create .orig files when patching source

  %global _default_patch_flags --no-backup-if-mismatch

  
@@ -39,7 +45,7 @@ 

  Name:		root

  Version:	6.22.00

  %global libversion %(cut -d. -f 1-2 <<< %{version})

- Release:	5%{?dist}

+ Release:	6%{?dist}

  Summary:	Numerical data analysis framework

  

  License:	LGPLv2+
@@ -139,6 +145,8 @@ 

  #		Compatibility with xrootd 5

  #		https://github.com/root-project/root/pull/6031

  Patch32:	%{name}-xrootd5-compat.patch

+ #   Enable FlexiBLAS detection

+ Patch33:  %{name}-add-flexiblas-detection.patch

  

  #		s390x suffers from endian issues resulting in failing tests

  #		and broken documentation generation
@@ -217,7 +225,7 @@ 

  BuildRequires:	graphviz-devel

  BuildRequires:	expat-devel

  BuildRequires:	pythia8-devel >= 8.1.80

- BuildRequires:	blas-devel

+ BuildRequires:	%{blaslib}-devel

  BuildRequires:	python%{python3_pkgversion}-numpy

  BuildRequires:	doxygen

  BuildRequires:	graphviz
@@ -1839,6 +1847,7 @@ 

  %patch30 -p1

  %patch31 -p1

  %patch32 -p1

+ %patch33 -p1

  

  # Remove bundled sources in order to be sure they are not used

  #  * afterimage
@@ -3464,6 +3473,9 @@ 

  %endif

  

  %changelog

+ * Sun Aug 16 2020 Iñaki Úcar <iucar@fedoraproject.org> - 6.22.00-6

+ - https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager

+ 

  * Tue Aug 11 2020 Mattias Ellert <mattias.ellert@physics.uu.se> - 6.22.00-5

  - Fix wrong symlinks in EPEL 7 python2-root package

  

This PR is part of a F33 System-Wide Change Proposal that aims to set FlexiBLAS
as the default BLAS/LAPACK manager for all consumers of these APIs. For further
information, see https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager

I kindly ask you to merge this PR and build the package in rawhide and F33. Please,
report any issues you may found in https://bugzilla.redhat.com/show_bug.cgi?id=1860504

@decathorpe ready! Pre-existing FTBFS issue, no attempt to build.

Processing as provenpackager according to this request for help:
https://pagure.io/fesco/issue/2443#comment-669930

Diff looks good. I will merge, but will not attempt builds (broken dependencies).

Pull-Request has been merged by decathorpe

2 years ago

@iucar
cmake 3.18.3-1 in Fedora 33+ has support for flexiblas in FindBLAS.cmake and FindLAPACK.cmake so this patch is now obsolete. Cmake finds flexiblas without the patch:

-- Looking for BLAS for optional parts of TMVA
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - not found
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: /usr/lib64/libflexiblas.so

I have therefor dropped the patch in my latest build.

If other packages are using FindBLAS.cmake or FindLAPACK.cmake from the system cmake it might be possible to drop the patches in those packages as well.