File _service:extract_file:superlu.spec of Package superlu-gnu14 (Revision 568a60cb0b01edb6783f3a552ab9eab5)
Currently displaying revision 568a60cb0b01edb6783f3a552ab9eab5 , Show latest
140
1
#----------------------------------------------------------------------------bh-
2
# This RPM .spec file is part of the OpenHPC project.
3
#
4
# It may have been modified from the default version supplied by the underlying
5
# release package (if available) in order to apply patches, perform customized
6
# build/install configurations, and supply additional files to support
7
# desired integration conventions.
8
#
9
#----------------------------------------------------------------------------eh-
10
11
# SuperLU library build that is dependent on compiler toolchain
12
%define ohpc_compiler_dependent 1
13
%include %{_sourcedir}/OHPC_macros
14
15
# Base package name
16
%define pname superlu
17
18
Name: %{pname}-%{compiler_family}%{PROJ_DELIM}
19
Summary: A general purpose library for the direct solution of linear equations
20
License: BSD-3-Clause
21
Group: %{PROJ_NAME}/serial-libs
22
Version: 5.2.1
23
Release: 0%{?dist}
24
Source0: http://crd-legacy.lbl.gov/%7Exiaoye/SuperLU/%{pname}_%{version}.tar.gz
25
# PATCH-FEATURE-OPENSUSE superlu-5.1-make.patch : add compiler and build flags in make.inc
26
Patch: superlu-5.2-make.patch
27
# PATCH-FIX-UPSTREAM superlu-4.3-include.patch : avoid implicit declaration warnings
28
Patch1: superlu-4.3-include.patch
29
# PATCH-FIX-UPSTREAM superlu-4.3-dont-opt-away.diff
30
Patch2: superlu-4.3-dont-opt-away.diff
31
# PATCH-FIX-OPENSUSE superlu-5.1-remove-hsl.patch [bnc#796236]
32
# The Harwell Subroutine Library (HSL) routine m64ad.c have been removed
33
# from the original sources for legal reasons. This patch disables the inclusion of
34
# this routine in the library which, however, remains fully functional
35
Patch3: superlu-5.1-disable-hsl.patch
36
Url: http://crd.lbl.gov/~xiaoye/SuperLU/
37
38
%if "%{compiler_family}" != "intel" && "%{compiler_family}" != "arm1"
39
Requires: openblas-%{compiler_family}%{PROJ_DELIM}
40
%endif
41
42
Requires: lmod%{PROJ_DELIM} >= 7.6.1
43
BuildRequires: make
44
BuildRequires: tcsh
45
46
# Default library install path
47
%define install_path %{OHPC_LIBS}/%{compiler_family}/%{pname}%{OHPC_CUSTOM_PKG_DELIM}/%version
48
49
%description
50
SuperLU is an algorithm that uses group theory to optimize LU
51
decomposition of sparse matrices. It's the fastest direct solver for
52
linear systems that the author is aware of.
53
54
Docu can be found on http://www.netlib.org.
55
56
%prep
57
%setup -q -n SuperLU_%{version}
58
%patch -p1
59
%patch1 -p1
60
%patch2 -p1
61
%patch3 -p1
62
63
%build
64
%ohpc_setup_compiler
65
%if "%{compiler_family}" == "arm1" || "%{compiler_family}" == "intel"
66
export DEFAULT_OPTS="${DEFAULT_OPTS} -Wno-implicit-int"
67
export DEFAULT_OPTS="${DEFAULT_OPTS} -Wno-implicit-function-declaration"
68
%endif
69
%if "%{compiler_family}" == "arm1"
70
export DEFAULT_OPTS="${DEFAULT_OPTS} -fsimdmath"
71
%endif
72
73
make lib
74
75
mkdir tmp
76
(cd tmp; ar -x ../SRC/libsuperlu.a)
77
$FC -shared -Wl,-soname,libsuperlu.so.4 -o lib/libsuperlu.so tmp/*.o
78
79
%install
80
mkdir -p %{buildroot}%{install_path}/lib
81
mkdir -p %{buildroot}%{install_path}/include
82
install -m644 SRC/*.h %{buildroot}%{install_path}/include
83
install -m755 lib/libsuperlu.so %{buildroot}%{install_path}/lib/libsuperlu.so.%{version}
84
pushd %{buildroot}%{install_path}/lib
85
ln -s libsuperlu.so.%{version} libsuperlu.so.4
86
ln -s libsuperlu.so.4 libsuperlu.so
87
popd
88
89
# OpenHPC module file
90
%{__mkdir} -p %{buildroot}%{OHPC_MODULEDEPS}/%{compiler_family}/%{pname}
91
%{__cat} << EOF > %{buildroot}/%{OHPC_MODULEDEPS}/%{compiler_family}/%{pname}/%{version}%{OHPC_CUSTOM_PKG_DELIM}
92
#%Module1.0#####################################################################
93
94
proc ModulesHelp { } {
95
96
puts stderr " "
97
puts stderr "This module loads the SuperLU library built with the %{compiler_family} compiler"
98
puts stderr "toolchain."
99
puts stderr " "
100
puts stderr "Note that this build of SuperLU leverages the OpenBLAS linear algebra libraries."
101
puts stderr "Consequently, openblas is loaded automatically with this module."
102
103
puts stderr "\nVersion %{version}\n"
104
105
}
106
module-whatis "Name: %{pname} built with %{compiler_family} compiler"
107
module-whatis "Version: %{version}"
108
module-whatis "Category: runtime library"
109
module-whatis "Description: %{summary}"
110
module-whatis "%{url}"
111
112
set version %{version}
113
114
%if "%{compiler_family}" != "intel" && "%{compiler_family}" != "arm1"
115
depends-on openblas
116
%endif
117
118
prepend-path INCLUDE %{install_path}/include
119
prepend-path LD_LIBRARY_PATH %{install_path}/lib
120
121
setenv %{PNAME}_DIR %{install_path}
122
setenv %{PNAME}_INC %{install_path}/include
123
setenv %{PNAME}_LIB %{install_path}/lib
124
125
EOF
126
127
%{__cat} << EOF > %{buildroot}/%{OHPC_MODULEDEPS}/%{compiler_family}/%{pname}/.version.%{version}%{OHPC_CUSTOM_PKG_DELIM}
128
#%Module1.0#####################################################################
129
##
130
## version file for %{pname}-%{version}
131
##
132
set ModulesVersion "%{version}%{OHPC_CUSTOM_PKG_DELIM}"
133
EOF
134
135
%{__mkdir} -p $RPM_BUILD_ROOT/%{_docdir}
136
137
%files
138
%{OHPC_PUB}
139
%doc README
140