diff --git a/.gitignore b/.gitignore index e69de29..2d8ffba 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/ignition-math2-2.2.3.tar.bz2 diff --git a/ignition-math-2.2.2-387.patch b/ignition-math-2.2.2-387.patch new file mode 100644 index 0000000..85f8ccc --- /dev/null +++ b/ignition-math-2.2.2-387.patch @@ -0,0 +1,29 @@ +diff -up ./include/ignition/math/Helpers.hh.387 ./include/ignition/math/Helpers.hh +--- ./include/ignition/math/Helpers.hh.387 2015-08-03 20:24:36.000000000 -0400 ++++ ./include/ignition/math/Helpers.hh 2015-09-06 13:09:57.607755925 -0400 +@@ -67,6 +67,15 @@ + #define IGN_PI_4 0.78539816339744830962 + #endif + ++/// \brief Define IGN_FP_VOLATILE for FP equality comparisons ++/// Use volatile parameters when checking floating point equality on ++/// the 387 math coprocessor to work around bugs from the 387 extra precision ++#if defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 2 ++#define IGN_FP_VOLATILE volatile ++#else ++#define IGN_FP_VOLATILE ++#endif ++ + namespace ignition + { + /// \brief Math classes and function useful in robot applications. +@@ -183,7 +192,8 @@ namespace ignition + inline bool equal(const T &_a, const T &_b, + const T &_epsilon = 1e-6) + { +- return std::abs(_a - _b) <= _epsilon; ++ IGN_FP_VOLATILE T diff = std::abs(_a - _b); ++ return diff <= _epsilon; + } + + /// \brief get value at a specified precision diff --git a/ignition-math.spec b/ignition-math.spec new file mode 100644 index 0000000..2d03fd3 --- /dev/null +++ b/ignition-math.spec @@ -0,0 +1,100 @@ +%global _docdir_fmt %{name} + +Name: ignition-math +Version: 2.2.3 +Release: 1%{?dist} +Summary: Small, Fast, High Performance Math Library + +Group: Development/Libraries +License: ASL 2.0 +URL: http://ignitionrobotics.org/libraries/math +Source0: http://gazebosim.org/distributions/ign-math/releases/%{name}2-%{version}.tar.bz2 +# This patch modifies the equality helper test to use an intermediate variable +# to test for equality. +# Upstream: https://bitbucket.org/ignitionrobotics/ign-math/pull-requests/58/change-equality-helper-to-work-with-387-fp/diff +Patch0: %{name}-2.2.2-387.patch +BuildRequires: cmake +BuildRequires: doxygen +BuildRequires: graphviz +BuildRequires: rubygem-ronn + + +%description +Ignition Math is a component in the Ignition framework, a set of libraries +designed to rapidly develop robot applications. The library defines math +classes and functions used in other Ignition libraries and programs. + +%package devel +Summary: Development files and libraries for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains the header files and libraries +for %{name}. If you like to develop programs using %{name}, +you will need to install %{name}-devel. + +%package doc +Summary: Development documentation for %{name} +BuildArch: noarch + +%description doc +Generated API and development documentation for %{name} + +%prep +%setup -q -n %{name}2-%{version} +%patch0 -p0 -b .387 +# Required to sneak in custom CFLAGS via CMAKE_C_FLAGS_ALL +sed -i 's/unset/#unset/g' CMakeLists.txt + +%build +mkdir build +pushd build +%cmake .. \ +%ifnarch x86_64 + -DSSE2_FOUND=FALSE \ +%endif + -DSSE3_FOUND=FALSE \ + -DSSSE3_FOUND=FALSE \ + -DSSE4_1_FOUND=FALSE \ + -DSSE4_2_FOUND=FALSE \ + -DCMAKE_C_FLAGS_ALL="%{optflags}" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo +popd + +make -C build %{?_smp_mflags} +make -C build doc + +%install +make -C build install DESTDIR=%{buildroot} + +%check +make -C build test || (cat build/Testing/Temporary/LastTest.log && exit 1) + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%license COPYING +%doc README.md +%{_libdir}/*.so.* + +%files devel +%{_libdir}/pkgconfig +%{_libdir}/*.so +%{_libdir}/cmake +%{_includedir}/ignition + +%files doc +%license COPYING +%doc build/doxygen/html + +%changelog +* Tue Oct 20 2015 Rich Mattes - 2.2.3-1 +- Update to release 2.2.3 + +* Thu Aug 20 2015 Rich Mattes - 2.2.2-1 +- Update to release 2.2.2 + +* Fri May 22 2015 Rich Mattes - 1.0.0-1 +- Initial release (rhbz#1224390) diff --git a/sources b/sources index e69de29..6793f7c 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +0c37ecb16aac0951da6620ae9a14479d ignition-math2-2.2.3.tar.bz2