From 263de47419167786c9ab6d93fa2f3e32e8e75fe1 Mon Sep 17 00:00:00 2001 From: Taylor Braun-Jones Date: Thu, 29 Aug 2013 10:33:29 -0400 Subject: [PATCH] Incorporate RHEL build fixes from Brian Pitts CMake build fixed so that versioned shared libraries are installed (along with .so symlinks) Change-Id: Ibbaea9d37d17754cb8c3cd36fc17d015ca7d2a57 --- CMakeLists.txt | 2 ++ internal/ceres/CMakeLists.txt | 4 ++++ scripts/ceres-solver.spec | 33 +++++++++++++++++++++------------ 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06031ece4..b89d55a38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,7 +113,9 @@ OPTION(BUILD_EXAMPLES "Build examples" ON) LIST(APPEND CMAKE_LIBRARY_PATH /opt/local/lib) LIST(APPEND CMAKE_LIBRARY_PATH /opt/local/lib/ufsparse) # Mac OS X LIST(APPEND CMAKE_LIBRARY_PATH /usr/lib) +LIST(APPEND CMAKE_LIBRARY_PATH /usr/lib/atlas) LIST(APPEND CMAKE_LIBRARY_PATH /usr/lib/suitesparse) # Ubuntu +LIST(APPEND CMAKE_LIBRARY_PATH /usr/lib64/atlas) LIST(APPEND CMAKE_LIBRARY_PATH /usr/local/homebrew/lib) # Mac OS X LIST(APPEND CMAKE_LIBRARY_PATH /usr/local/lib) LIST(APPEND CMAKE_LIBRARY_PATH /usr/local/lib/suitesparse) diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt index 7562f5c1b..610e8169b 100644 --- a/internal/ceres/CMakeLists.txt +++ b/internal/ceres/CMakeLists.txt @@ -193,6 +193,10 @@ SET(CERES_LIBRARY_SOURCE ${CERES_INTERNAL_SCHUR_FILES}) ADD_LIBRARY(ceres ${CERES_LIBRARY_SOURCE}) +SET_TARGET_PROPERTIES(ceres PROPERTIES + VERSION ${CERES_VERSION} + SOVERSION ${CERES_VERSION_MAJOR} +) TARGET_LINK_LIBRARIES(ceres ${CERES_LIBRARY_DEPENDENCIES}) INSTALL(TARGETS ceres diff --git a/scripts/ceres-solver.spec b/scripts/ceres-solver.spec index 8709b5142..b3b6f0f58 100644 --- a/scripts/ceres-solver.spec +++ b/scripts/ceres-solver.spec @@ -3,13 +3,13 @@ Version: 1.7.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: "0.3.0%{?dist}" +Release: 0.3.0%{?dist} Summary: A non-linear least squares minimizer Group: Development/Libraries License: BSD URL: http://code.google.com/p/ceres-solver/ -Source0: http://%{name}.googlecode.com/files/%{name}-%{version}rc2.tar.gz +Source0: http://%{name}.googlecode.com/files/%{name}-%{version}rc3.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if (0%{?rhel} == 06) @@ -18,7 +18,13 @@ BuildRequires: cmake28 BuildRequires: cmake %endif BuildRequires: eigen3-devel -BuildRequires: suitesparse-devel +# suitesparse <= 3.4.0-7 ships without *.hpp C++ headers +# https://bugzilla.redhat.com/show_bug.cgi?id=1001869 +BuildRequires: suitesparse-devel > 3.4.0-7 +# If the suitesparse package was built with TBB then we need TBB too +%ifarch %{ix86} x86_64 ia64 +BuildRequires: tbb-devel +%endif # Use atlas for BLAS and LAPACK BuildRequires: atlas-devel BuildRequires: gflags-devel @@ -65,12 +71,10 @@ pushd build # packages because it breaks the build since release 1.5.0rc1 %define optflags "" %if (0%{?rhel} == 06) -%{cmake28} .. \ +%{cmake28} .. %else -%{cmake} .. \ +%{cmake} .. %endif - -DBLAS_LIB:FILEPATH=%{_libdir}/atlas/libatlas.so \ - -DLAPACK_LIB:FILEPATH=%{_libdir}/atlas/liblapack.so make %{?_smp_mflags} @@ -80,6 +84,9 @@ pushd build make install DESTDIR=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT -name '*.la' -delete +# Make the subdirectory in /usr/share match the name of this package +mv $RPM_BUILD_ROOT%{_datadir}/{Ceres,%{name}} + %clean rm -rf $RPM_BUILD_ROOT @@ -92,22 +99,24 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc +%doc README LICENSE %{_libdir}/*.so.* %files devel %defattr(-,root,root,-) -%doc %{_includedir}/* %{_libdir}/*.so -%{_libdir}/*.a +%{_datadir}/%{name}/*.cmake %changelog -* Mon August 26 2013 Sameer Agarwal - 1.7.0-3 +* Thu Aug 29 2013 Taylor Braun-Jones - 1.7.0-0.3.0 - Bump version -* Mon July 18 2013 Sameer Agarwal - 1.7.0-0 +* Mon Aug 26 2013 Sameer Agarwal - 1.7.0-0.2.0 +- Bump version + +* Mon Jul 18 2013 Sameer Agarwal - 1.7.0-0.1.0 - Bump version * Mon Apr 29 2013 Sameer Agarwal - 1.6.0-1