From 358318a41c1087a4fe3e8429dde75e05c968239e Mon Sep 17 00:00:00 2001 From: sagitter Date: Tue, 17 Apr 2018 11:20:22 +0200 Subject: [PATCH] Use cmake3 on rhel; use blas from system --- SuperLU-removemc64.patch | 25 ---------------------- SuperLU.spec | 45 +++++++++++++++++++++++++++++++++------ superlu-cmake-setup.patch | 14 ------------ 3 files changed, 38 insertions(+), 46 deletions(-) delete mode 100644 SuperLU-removemc64.patch delete mode 100644 superlu-cmake-setup.patch diff --git a/SuperLU-removemc64.patch b/SuperLU-removemc64.patch deleted file mode 100644 index 00d36af..0000000 --- a/SuperLU-removemc64.patch +++ /dev/null @@ -1,25 +0,0 @@ -Description: Provide stubs for the two functions whose implementation is nonfree -Author: Sébastien Villemot -Forwarded: not-needed -Last-Update: 2013-11-27 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- /dev/null -+++ b/SRC/mc64ad.c -@@ -0,0 +1,16 @@ -+#include -+#include -+ -+void mc64id_(int *a) -+{ -+ fprintf(stderr, "SuperLU: MC64 functionality not available (it uses non-free code). Aborting.\n"); -+ abort(); -+} -+ -+void mc64ad_(int *a, int *b, int *c, int d[], int e[], double f[], -+ int *g, int h[], int *i, int j[], int *k, double l[], -+ int m[], int n[]) -+{ -+ fprintf(stderr, "SuperLU: MC64 functionality not available (it uses non-free code). Aborting.\n"); -+ abort(); -+} diff --git a/SuperLU.spec b/SuperLU.spec index 9fa1efb..e1ec86d 100644 --- a/SuperLU.spec +++ b/SuperLU.spec @@ -6,20 +6,44 @@ %{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro} %endif +# openblas available on these architectures. +%if 0%{?fedora} && 0%{?fedora} > 26 +%{!?openblas_arches:%global openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64 s390x} +%else +%{!?openblas_arches:%global openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64} +%endif +%if 0%{?rhel} +%{!?openblas_arches:%global openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64} +%endif + Name: SuperLU Version: 5.2.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Subroutines to solve sparse linear systems -License: BSD and GPLV2+ +License: BSD and GPLv2+ URL: http://crd-legacy.lbl.gov/~xiaoye/SuperLU/ Source0: http://crd-legacy.lbl.gov/~xiaoye/SuperLU/%{genname}_%{version}.tar.gz Patch0: %{genname}-cmake-includedir.patch Patch1: %{genname}-removemc64.patch -BuildRequires: atlas-devel, gcc, cmake +%ifarch %{openblas_arches} +BuildRequires: openblas-devel, openblas-srpm-macros +%else +BuildRequires: blas-devel +%endif +BuildRequires: atlas-devel, gcc +%if 0%{?rhel} +BuildRequires: cmake3, epel-rpm-macros +%global ctest3 ctest3 +%else +BuildRequires: cmake +%global cmake3 %cmake +%global ctest3 ctest +%endif BuildRequires: gcc-gfortran BuildRequires: csh +Requires: gcc-gfortran%{?_isa} %description SuperLU contains a set of subroutines to solve a sparse linear system @@ -55,19 +79,22 @@ do done %build -%cmake . +mkdir -p build; cd build +%cmake3 -Denable_blaslib:BOOL=OFF .. + %make_build %install -%make_install +%make_install -C build %check -ctest -V %{?_smp_mflags} +pushd build +%ctest3 -V %{?_smp_mflags} +popd %ldconfig_scriptlets %files -%doc README %license License.txt %{_libdir}/libsuperlu.so.%{libver}* @@ -79,6 +106,10 @@ ctest -V %{?_smp_mflags} %doc DOC EXAMPLE FORTRAN %changelog +* Sun Apr 15 2018 Antonio Trande - 5.2.1-2 +- Use cmake3 on rhel +- Use blas from system + * Fri Apr 13 2018 Rafael dos Santos - 5.2.1-1 - Update to 5.2.1 - Use cmake build system diff --git a/superlu-cmake-setup.patch b/superlu-cmake-setup.patch deleted file mode 100644 index 37066e0..0000000 --- a/superlu-cmake-setup.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- /tmp/SuperLU_5.2.0/SRC/CMakeLists.txt 2016-04-09 03:53:17.000000000 +0200 -+++ SuperLU_5.2.0/SRC/CMakeLists.txt 2018-04-13 11:42:28.481583088 +0200 -@@ -233,9 +233,9 @@ - VERSION ${PROJECT_VERSION} SOVERSION ${VERSION_MAJOR} - ) - install(TARGETS superlu -- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) - - install(FILES ${headers} -- DESTINATION ${CMAKE_INSTALL_PREFIX}/include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - )