Name: streflop Version: 0.3 Release: 1%{?dist} Summary: Standalone Reproducible Floating Point Library License: LGPLv2+ URL: http://nicolas.brodu.numerimoire.net/en/programmation/streflop/index.html Source0: http://nicolas.brodu.numerimoire.net/common/programmation/streflop/%{name}-%{version}.tar.bz2 Source1: streflop-x87.pc Source2: streflop-x87-nd.pc Source3: streflop-sse.pc Source4: streflop-sse-nd.pc Patch0: streflop-0.3-sharedlib.patch # Fixes compiler issues Patch1: streflop-0.3-gcc-fixes.patch %description A computer has a finite memory, and cannot represent an infinity of numbers. If you add 0.1 + 0.1 in C++ you will probably not get the mathematical result 0.2. The problem is that what you get depends on many parameters. On one configuration, you may get something like 0.1995, and on another 0.1999. For the vast majority of programs, these small differences do not matter. But if you want to reproduce the same results twice, for a scientific experiment for example, on different machines or even on the same machine but with different options, then you have to be more careful. Much more careful, because these small differences can occasionally accumulate quite fast. The STandalone REproducible FLOating-Point library allows you to control how the computations are done in C++. The goal is to make your programs give reliable and reproducible results. %package devel Summary: Development headers and libraries for streflop Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development headers and libraries for streflop. %prep %setup -q %patch0 -p1 -b .shared %patch1 -p1 -b .gcc # Use Fedora optflags sed -i 's|-O3 -pipe -g -frename-registers|%{optflags} -fPIC|' Makefile.common cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} . sed -i 's|@PREFIX@|%{_prefix}|g' *.pc sed -i 's|@LIBDIR@|%{_libdir}|g' *.pc sed -i 's|@INCLUDEDIR@|%{_includedir}|g' *.pc %build # This library can be built quite a few ways, specifically # With denormals enabled or disabled # With one of the following FPU types: STREFLOP_SSE, STREFLOP_X87, STREFLOP_SOFT # We'll build for 4 cases (the SoftFloat code isn't functional) # Case 1: X87 with Denormals make %{?_smp_mflags} libstreflop-x87.so make clean # Case 2: SSE with Denormals sed -i 's|STREFLOP_X87 = 1|#STREFLOP_X87 = 1|' Makefile.common sed -i 's|#STREFLOP_SSE = 1|STREFLOP_SSE = 1|' Makefile.common make %{?_smp_mflags} libstreflop-sse.so make clean # Case 3: SSE with No Denormals sed -i 's|#STREFLOP_NO_DENORMALS = 1|STREFLOP_NO_DENORMALS = 1|' Makefile.common sed -i 's|#STREFLOP_SSE = 1|STREFLOP_SSE = 1|' Makefile.common sed -i 's|STREFLOP_SOFT = 1|#STREFLOP_SOFT = 1|' Makefile.common make %{?_smp_mflags} libstreflop-sse-nd.so make clean # Case 4: X87 with No Denormals sed -i 's|STREFLOP_SSE = 1|#STREFLOP_SSE = 1|' Makefile.common sed -i 's|#STREFLOP_X87 = 1|STREFLOP_X87 = 1|' Makefile.common make %{?_smp_mflags} libstreflop-x87-nd.so make clean %install # Libs mkdir -p %{buildroot}%{_libdir} install -m0755 libstreflop-*.so.* %{buildroot}%{_libdir} pushd %{buildroot}%{_libdir} for i in libstreflop-x87 libstreflop-sse libstreflop-x87-nd libstreflop-sse-nd; do ln -s $i.so.0.0.0 $i.so.0 ln -s $i.so.0.0.0 $i.so done popd # Headers mkdir -p %{buildroot}%{_includedir}/%{name}/softfloat/ install -m0644 streflop.h %{buildroot}%{_includedir}/ install -m0644 X87DenormalSquasher.h %{buildroot}%{_includedir}/%{name}/ install -m0644 SoftFloatWrapper.h %{buildroot}%{_includedir}/%{name}/ install -m0644 FPUSettings.h %{buildroot}%{_includedir}/%{name}/ install -m0644 Math.h %{buildroot}%{_includedir}/%{name}/ install -m0644 Random.h %{buildroot}%{_includedir}/%{name}/ install -m0644 IntegerTypes.h %{buildroot}%{_includedir}/%{name}/ install -m0644 System.h %{buildroot}%{_includedir}/%{name}/ install -m0644 softfloat/softfloat.h %{buildroot}%{_includedir}/%{name}/softfloat/ # Pkgconfigs mkdir -p %{buildroot}%{_libdir}/pkgconfig/ install -m0644 *.pc %{buildroot}%{_libdir}/pkgconfig/ %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %doc LGPL.txt README.txt %{_libdir}/lib%{name}*.so.* %files devel %{_includedir}/%{name}.h %{_includedir}/%{name}/ %{_libdir}/lib%{name}*.so %{_libdir}/pkgconfig/%{name}*.pc %changelog * Wed Aug 31 2011 Tom Callaway 0.3-1 - Initial package