[mrpt] Removed bundled csparse, lib3ds

rmattes rmattes at fedoraproject.org
Wed Aug 29 01:38:41 UTC 2012


commit 39ff1d6c833ef195dd09850a3e1e91846341b47e
Author: Rich Mattes <richmattes at gmail.com>
Date:   Tue Aug 28 21:36:41 2012 -0400

    Removed bundled csparse, lib3ds
    
    Modified the buildsystem to remove dependency on bundled lib3ds and
    csparse cs.h.  Also removed an un-needed patch.

 mrpt-0.9.5.gcc47.patch   |   62 ----------------------------------------------
 mrpt-0.9.6-csparse.patch |   24 +++++++++++++++++
 mrpt-0.9.6-pcl16.patch   |   60 ++++++++++++++++++++++++++++++++++++++++---
 mrpt.spec                |   12 ++++++--
 4 files changed, 88 insertions(+), 70 deletions(-)
---
diff --git a/mrpt-0.9.6-csparse.patch b/mrpt-0.9.6-csparse.patch
new file mode 100644
index 0000000..9f5fc59
--- /dev/null
+++ b/mrpt-0.9.6-csparse.patch
@@ -0,0 +1,24 @@
+diff -up ./mrpt-0.9.6/libs/base/include/mrpt/math/CSparseMatrix.h.csparse ./mrpt-0.9.6/libs/base/include/mrpt/math/CSparseMatrix.h
+--- ./mrpt-0.9.6/libs/base/include/mrpt/math/CSparseMatrix.h.csparse	2012-01-07 13:47:43.000000000 -0500
++++ ./mrpt-0.9.6/libs/base/include/mrpt/math/CSparseMatrix.h	2012-08-28 21:15:46.083073849 -0400
+@@ -42,7 +42,7 @@
+ //  embedded lib or a system lib, use the embedded headers. The reason: not to
+ //  force MRPT users to install CSparse headers.
+ extern "C"{
+-#include <mrpt/otherlibs/CSparse/cs.h>
++#include <suitesparse/cs.h>
+ }
+ 
+ namespace mrpt
+diff -up ./mrpt-0.9.6/libs/base/src/math/CSparseMatrix.cpp.csparse ./mrpt-0.9.6/libs/base/src/math/CSparseMatrix.cpp
+--- ./mrpt-0.9.6/libs/base/src/math/CSparseMatrix.cpp.csparse	2012-08-28 21:15:47.619134294 -0400
++++ ./mrpt-0.9.6/libs/base/src/math/CSparseMatrix.cpp	2012-08-28 21:16:02.303702240 -0400
+@@ -36,7 +36,7 @@
+ //#	include <cs.h>
+ //#else
+ extern "C"{
+-#include <mrpt/otherlibs/CSparse/cs.h>
++#include <suitesparse/cs.h>
+ }
+ //#endif
+ 
diff --git a/mrpt-0.9.6-pcl16.patch b/mrpt-0.9.6-pcl16.patch
index f1eb8ad..425e76b 100644
--- a/mrpt-0.9.6-pcl16.patch
+++ b/mrpt-0.9.6-pcl16.patch
@@ -1,6 +1,6 @@
 diff -up ./mrpt-0.9.6/CMakeLists.txt.pcl16 ./mrpt-0.9.6/CMakeLists.txt
 --- ./mrpt-0.9.6/CMakeLists.txt.pcl16	2012-05-29 18:24:03.000000000 -0400
-+++ ./mrpt-0.9.6/CMakeLists.txt	2012-08-26 17:25:07.835082222 -0400
++++ ./mrpt-0.9.6/CMakeLists.txt	2012-08-28 20:50:21.203147585 -0400
 @@ -464,7 +464,7 @@ if (MRPT_HAS_TBB)
                      set(TBB_LIB_DIR "${_TBB_LIB_PATH}" CACHE PATH "Full path of TBB library directory")
                      link_directories("${TBB_LIB_DIR}")
@@ -30,7 +30,38 @@ diff -up ./mrpt-0.9.6/CMakeLists.txt.pcl16 ./mrpt-0.9.6/CMakeLists.txt
  	ELSE(UNIX)
  		SET(CMAKE_MRPT_HAS_PHIDGET 0)
  		MESSAGE("The MRPT Phidget library interface is only supported on linux, please turn off MRPT_HAS_PHIDGET")
-@@ -1735,7 +1736,7 @@ ENDIF(CMAKE_MRPT_HAS_BUMBLEBEE)
+@@ -912,6 +913,21 @@ ENDIF(MRPT_HAS_FFMPEG_WIN32)
+ # Check for system lib3ds:
+ # ===================================================
+ SET(CMAKE_MRPT_HAS_LIB3DS 1)	# Always present: system or built-in
++SET(CMAKE_MRPT_HAS_LIB3DS_SYSTEM 0)
++
++IF(PKG_CONFIG_FOUND)
++        PKG_CHECK_MODULES(LIB3DS lib3ds)
++	if (LIB3DS_FOUND)
++		SET(CMAKE_MRPT_HAS_LIB3DS_SYSTEM 1)
++		INCLUDE_DIRECTORIES("${LIB3DS_INCLUDEDIR}")
++                SET(MRPT_LIB3DS_LIBS_TO_LINK "${MRPT_LIB3DS_LIBS_TO_LINK}" "${LIB3DS_LIBRARIES}")
++
++                IF($ENV{VERBOSE})
++                        MESSAGE(STATUS " lib3ds libs: ${MRPT_LIB3DS_LIBS_TO_LINK}")
++                ENDIF($ENV{VERBOSE})
++
++        ENDIF(LIB3DS_FOUND)
++ENDIF(PKG_CONFIG_FOUND)
+ 
+ # Check for system zlib:
+ # ===================================================
+@@ -1508,7 +1524,7 @@ ENDIF(CSPARSE_FOUND)
+ 
+ # Save the basic list of libraries (without MRPT-libs):
+ # -------------------------------------------------------------------------------------
+-SET(MRPTLIB_LINKER_LIBS ${MRPT_LINKER_LIBS} ${MRPT_FFMPEG_LIBS_TO_LINK})
++SET(MRPTLIB_LINKER_LIBS ${MRPT_LINKER_LIBS} ${MRPT_FFMPEG_LIBS_TO_LINK} ${MRPT_LIB3DS_LIBS_TO_LINK} )
+ IF($ENV{VERBOSE})
+ 	MESSAGE(STATUS "MRPTLIB_LINKER_LIBS: ${MRPTLIB_LINKER_LIBS}")
+ ENDIF($ENV{VERBOSE})
+@@ -1735,7 +1751,7 @@ ENDIF(CMAKE_MRPT_HAS_BUMBLEBEE)
  
  IF(CMAKE_MRPT_HAS_PHIDGET)
  	INCLUDE_DIRECTORIES("${PHIDGET_ROOT_DIR}/include/")
@@ -39,7 +70,7 @@ diff -up ./mrpt-0.9.6/CMakeLists.txt.pcl16 ./mrpt-0.9.6/CMakeLists.txt
  ENDIF(CMAKE_MRPT_HAS_PHIDGET)
  
  IF(CMAKE_MRPT_HAS_SVS)
-@@ -1897,7 +1898,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
+@@ -1897,7 +1913,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
  
  	# Parallel stdlibc++?
  	IF(MRPT_ENABLE_LIBSTD_PARALLEL_MODE)
@@ -50,7 +81,7 @@ diff -up ./mrpt-0.9.6/CMakeLists.txt.pcl16 ./mrpt-0.9.6/CMakeLists.txt
  	IF(CMAKE_BUILD_TYPE MATCHES "Debug")
 diff -up ./mrpt-0.9.6/libs/maps/include/mrpt/maps.h.pcl16 ./mrpt-0.9.6/libs/maps/include/mrpt/maps.h
 --- ./mrpt-0.9.6/libs/maps/include/mrpt/maps.h.pcl16	2012-01-07 13:47:43.000000000 -0500
-+++ ./mrpt-0.9.6/libs/maps/include/mrpt/maps.h	2012-08-26 17:22:18.441643130 -0400
++++ ./mrpt-0.9.6/libs/maps/include/mrpt/maps.h	2012-08-28 20:16:15.587309916 -0400
 @@ -30,7 +30,7 @@
  #define _mrpt_maps_H
  
@@ -62,7 +93,7 @@ diff -up ./mrpt-0.9.6/libs/maps/include/mrpt/maps.h.pcl16 ./mrpt-0.9.6/libs/maps
  #if !defined(mrpt_maps_EXPORTS) || MRPT_ENABLE_PRECOMPILED_HDRS || defined(MRPT_ALWAYS_INCLUDE_ALL_HEADERS)
 diff -up ./mrpt-0.9.6/libs/maps/src/maps/CBeaconMap.cpp.pcl16 ./mrpt-0.9.6/libs/maps/src/maps/CBeaconMap.cpp
 --- ./mrpt-0.9.6/libs/maps/src/maps/CBeaconMap.cpp.pcl16	2012-01-07 13:47:43.000000000 -0500
-+++ ./mrpt-0.9.6/libs/maps/src/maps/CBeaconMap.cpp	2012-08-26 17:22:18.442643167 -0400
++++ ./mrpt-0.9.6/libs/maps/src/maps/CBeaconMap.cpp	2012-08-28 20:16:15.587309916 -0400
 @@ -27,7 +27,7 @@
     +---------------------------------------------------------------------------+ */
  
@@ -72,3 +103,22 @@ diff -up ./mrpt-0.9.6/libs/maps/src/maps/CBeaconMap.cpp.pcl16 ./mrpt-0.9.6/libs/
  
  
  #include <mrpt/slam/CBeaconMap.h>
+diff -up ./mrpt-0.9.6/libs/opengl/CMakeLists.txt.pcl16 ./mrpt-0.9.6/libs/opengl/CMakeLists.txt
+--- ./mrpt-0.9.6/libs/opengl/CMakeLists.txt.pcl16	2012-08-28 20:46:55.333172554 -0400
++++ ./mrpt-0.9.6/libs/opengl/CMakeLists.txt	2012-08-28 20:47:26.846385133 -0400
+@@ -16,9 +16,12 @@ ENDIF(CMAKE_MRPT_HAS_OPENGL_GLUT AND NOT
+ # Embedded version of lib3ds: We have it embedded because the API
+ #  changes between versions and it'd be a mess between Lin/Win builds...
+ #  even worse since lib3ds does NOT have any VERSION #define...
+-LIST(APPEND opengl_EXTRA_SRCS		"${MRPT_LIBS_ROOT}/opengl/src/lib3ds/*.c" "${MRPT_LIBS_ROOT}/opengl/src/lib3ds/*.h")
+-LIST(APPEND opengl_EXTRA_SRCS_NAME 	"lib3ds" "lib3ds")
+-INCLUDE_DIRECTORIES("${MRPT_SOURCE_DIR}/libs/opengl/src/")
++IF(CMAKE_MRPT_HAS_LIB3DS AND NOT CMAKE_MRPT_HAS_LIB3DS_SYSTEM)
++	LIST(APPEND opengl_EXTRA_SRCS		"${MRPT_LIBS_ROOT}/opengl/src/lib3ds/*.c" "${MRPT_LIBS_ROOT}/opengl/src/lib3ds/*.h")
++	LIST(APPEND opengl_EXTRA_SRCS_NAME 	"lib3ds" "lib3ds")
++	INCLUDE_DIRECTORIES("${MRPT_SOURCE_DIR}/libs/opengl/src/")
++ENDIF(CMAKE_MRPT_HAS_LIB3DS AND NOT CMAKE_MRPT_HAS_LIB3DS_SYSTEM)
++
+ 
+ # Embedded version of Glew:
+ IF(WIN32)
diff --git a/mrpt.spec b/mrpt.spec
index 4392138..f53c612 100644
--- a/mrpt.spec
+++ b/mrpt.spec
@@ -23,7 +23,7 @@ URL: http://www.mrpt.org/
 Source0: %{name}-%{version}-fedora.tar.bz2
 Source1: create_tarball_%{name}.sh
 #Fixes build issues related to gcc 4.7
-Patch0: mrpt-0.9.5.gcc47.patch
+Patch0: mrpt-0.9.6-csparse.patch
 #Fix for gzip api change (gzFile changed from a typedef to a struct)
 Patch1: mrpt-0.9.5.gzip.patch
 # Patch to add missing inclusion guards to a header
@@ -251,6 +251,7 @@ Summary: Mobile Robot Programming Toolkit - Development package
 Group: Development/Libraries
 Requires: %{name}-libs = %{version}-%{release}
 Requires: pkgconfig
+Requires: suitesparse-devel
 %description devel
 The Mobile Robot Programming Toolkit (MRPT) is an extensive, cross-platform,
 and open source C++ library aimed to help robotics researchers to design and
@@ -276,16 +277,20 @@ with Doxygen.
 
 %prep
 %setup -q
-#%patch0 -p2 -b .gcc47
+%patch0 -p2 -b .csparse
 %patch1 -p2 -b .gzip
 %patch2 -p2 -b .eigen306
 %patch3 -p2 -b .pcl16
+
 # Fix encoding of the mrpt-book file
 #gzip -d doc/mrpt-book.ps.gz
 #iconv -f ISO8859-1 -t UTF-8 doc/mrpt-book.ps > mrpt-book.ps.conv
 #mv -f mrpt-book.ps.conv doc/mrpt-book.ps
 #gzip doc/mrpt-book.ps
-rm -rf libs/opengl/src/{freeglut-2.4.0,glew,glext}
+rm -rf libs/opengl/src/{freeglut-2.4.0,glew,glext,lib3ds}
+rm -rf libs/base/src/math/CSparse
+rm -rf libs/base/include/mrpt/otherlibs/CSparse
+rm -rf libs/base/src/utils/jpeglib
 
 %build
 # The flag CMAKE_MRPT_IS_RPM_PACKAGE disables global "-mtune=native"
@@ -300,6 +305,7 @@ cd build
   -DPHIDGET_ROOT_DIR=/usr \
   -DPHIDGET_LIB_DIR=%{_libdir} \
   -DMRPT_HAS_TBB=ON \
+  -DTBB_LIB_DIR=%{_libdir} \
   -DDISABLE_SSE3=ON \
 %ifnarch x86_64
   -DDISABLE_SSE2=ON \


More information about the scm-commits mailing list