Package libscalapack: Specfile

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
%define mpiimpl openmpi
%define mpidir %_libdir/%mpiimpl
%define origname scalapack

%define somver 1
%define sover %somver.8.0
Name: lib%origname
Version: 1.8.0
Release: alt17
Summary: Scalable LAPACK library
License: LGPL
Group: Sciences/Mathematics
Url: http://www.netlib.org/scalapack/
Packager: Eugeny A. Rostovtsev (REAL) <real at altlinux.org>

Source: %origname-%version.tar.gz
Source1: SLmake.inc
Source2: manpages.tar.gz

BuildPreReq: liblapack-devel gcc-fortran
BuildPreReq: %mpiimpl-devel libarpack-devel
BuildPreReq: libblacs-devel chrpath

%description
The ScaLAPACK (or Scalable LAPACK) library includes a subset of LAPACK routines
redesigned for distributed memory MIMD parallel computers. It is currently
written in a Single-Program-Multiple-Data style using explicit message passing
for interprocessor communication. It assumes matrices are laid out in a
two-dimensional block cyclic decomposition.

ScaLAPACK is designed for heterogeneous computing and is portable on any 
computer that supports MPI or PVM.

Like LAPACK, the ScaLAPACK routines are based on block-partitioned algorithms in
order to minimize the frequency of data movement between different levels of the
memory hierarchy. (For such machines, the memory hierarchy includes the
off-processor memory of other processors, in addition to the hierarchy of
registers, cache, and local memory on each processor.) The fundamental building
blocks of the ScaLAPACK library are distributed memory versions (PBLAS) of the
Level 1, 2 and 3 BLAS, and a set of Basic Linear Algebra Communication
Subprograms (BLACS) for communication tasks that arise frequently in parallel
linear algebra computations. In the ScaLAPACK routines, all interprocessor
communication occurs within the PBLAS and the BLACS. One of the design goals of
ScaLAPACK was to have the ScaLAPACK routines resemble their LAPACK equivalents
as much as possible.

If You need man pages, install libscalapack-manpages.

%package debug
Summary: Debug version of ScaLAPACK
Group: Sciences/Mathematics
Requires: libarpack-devel libblacs-devel-debug

%description debug
Debug version of ScaLAPACK.

If You need man pages, install libscalapack-manpages.

%package devel
Summary: Development files of ScaLAPACK
Group: Development/Other
Requires: libblacs-devel libarpack-devel %mpiimpl-devel
Requires: %name = %version-%release
Conflicts: %name < %version-%release
Obsoletes: %name < %version-%release
Conflicts: %name-devel < %version-%release
Obsoletes: %name-devel < %version-%release

%description devel
Development files of ScaLAPACK.

%package devel-static
Summary: Static library of ScaLAPACK
Group: Development/Other
Requires: %name-devel = %version-%release
Conflicts: %name < %version-%release
Conflicts: %name-devel < %version-%release

%description devel-static
Static library of ScaLAPACK.

%package -n pblas-tests
Summary: Tests for PBLAS
Group: Sciences/Mathematics

%description -n pblas-tests
Tests for PBLAS.

%package -n pblas-tests-data
Summary: Test data for PBLAS
Group: Sciences/Mathematics
BuildArch: noarch
Requires: pblas-tests = %version-%release

%description -n pblas-tests-data
Test data for PBLAS.

%package -n pblas-timing
Summary: PBLAS timing
Group: Sciences/Mathematics

%description -n pblas-timing
PBLAS timing.

%package -n pblas-timing-data
Summary: Data for PBLAS timing
Group: Sciences/Mathematics
BuildArch: noarch
Requires: pblas-timing = %version-%release

%description -n pblas-timing-data
Data for PBLAS timing.

%package -n pblas-devel
Summary: Headers for PBLAS
Group: Sciences/Mathematics
BuildArch: noarch
Requires: %name = %version-%release

%description -n pblas-devel
Headers for PBLAS.

%package -n %origname-redist
Summary: Tests for ScaLAPACK redist
Group: Sciences/Mathematics

%description -n %origname-redist
Tests for ScaLAPACK redist.

%package -n %origname-redist-data
Summary: Test data for ScaLAPACK redist
Group: Sciences/Mathematics
BuildArch: noarch
Requires: %origname-redist = %version-%release

%description -n %origname-redist-data
Test data for ScaLAPACK redist.

%package -n %origname-tests
Summary: Tests for ScaLAPACK
Group: Sciences/Mathematics

%description -n %origname-tests
Tests for ScaLAPACK.

%package -n %origname-tests-data
Summary: Test data for ScaLAPACK
Group: Sciences/Mathematics
BuildArch: noarch
Requires: %origname-tests = %version-%release

%description -n %origname-tests-data
Test data for ScaLAPACK.

%package -n %origname-example
Summary: Example for ScaLAPACK
Group: Sciences/Mathematics

%description -n %origname-example
Example for ScaLAPACK.

%package -n %origname-example-data
Summary: Example data for ScaLAPACK
Group: Sciences/Mathematics
BuildArch: noarch
Requires: %origname-example = %version-%release

%description -n %origname-example-data
Example data for ScaLAPACK.

%package manpages
Summary: Man pages of ScaLAPACK
Group: Sciences/Mathematics
BuildArch: noarch

%description manpages
Man pages of ScaLAPACK.

%package full
Summary: All in one ScaLAPACK shared libraries
Group: System/Libraries

%description full
All in one ScaLAPACK shared libraries.

%package full-devel
Summary: All in one ScaLAPACK development files
Group: Development/Other
Requires: %name-full = %version-%release

%description full-devel
All in one ScaLAPACK development files.


%prep
%setup
install -p -m644 %SOURCE1 ./
tar -xzvf %SOURCE2

%build
mpi-selector --set %mpiimpl
source %mpidir/bin/mpivars.sh
export OMPI_LDFLAGS="-Wl,--as-needed,-rpath,%mpidir/lib -L%mpidir/lib"

BUILDDIR=`pwd`
sed -i 's|(LIBEXECDIR)|%_libdir|g' SLmake.inc
sed -i 's|(LIBDIR)|%_libdir|g' SLmake.inc
sed -i "s|(HOME)|$BUILDDIR|g" SLmake.inc
sed -i -e 's/(OPTFLAGS)/%optflags %optflags_shared -fno-strict-aliasing/g' \
	SLmake.inc
mkdir -pv TESTING0
cp -f TESTING/*.dat TESTING0/
make lib
mkdir -pv LIB0
mv *.a LIB0/
sed -i -e 's/^\(BLACSDBGLVL\).*/\1  = 1/' SLmake.inc
make lib what=clean
for i in pblaslib pblasexe toolslib redistlib redistexe scalapacklib \
	scalapackexe example
do
	make $i
# for know, what package have executables
#	pushd TESTING
#	ls x* > ../$i.list
#	mv x* %buildroot%_bindir
#	popd
done

%install
source %mpidir/bin/mpivars.sh
export OMPI_LDFLAGS="-Wl,--as-needed,-rpath,%mpidir/lib -L%mpidir/lib"

mkdir -pv %buildroot%_bindir
mkdir -pv %buildroot%_libdir
mkdir -pv %buildroot%_includedir
mkdir -pv %buildroot%_datadir/%origname/tests
mkdir -pv %buildroot%_datadir/%origname/pblas-tests
mkdir -pv %buildroot%_datadir/%origname/pblas-timing
mkdir -pv %buildroot%_datadir/%origname/redist
mkdir -pv %buildroot%_datadir/%origname/example
mkdir -pv %buildroot%_mandir
rm SRC/pblas.h
mv TESTING/x* %buildroot%_bindir/
mv libscalapack*.a %buildroot%_libdir/
mv LIB0/libscalapack*.a %buildroot%_libdir/
mv PBLAS/SRC/*.h %buildroot%_includedir/
mv REDIST/SRC/*.h %buildroot%_includedir/
mv SRC/*.h %buildroot%_includedir/
mv TESTING0/*.dat %buildroot%_datadir/%origname/tests/
mv PBLAS/TESTING/*.dat %buildroot%_datadir/%origname/pblas-tests/
mv PBLAS/TIMING/*.dat %buildroot%_datadir/%origname/pblas-timing/
mv REDIST/TESTING/*.dat %buildroot%_datadir/%origname/redist/
mv EXAMPLE/*.dat %buildroot%_datadir/%origname/example/
mv MANPAGES/man/manl %buildroot%_mandir/

# all in one library

function createScalapack() {
	LNAME=%name$2-full.so
	mkdir tmp
	pushd tmp
	for i in blacs${1}init blacs arpack_LINUX
	do
		ar x %_libdir/lib$i.a
	done
	ar x %buildroot%_libdir/libscalapack_LINUX-0.a
	for i in $(ls *.C); do
		mv $i $i.o
	done
	mpif77 -shared -o ../$LNAME.0 * \
		-Wl,-soname,$LNAME.0 \
		-Wl,-R%mpidir/lib -lmpi_f77 -lmpi \
		-llapack -lopenblas
	popd
	rm -fR tmp
	ln -s $LNAME.0 $LNAME
	install -m644 $LNAME* %buildroot%_libdir
}

#createScalapack F77
#createScalapack C c
#install -d %buildroot%_includedir/%origname
#install -p -m644 %buildroot%_includedir/*.h \
#	$(rpm -ql libblacs-devel|grep '\.h') \
#	$(rpm -ql libarpack-devel|grep '\.h') \
#	%buildroot%_includedir/%origname

# simple shared library

pushd %buildroot%_libdir
mkdir tmp
pushd tmp
LIB=%{name}_LINUX-0
ar x ../$LIB.a
mpif77 -shared -o ../%name.so.%sover * \
	-Wl,-soname,%name.so.%somver \
	-Wl,-R%mpidir/lib -lblacs -larpack_LINUX -llapack -lopenblas
ln -s %name.so.%sover ../%name.so.%somver
ln -s %name.so.%somver ../%name.so
ln -s %name.so ../$LIB.so
chrpath -r %mpidir/lib ../$LIB.so
rm -f *
popd
rmdir tmp
popd

%files
%doc README
%_libdir/*.so.*
#exclude %_libdir/%{name}*-full.so.*
%_datadir/%origname
%exclude %_datadir/%origname/tests
%exclude %_datadir/%origname/pblas-tests
%exclude %_datadir/%origname/pblas-timing
%exclude %_datadir/%origname/redist
%exclude %_datadir/%origname/example

#files debug
#doc README
#_libdir/*-1.a

%files devel
%_libdir/*.so
#exclude %_libdir/%{name}*-full.so
%_includedir/redist.h
%_includedir/tools.h
%_includedir/pxsyevx.h

#files devel-static
#_libdir/*-0.a

%files -n pblas-tests
%_bindir/x?pblas?tst

%files -n pblas-tests-data
%_datadir/%origname/pblas-tests

%files -n pblas-timing
%_bindir/x?pblas?tim

%files -n pblas-timing-data
%_datadir/%origname/pblas-timing

%files -n pblas-devel
%_includedir/pblas.h
%_includedir/PB*.h

%files -n %origname-redist
%_bindir/x???mr

%files -n %origname-redist-data
%_datadir/%origname/redist

%files -n %origname-tests
%_bindir/*
%exclude %_bindir/x?pblas*
%exclude %_bindir/x???mr
%exclude %_bindir/x?scaex

%files -n %origname-tests-data 
%_datadir/%origname/tests

%files -n %origname-example
%_bindir/x?scaex

%files -n %origname-example-data
%_datadir/%origname/example

%files manpages
%_mandir/manl/*

#files full
#_libdir/%{name}*-full.so.*

#files full-devel
#_libdir/%{name}*-full.so
#_includedir/%origname

%changelog
* Sun Aug 12 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt17
- Built with OpenBLAS instead of GotoBLAS2

* Fri Jun 22 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt16
- Rebuilt with OpenMPI 1.6

* Wed Dec 14 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt15
- Fixed RPATH

* Fri Apr 08 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt14
- Rebuilt with GotoBLAS2 1.13-alt3

* Thu Apr 07 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt13
- Rebuilt with GotoBLAS2 instead of ATLAS
- Disabled static and *-full packages

* Thu Feb 10 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt12
- Rebuilt for debuginfo

* Thu Feb 10 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt11
- Rebuilt

* Tue Oct 26 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt10
- Rebuilt for soname set-versions

* Tue Oct 12 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt9
- Fixed overlinking of libraries

* Wed Nov 11 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt8
- Rebuilt without udapl support

* Mon Aug 31 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt7
- Added missing requirements for devel package

* Sat Aug 29 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt6
- Added simple shared library
- Disabled strict aliasing rules

* Sat Aug 08 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt5
- Added all-in-one shared library

* Thu Jun 11 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt4
- Rebuild with PIC

* Mon Jun 08 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt3
- Add requirement on libblacs-devel

* Tue May 26 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt2
- Rebuild with OpenMPI

* Sun Feb 15 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.8.0-alt1
- Initial build for Sisyphus