Building Ceres-1.9 in CentOS

411 views
Skip to first unread message

Narayanan Ramanathan

unread,
Aug 8, 2014, 3:36:34 PM8/8/14
to ceres-...@googlegroups.com
Hi,

I am trying to build Ceres-1.9 in CentOS 6.4. I installed suitesparse using [sudo yum install suitesparse-devel.x86_64]. While building Ceres-1.9 in CentOS, I noted that SuiteSparse was not found. How can I resolve this ?

Thank you
Narayanan

Alex Stewart

unread,
Aug 8, 2014, 3:46:57 PM8/8/14
to ceres-...@googlegroups.com
Narayanan,

What is the output of

cmake -DSUITESPARSE=ON .

Executed in your build directory?  There should be a line that begins: "Failed to find SuiteSparse - … " what is the reason given?  There should also be a later line of the form: "Failed to find some/all required components of SuiteSparse. … ", which lists the missing components.

There was a known bug in SuiteSparse from Red Hat fixed here, are you using a previous (broken) version?



-Alex

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/ff17fbfd-34a6-4637-a5fb-87e26265c80a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Narayanan Ramanathan

unread,
Aug 8, 2014, 3:58:27 PM8/8/14
to ceres-...@googlegroups.com
Hi Alex,

Here is what I got at the cmake step:
-- .................
-- Found CHOLMOD header in: /usr/include/suitesparse
-- Found SuiteSparseQR library: /usr/lib64/libspqr.so
-- Failed to find SuiteSparse - Did not find SUITESPARSEQR header (required SuiteSparse component).
-- Found UFconfig header in: /usr/include/suitesparse
-- Did not find METIS library (optional SuiteSparse dependency)
-- Failed to find some/all required components of SuiteSparse. (missing:  SUITESPARSEQR_FOUND) 
-- Did not find all SuiteSparse dependencies, disabling SuiteSparse support.
-- Building without CXSparse.
-- Found Google Flags header in: /usr/local/include
-- Found Google Log header in: /usr/local/include
-- Building with OpenMP.
-- Found tr1/unordered_map/set in std::tr1 namespace.
-- Found shared_ptr in std::tr1 namespace using <tr1/memory> header.
-- Building Ceres as a static library.
-- Enabling CERES_NO_SUITESPARSE in Ceres config.h
-- Enabling CERES_NO_CXSPARSE in Ceres config.h
-- ................

I will go through the two links you had provided. 
Thanks
Narayanan


--
You received this message because you are subscribed to a topic in the Google Groups "Ceres Solver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ceres-solver/AAjbES166yc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/09451EA1-FAF8-469D-B7CE-B7F3BF8EE240%40gmail.com.

Narayanan Ramanathan

unread,
Aug 8, 2014, 5:42:37 PM8/8/14
to ceres-...@googlegroups.com
Alex,

Issue resolved ! Thanks. I downloaded and installed suitesparse-3.4.0-9.el6.src.rpm and suitesparse-devel-3.4.0-9.el6.x86_64.rpm. Now Ceres could find SuiteSparse. Yum by default installs the broken version (suitesparse-devel-3.4.0-8.el6.src.rpm). 

Narayanan


On Fri, Aug 8, 2014 at 3:46 PM, Alex Stewart <alex...@gmail.com> wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "Ceres Solver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ceres-solver/AAjbES166yc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/09451EA1-FAF8-469D-B7CE-B7F3BF8EE240%40gmail.com.

Narayanan Ramanathan

unread,
Aug 11, 2014, 1:29:38 PM8/11/14
to ceres-...@googlegroups.com
Hello,

I could build CERES on CentOS using the patched suitesparse RPM (3.4.0.9). But I am running into issues while building Bundler, as illustrated below. Could anyone offer insight ?

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libspqr.so: undefined reference to `tbb::task_scheduler_init::terminate()'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libspqr.so: undefined reference to `typeinfo for tbb::task'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libspqr.so: undefined reference to `tbb::task::spawn_and_wait_for_all(tbb::task_list&)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libspqr.so: undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libspqr.so: undefined reference to `vtable for tbb::task'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libspqr.so: undefined reference to `tbb::task::note_affinity(unsigned short)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libspqr.so: undefined reference to `tbb::task_scheduler_init::initialize(int, unsigned long)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libspqr.so: undefined reference to `tbb::internal::allocate_root_proxy::allocate(unsigned long)'

I installed suitesparse from the following RPMs: suitesparse-3.4.0-9.el6.src.rpm and suitesparse-devel-3.4.0-9.el6.x86_64.rpm. When I did a cmake on ceres-solver-1.9, the output was :

-- Found Eigen version 3.0.6: /usr/include/eigen3
-- A library with BLAS API found.
-- Found LAPACK library: /usr/lib64/atlas/liblapack.so;/usr/lib64/atlas/libf77blas.so;/usr/lib64/atlas/libatlas.so
-- Found BLAS library: /usr/lib64/atlas/libf77blas.so;/usr/lib64/atlas/libatlas.so
-- A library with BLAS API found.
-- Found AMD library: /usr/lib64/libamd.so
-- Found AMD header in: /usr/include/suitesparse
-- Found CAMD library: /usr/lib64/libcamd.so
-- Found CAMD header in: /usr/include/suitesparse
-- Found COLAMD library: /usr/lib64/libcolamd.so
-- Found COLAMD header in: /usr/include/suitesparse
-- Found CCOLAMD library: /usr/lib64/libccolamd.so
-- Found CCOLAMD header in: /usr/include/suitesparse
-- Found CHOLMOD library: /usr/lib64/libcholmod.so
-- Found CHOLMOD header in: /usr/include/suitesparse
-- Found SuiteSparseQR library: /usr/lib64/libspqr.so
-- Found SuiteSparseQR header in: /usr/include/suitesparse
-- Found Intel Thread Building Blocks (TBB) library: /usr/lib64/libtbb.so, assuming SuiteSparseQR was compiled with TBB.
-- Found Intel Thread Building Blocks (TBB) Malloc library: /usr/lib64/libtbbmalloc.so
-- Found UFconfig header in: /usr/include/suitesparse
-- Did not find METIS library (optional SuiteSparse dependency)
-- Found SuiteSparse 3.4.0, building with SuiteSparse.
-- Building without CXSparse.
-- Found Google Flags header in: /usr/local/include
-- Found Google Log header in: /usr/local/include
-- Building with OpenMP.
-- Found tr1/unordered_map/set in std::tr1 namespace.
-- Found shared_ptr in std::tr1 namespace using <tr1/memory> header.
-- Building Ceres as a static library.
-- Enabling CERES_NO_CXSPARSE in Ceres config.h
-- Enabling CERES_USE_OPENMP in Ceres config.h
-- Enabling CERES_HAVE_PTHREAD in Ceres config.h
-- Enabling CERES_HAVE_RWLOCK in Ceres config.h
-- Enabling CERES_TR1_UNORDERED_MAP in Ceres config.h
-- Enabling CERES_TR1_MEMORY_HEADER in Ceres config.h
-- Enabling CERES_TR1_SHARED_PTR in Ceres config.h
-- Build the examples.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ovuser/Finder/software/ceres-bin_test



On Friday, August 8, 2014 5:42:37 PM UTC-4, Narayanan Ramanathan wrote:
Alex,

Issue resolved ! Thanks. I downloaded and installed suitesparse-3.4.0-9.el6.src.rpm and suitesparse-devel-3.4.0-9.el6.x86_64.rpm. Now Ceres could find SuiteSparse. Yum by default installs the broken version (suitesparse-devel-3.4.0-8.el6.src.rpm). 

Narayanan
On Fri, Aug 8, 2014 at 3:46 PM, Alex Stewart <alex...@gmail.com> wrote:
Narayanan,

What is the output of

cmake -DSUITESPARSE=ON .

Executed in your build directory?  There should be a line that begins: "Failed to find SuiteSparse - … " what is the reason given?  There should also be a later line of the form: "Failed to find some/all required components of SuiteSparse. … ", which lists the missing components.

There was a known bug in SuiteSparse from Red Hat fixed here, are you using a previous (broken) version?



-Alex

On Aug 8, 2014, at 8:36 PM, Narayanan Ramanathan <nrama...@objectvideo.com> wrote:

Hi,

I am trying to build Ceres-1.9 in CentOS 6.4. I installed suitesparse using [sudo yum install suitesparse-devel.x86_64]. While building Ceres-1.9 in CentOS, I noted that SuiteSparse was not found. How can I resolve this ?

Thank you
Narayanan

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Ceres Solver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ceres-solver/AAjbES166yc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ceres-solver+unsubscribe@googlegroups.com.

Alex Stewart

unread,
Aug 11, 2014, 2:09:25 PM8/11/14
to ceres-...@googlegroups.com
Narayanan,

The problem is in Bundler (if you're using the github version at least) it uses raw Makefiles not CMake and there is this line:

CERES_LIBS=-lceres -lcholmod -lccolamd -lcolamd -lamd -lcamd -lcxsparse \
-lsuitesparseconfig -lgomp -lglog -lpthread


This hardcodes which libraries Ceres needs, and on your OS SuiteSparse was built with TBB enabled, as shown in the Ceres CMake output here:

-- Found Intel Thread Building Blocks (TBB) library: /usr/lib64/libtbb.so, assuming SuiteSparseQR was compiled with TBB.
-- Found Intel Thread Building Blocks (TBB) Malloc library: /usr/lib64/libtbbmalloc.so

But TBB is not listed in CERES_LIBS in Bundler, hence the linker errors related to TBB things in SuiteSparse.

The full list of libraries that your build of Ceres requires should be listed in:

/usr/local/share/Ceres/CeresTargets-release.cmake  (Assuming you installed to /usr/local)

Otherwise it will be here: <Ceres build dir>/CMakeFiles/Export/share/Ceres/CeresTargets-release.cmake

There will be a line near the top that starts:

SET_TARGET_PROPERTIES(ceres PROPERTIES
  IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE …. )

Which should include all of the libraries that you need to link when linking against your build of Ceres.  Certainly this is all of the libraries that CMake will append to any target that calls:

find_package(Ceres)
target_link_libraries( <TARGET> ${CERES_LIBRARIES} )

I notice that you're building Ceres as a static library, is that intentional given that all your dependencies are shared?  You can enable the BUILD_SHARED_LIBS option in CMake to switch it.

-Alex

To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/3ddf8bd2-1484-4e7b-931e-2d44cd246ccf%40googlegroups.com.

Narayanan Ramanathan

unread,
Aug 11, 2014, 2:26:26 PM8/11/14
to ceres-...@googlegroups.com
Thanks Alex ! Adding -ltbb onto the list of CERES_LIBS took care of the build issues. 


To unsubscribe from this group and all its topics, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/7CD2D44F-247E-4635-8B8E-413179FB8B23%40gmail.com.
Reply all
Reply to author
Forward
0 new messages