diff --git a/.gitignore b/.gitignore index e69de29..6ffeb3d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/ceres-solver-*.tar.gz diff --git a/0001-Add-SuiteSparse-link-dependency-for-compressed_col_s.patch b/0001-Add-SuiteSparse-link-dependency-for-compressed_col_s.patch new file mode 100644 index 0000000..3212e52 --- /dev/null +++ b/0001-Add-SuiteSparse-link-dependency-for-compressed_col_s.patch @@ -0,0 +1,30 @@ +From 378b5752177427f5b8a2807422ba77c50a164f93 Mon Sep 17 00:00:00 2001 +From: Alex Stewart +Date: Wed, 14 Jan 2015 21:03:18 +0000 +Subject: [PATCH] Add SuiteSparse link dependency for + compressed_col_sparse_matrix_utils_test. + +- Reported by stonier@yujinrobot.com as Issue 153: + https://code.google.com/p/ceres-solver/issues/detail?id=153 + +Change-Id: I3f0e67291adf129a6e7857ccc5f4e7e355feceb8 +--- + internal/ceres/CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt +index f9bb9d0..7c1ed5b 100644 +--- a/internal/ceres/CMakeLists.txt ++++ b/internal/ceres/CMakeLists.txt +@@ -291,6 +291,8 @@ IF (BUILD_TESTING AND GFLAGS) + # independent of SuiteSparse. + IF (SUITESPARSE AND SUITESPARSE_FOUND) + CERES_TEST(compressed_col_sparse_matrix_utils) ++ TARGET_LINK_LIBRARIES(compressed_col_sparse_matrix_utils_test ++ ${SUITESPARSE_LIBRARIES}) + ENDIF (SUITESPARSE AND SUITESPARSE_FOUND) + + CERES_TEST(symmetric_linear_solver) +-- +1.8.3.1 + diff --git a/ceres-solver.spec b/ceres-solver.spec new file mode 100644 index 0000000..ae2cfdc --- /dev/null +++ b/ceres-solver.spec @@ -0,0 +1,175 @@ +Name: ceres-solver +Version: 1.10.0 +# Release candidate versions are messy. Give them a release of +# e.g. "0.1.0%{?dist}" for RC1 (and remember to adjust the Source0 +# URL). Non-RC releases go back to incrementing integers starting at 1. +Release: 3%{?dist} +Summary: A non-linear least squares minimizer + +Group: Development/Libraries +License: BSD + +URL: http://ceres-solver.org/ +Source0: http://%{name}.org/%{name}-%{version}.tar.gz + +# Cherry-pick upstream fix for linker error. +# https://groups.google.com/d/msg/ceres-solver/58m1efsZZCc/OS8sYjbkEm4J +Patch1: 0001-Add-SuiteSparse-link-dependency-for-compressed_col_s.patch + +%if (0%{?rhel} == 06) +BuildRequires: cmake28 >= 2.8.0 +%else +BuildRequires: cmake >= 2.8.0 +%endif + +# Need -static package per guidelines for handling dependencies on header-only +# libraries. +# http://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries +BuildRequires: eigen3-static >= 3.2.1 + +# suitesparse < 3.4.0-9 ships without *.hpp C++ headers +# https://bugzilla.redhat.com/show_bug.cgi?id=1001869 +BuildRequires: suitesparse-devel >= 3.4.0-9 + +# If the suitesparse package was built with TBB then we need TBB too +%ifnarch s390 s390x +BuildRequires: tbb-devel +%endif + +# Use atlas for BLAS and LAPACK +BuildRequires: atlas-devel +BuildRequires: gflags-devel +# Build against miniglog on RHEL6 until glog package is added to EPEL6 +%if (0%{?rhel} != 06) +BuildRequires: glog-devel >= 0.3.1 +%endif + +%description + +Ceres Solver is an open source C++ library for modeling and solving +large, complicated optimization problems. It is a feature rich, mature +and performant library which has been used in production at Google +since 2010. Notable use of Ceres Solver is for the image alignment in +Google Maps and for vehicle pose in Google Street View. Ceres Solver +can solve two kinds of problems. + + 1. Non-linear Least Squares problems with bounds constraints. + 2. General unconstrained optimization problems. + +Features include: + + - A friendly API: build your objective function one term at a time + - Automatic and numeric differentiation + - Robust loss functions + - Local parameterizations + - Threaded Jacobian evaluators and linear solvers + - Trust region solvers with non-monotonic steps (Levenberg-Marquardt and + Dogleg (Powell & Subspace)) + - Line search solvers (L-BFGS and Nonlinear CG) + - Dense QR and Cholesky factorization (using Eigen) for small problems + - Sparse Cholesky factorization (using SuiteSparse) for large sparse problems + - Specialized solvers for bundle adjustment problems in computer vision + - Iterative linear solvers for general sparse and bundle adjustment problems + - Runs on Linux, Windows, Mac OS X, Android, and iOS + + +%package devel +Summary: A non-linear least squares minimizer +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%prep +%setup -q +%patch1 -p1 + +%build +mkdir build +pushd build + +%if (0%{?rhel} == 06) +%{cmake28} .. -DMINIGLOG:BOOL=ON \ +%else +%{cmake} .. \ +%endif + -DCXSPARSE_INCLUDE_DIR:PATH=%{_includedir}/suitesparse \ + -DBLAS_LIBRARIES:PATH=%{_libdir}/atlas/libsatlas.so +make %{?_smp_mflags} + + +%install +make -C build install DESTDIR=$RPM_BUILD_ROOT + + +%check +CTEST_OUTPUT_ON_FAILURE=1 make -C build test + + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + + +%files +%if (0%{?rhel} == 06) +%doc README LICENSE +%else +%doc README +%license LICENSE +%endif +%{_libdir}/*.so.* + +%files devel +%{_includedir}/* +%{_libdir}/*.so +%dir %{_datadir}/Ceres +%{_datadir}/Ceres/*.cmake + + +%changelog +* Thu Mar 12 2015 Taylor Braun-Jones - 1.10.0-3 +- Incorporate package review suggestions from Alex Stewart, Christopher Meng, + and Rich Mattes. + +* Wed Mar 11 2015 Taylor Braun-Jones - 1.10.0-2 +- Address comments from Rich Mattes' package review. + +* Mon Jan 12 2015 Taylor Braun-Jones - 1.10.0-1 +- Bump version and merge .spec updates from latest upstream release. + +* Wed Nov 13 2013 Taylor Braun-Jones - 1.8.0-1 +- New upstream release. + +* Mon Nov 04 2013 Taylor Braun-Jones - 1.8.0-0.1.0 +- New upstream release candidate. + +* Wed Sep 04 2013 Taylor Braun-Jones - 1.7.0-1 +- Bump version + +* Thu Aug 29 2013 Taylor Braun-Jones - 1.7.0-0.3.0 +- Bump version + +* Mon Aug 26 2013 Sameer Agarwal - 1.7.0-0.2.0 +- Bump version + +* Thu Jul 18 2013 Sameer Agarwal - 1.7.0-0.1.0 +- Bump version + +* Mon Apr 29 2013 Sameer Agarwal - 1.6.0-1 +- Bump version + +* Mon Apr 29 2013 Sameer Agarwal - 1.6.0-0.2.0 +- Bump version + +* Mon Apr 29 2013 Sameer Agarwal - 1.6.0-0.1.0 +- Bump version + +* Sun Feb 24 2013 Taylor Braun-Jones - 1.5.0-0.1.0 +- Bump version. + +* Sun Oct 14 2012 Taylor Braun-Jones - 1.4.0-0 +- Initial creation diff --git a/sources b/sources index e69de29..a7510ac 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +dbf9f452bd46e052925b835efea9ab16 ceres-solver-1.10.0.tar.gz