Пакет dolfin-complex: 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
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
%define mpiimpl openmpi
%define mpidir %_libexecdir/%mpiimpl

%define oname dolfin
%define scalar_type complex
%define ldir %_libexecdir/petsc-%scalar_type
Name: %oname-%scalar_type
Version: 0.9.10
Release: alt1.bzr20110413
Summary: C++/Python library for solving differential equations
License: LGPL v2.1
Group: Sciences/Mathematics
Url: http://www.fenics.org/
Packager: Eugeny A. Rostovtsev (REAL) <real at altlinux.org>

# http://www.fenics.org/hg/dolfin
Source: %oname-%version.tar.gz
Source1: CMakeCache.txt

Requires: python-module-%name = %version-%release
Requires: python-module-%{name}_utils = %version-%release
Requires: gcc%__gcc_version_base-c++ ufc-devel
Requires: lib%name = %version-%release
BuildPreReq: python-module-petsc-config
BuildPreReq: python-module-Pyro4 python-module-Scientific
BuildPreReq: python-module-fiat %mpiimpl-devel python-devel libcgal-devel
BuildPreReq: cmake swig libgts-devel libxml2-devel libnumpy-devel
BuildPreReq: boost-devel libvtk-python-devel vtk-python ufc-devel ffc
BuildPreReq: python-module-viper viper zlib-devel syfi libsyfi-devel
BuildPreReq: python-module-syfi sfc python-module-sfc
BuildPreReq: boost-filesystem-devel boost-program_options-devel
BuildPreReq: boost-math-devel boost-signals-devel
BuildPreReq: libpetsc-%scalar_type-devel gcc-c++ libscotch-devel
BuildPreReq: libsuitesparse-devel libmtl4-devel libamesos10-devel
BuildPreReq: libparmetis-devel libgmp-devel
BuildPreReq: libgmp_cxx-devel libhdf5-mpi-devel cppunit-devel
BuildPreReq: libpytrilinos10-devel libtrilinos10-devel
BuildPreReq: python-module-PyTrilinos10 libmpfr-devel
BuildPreReq: libarmadillo-devel libhypre-devel
BuildPreReq: petsc-%scalar_type-sources
#BuildPreReq: libslepc-%scalar_type-devel
BuildPreReq: libzoltan10-devel
#BuildPreReq: texlive-latex-extra ghostscript-utils
BuildPreReq: ghostscript-utils
#BuildPreReq: libgomp-devel

%description
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

Features:

  * Simple, consistent and intuitive object-oriented API in C++ or Python
  * Automatic and efficient evaluation of finite element variational forms
  through FFC or SyFi
  * Automatic and efficient assembly of linear systems
  * General families of finite elements, including arbitrary order continuous
  and discontinuous Lagrange finite elements, BDM elements, RT elements, BDFM
  elements, Nedelec elements and Crouzeix-Raviart
  * Arbitrary mixed elements as combination of basic elements, including for
  example Taylor-Hood
  * Discontinuous Galerkin methods including jump terms, averages, and integrals
  over interior mesh facets
  * High-performance linear algebra through uBLAS, PETSc, Trilinos and MTL4
  (experimental) with simple C++ and Python wrappers
  * Experimental support for parallel assembly
  * Simplex meshes in 1D, 2D (triangles), and 3D (tetrahedra), including
  adaptive mesh refinement
  * Multi-adaptive mcG(q)/mdG(q) and mono-adaptive cG(q)/dG(q) ODE solvers
  * Support for a range of input/output formats, including DOLFIN XML, VTK,
  Octave, MATLAB, Diffpack, Exodus II

%package -n lib%name
Summary: Shared library of DOLFIN
Group: System/Libraries
Requires: python-module-ufc
Requires: libsuitesparse >= 3.4.0-alt1
Requires: zlib >= 1.2.5-alt1

%description -n lib%name
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

This package contains shared library of DOLFIN.

%package -n lib%name-devel
Summary: Development files of DOLFIN
Group: Development/Other
Requires: lib%name = %version-%release
Requires: %oname-devel-common = %version-%release
Requires: libsyfi-devel ufc-devel zlib-devel
Requires: libparmetis-devel >= 3.1.1-alt5
Requires: libsuitesparse-devel >= 3.4.0-alt1
Requires: gcc%__gcc_version_base-c++
Conflicts: %oname-devel-common < %version-%release

%description -n lib%name-devel
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

This package contains development files of DOLFIN.

%package -n %oname-doc
Summary: Documentation for DOLFIN
Group: Documentation
BuildArch: noarch
Conflicts: %oname-real-doc
Obsoletes: %oname-real-doc

%description -n %oname-doc
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

This package contains documentation for DOLFIN.

%package -n %oname-examples
Summary: Examples for DOLFIN
Group: Documentation
BuildArch: noarch
%add_python_req_skip solution_dual mayavi stability_factors solution
%add_python_req_skip solution_1 solution_2 solution_3 solution_4
%add_python_req_skip solution_5 solution_6 solution_7 solution_8
%add_python_req_skip solution_9

%description -n %oname-examples
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

This package contains examples for DOLFIN.

%package -n %oname-example-data
Summary: Example data for DOLFIN
Group: Sciences/Mathematics
BuildArch: noarch

%description -n %oname-example-data
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

This package contains example data for DOLFIN.

%package -n python-module-%name
Summary: Python module of DOLFIN
Group: Development/Python
%add_python_lib_path %ldir/python
Requires: libpetsc-%scalar_type >= 3.0.0_p7-alt3
Requires: lib%name-devel = %version-%release
Requires: viper
%setup_python_module %oname
%py_provides %oname
%py_requires viper multiprocessing
Provides: python-module-%oname = %version-%release

%description -n python-module-%name
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

This package contains Python module of DOLFIN.

%package -n python-module-%{name}_utils
Summary: Utils Python module of DOLFIN
Group: Development/Python
BuildArch: noarch
%add_python_lib_path %ldir/python
Requires: libpetsc-%scalar_type >= 3.0.0_p7-alt3
Requires: lib%name = %version-%release
%setup_python_module %{oname}_utils
%py_provides %{oname}_utils
Provides: python-module-%{oname}_utils = %version-%release

%description -n python-module-%{name}_utils
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

This package contains utils Python module of DOLFIN.

%package -n %oname-tests
Summary: Tests and benchmarks for DOLFIN
Group: Development/Other
BuildArch: noarch

%description -n %oname-tests
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

This package contains tests and benchmarks for DOLFIN.

%package -n %oname-devel-common
Summary: Scalar type independent development files of DOLFIN
Group: Development/Other
Conflicts: lib%name-devel < %version-%release
Requires: python-module-numpy >= 1.4.0-alt1.svn20090822
Requires: zlib-devel >= 1.2.5-alt1

%description -n %oname-devel-common
DOLFIN is the C++/Python interface of FEniCS, providing a consistent PSE
(Problem Solving Environment) for ordinary and partial differential equations.

This package contains Scalar type independent development files of DOLFIN.

%prep
%setup

install -p -m644 %SOURCE1 .
sed -i 's|@SCALAR_TYPE@|%scalar_type|g' CMakeCache.txt \
	site-packages/dolfin/compilemodules/__init__.py
sed -i 's|@LIBDIR@|%_libdir|g' CMakeCache.txt

cp -f %oname/scons/pkgconfig/gmp.pc \
	%_pkgconfigdir/mtl4.pc %_pkgconfigdir/zlib.pc \
	pkgconfig/
sed -i 's|2\.1\.1|4.2.4|g' pkgconfig/mtl4.pc

%build
mpi-selector --set %mpiimpl
source /usr/bin/petsc-%scalar_type.sh
export OMPI_LDFLAGS="-Wl,--as-needed,-Rpath=%mpidir/lib -L%mpidir/lib"

LDFLAGS="-L%mpidir/lib -Wl,-R%mpidir/lib"
export LDFLAGS="$LDFLAGS -L$PETSC_DIR/lib -Wl,-R$PETSC_DIR/lib"
export LIBDIR=%_libdir

mkdir -p CMakeFiles/cmTryCompileExec.dir
cmake -DCMAKE_INSTALL_PREFIX:PATH=$PETSC_DIR .
sed -i \
	's|^\(GMP_LIBRARIES.*\)|\1;%_libdir/libgmpxx.so;%_libdir/libmpfr.so|' \
	CMakeCache.txt
%make_build

%install
source /usr/bin/petsc-%scalar_type.sh
export OMPI_LDFLAGS="-Wl,--as-needed,-Rpath=%mpidir/lib -L%mpidir/lib"

%makeinstall_std

install -d %buildroot%ldir/lib
install -d %buildroot%ldir/include
install -d %buildroot%ldir/python
install -d %buildroot%_datadir/%oname
install -d %buildroot%_pkgconfigdir
install -d %buildroot%_bindir

mv %buildroot$PETSC_DIR/share/%oname/demo %buildroot%_datadir/%oname/examples
mv %buildroot$PETSC_DIR/share/%oname/data %buildroot%_datadir/%oname/
#rm -f examples/pde/nonlinear-poisson/cpp/plot.py* \
#	examples/ode/stiff/cpp/plot.py* \
#	$(egrep -R 'solution\ import' examples |awk -F : '{print $1}')
cp -fR bench test %buildroot%_datadir/%oname/
for i in $(egrep -R '@PKG_NAME@' %buildroot%_datadir/%oname/|awk -F : '{print $1}')
do
	sed -i 's|@PKG_NAME@|%name|g' $i
done

mv %buildroot$PETSC_DIR/bin/* %buildroot%_bindir/
rmdir %buildroot$PETSC_DIR/bin
mv %buildroot$PETSC_DIR/share/man %buildroot%_datadir/
rm -fR %buildroot$PETSC_DIR/share/man
%if "%scalar_type" == "complex"
pushd %buildroot%_bindir
mv dolfin-convert dolfin-convert-complex
mv dolfin-order dolfin-order-complex
popd
pushd %buildroot%_man1dir
mv dolfin-convert.1.gz dolfin-convert-complex.1.gz
mv dolfin-order.1.gz dolfin-order-complex.1.gz
popd
%endif

cp %_includedir/ufc.h %buildroot%ldir/include/%oname/
cp %_includedir/swig/ufc.i %buildroot%ldir/include/%oname/swig/

rm -f pkgconfig/zlib.pc pkgconfig/mtl4.pc
BOOST_VERSION=$(rpm -q --qf "%{VERSION}" boost-devel)
sed -i "s|^\(Version:\).*|\1 $BOOST_VERSION|" \
	pkgconfig/boost*.pc
cp -f pkgconfig/*.pc %buildroot%_pkgconfigdir
mv %buildroot$PETSC_DIR/lib/pkgconfig/%oname.pc \
	%buildroot%_pkgconfigdir/%name.pc

mv %buildroot$PETSC_DIR/%_lib/python%_python_version/site-packages/* \
	%buildroot%ldir/python/
rm -fR %buildroot$PETSC_DIR/%_lib/python%_python_version
%ifarch x86_64
mv %buildroot$PETSC_DIR/lib/python%_python_version/site-packages/* \
	%buildroot%ldir/python/
rm -fR %buildroot$PETSC_DIR/lib/python%_python_version
%endif

ln -s %_includedir/swig %buildroot$PETSC_DIR/include/

# fix bug in pkgconfig file
sed -i 's|debug optimized||' %buildroot%_pkgconfigdir/%name.pc

%files
%doc AUTHORS COPYING ChangeLog README TODO
%_bindir/*
%_man1dir/*

%files -n lib%name
%ldir/lib/*.so.*

%files -n lib%name-devel
%ldir/lib/*.so
%ldir/include/*
%ldir/share/%oname
%_pkgconfigdir/%name.pc

%if "%scalar_type" == "real"
%files -n %oname-devel-common
%_pkgconfigdir/*
%exclude %_pkgconfigdir/%name.pc

#files -n %oname-doc
#doc %dir %_docdir/%oname
#doc %_docdir/%oname

%files -n %oname-examples
%dir %_datadir/%oname
%_datadir/%oname/examples

%files -n %oname-tests
%dir %_datadir/%oname
%_datadir/%oname/test
%_datadir/%oname/bench

%files -n %oname-example-data
%dir %_datadir/%oname
%_datadir/%oname/data

%else
%exclude %_pkgconfigdir/boost*.pc
%exclude %_pkgconfigdir/gmp.pc
%exclude %_datadir/%oname/test
%exclude %_datadir/%oname/bench
%exclude %_datadir/%oname/data
%exclude %_datadir/%oname/examples
%endif

%files -n python-module-%name
%dir %ldir/python
%ldir/python/%oname

%files -n python-module-%{name}_utils
%dir %ldir/python
%ldir/python/%{oname}_utils

# TODO: enable SLEPc (+ in .gear/CMakeCache.txt)

%changelog
* Fri Apr 15 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.10-alt1.bzr20110413
- Version 0.9.10

* Wed Apr 13 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.9-alt1.bzr20101201.4
- Built with GotoBLAS2 instead of ATLAS

* Fri Mar 25 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.9-alt1.bzr20101201.3
- Fixed pkgconfig file

* Thu Mar 24 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.9-alt1.bzr20101201.2
- Rebuilt with Boost 1.46.1

* Thu Mar 10 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.9-alt1.bzr20101201.1
- Rebuilt for debuginfo

* Thu Dec 02 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.9-alt1.bzr20101201
- New snapshot

* Fri Nov 26 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.9-alt1.bzr20101122.1
- Fixed
  + pkg-config file
  + linking of main library

* Wed Nov 24 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.9-alt1.bzr20101122
- Version 0.9.9

* Mon Nov 22 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.8-alt1.bzr20100809.8
- Restored pkgconfig file on i586

* Fri Nov 19 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.8-alt1.bzr20100809.7
- Rebuilt with zlib 1.2.5-alt1

* Sun Nov 14 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.8-alt1.bzr20100809.6
- Rebuilt with Trilinos 10.6.1

* Thu Nov 11 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.8-alt1.bzr20100809.5
- Rebuilt with SWIG 2.0.1

* Tue Oct 19 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.8-alt1.bzr20100809.4
- Rebuilt with CGAL 3.7

* Fri Oct 15 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.8-alt1.bzr20100809.3
- Fixed linking of libraries
- Avoid --no-as-needed

* Thu Aug 19 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.8-alt1.bzr20100809.2
- Built with MTL4 2-r7299-beta1

* Wed Aug 11 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.8-alt1.bzr20100809.1
- Disabled MTL4

* Tue Aug 10 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.8-alt1.bzr20100809
- Version 0.9.8
- Enabled SLEPc

* Mon Aug 09 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.7-alt1.bzr20100615.3
- Rebuilt with PETSc 3.1
- Disabled SLEPc

* Thu Jul 08 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.7-alt1.bzr20100615.2
- Added requirement on gcc-c++

* Thu Jun 17 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.7-alt1.bzr20100615.1
- Linked with mpfr

* Wed Jun 16 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.7-alt1.bzr20100615
- Version 0.9.7

* Tue Jun 15 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.5-alt1.bzr20091207.5
- Rebuilt with CGAL 3.6

* Thu Jun 10 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.5-alt1.bzr20091207.4
- Rebuilt with NumPy 2.0.0

* Wed Mar 03 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.5-alt1.bzr20091207.3
- Rebuilt with new SWIG

* Thu Dec 24 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.5-alt1.bzr20091207.2
- Rebuilt without python-module-Numeric

* Wed Dec 16 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.5-alt1.bzr20091207.1
- Rebuilt with CGAL

* Tue Dec 08 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.5-alt1.bzr20091207
- Version 0.9.5

* Sun Dec 06 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt5.hg20090831.4
- Rebuilt with Trilinos v10

* Mon Nov 16 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt5.hg20090831.3
- Rebuilt with python 2.6 (bootstrap)

* Wed Nov 04 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt5.hg20090831.2
- Rebuilt with texlive instead of tetex

* Mon Nov 02 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt5.hg20090831.1
- Rebuilt without udapl support

* Sat Sep 12 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt5.hg20090831
- Snapshot 20090831
- Rebuilt with shared libraries of requirements instead of static

* Sat Aug 29 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt5.hg20090819.1
- Moved pkg-config files for CHOLMOD and UMFPACK into SuiteSparse package

* Tue Aug 18 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt5.hg20090819
- Reformed pkgconfig settings (except boost*, zlib and suitesparse's libs,
  because this packages haven't pkg-config files now)

* Sat Jul 25 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt4
- Renamed scalar type's independent packages

* Sat Jul 25 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt3
- Fixed finding of Scotch and Cholmod for x86_64

* Sat Jul 18 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt2.1
- Added links for UFC headers
- Install python modules into %ldir/python
	instead %python_sitelibdir

* Sat Jul 18 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt2
- Reformed for support real and complex scalars

* Tue Jul 14 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.9.2-alt1
- Initial build for Sisyphus