Build error in compressed_col_sparse_matrix_utils_test

461 views
Skip to first unread message

Taylor Braun-Jones

unread,
Mar 11, 2015, 8:58:28 AM3/11/15
to ceres-...@googlegroups.com
Hi group,

I'm working on getting ceres-solver into Fedora/RHEL[1] and have a question about one build error that I get in the latest release v1.10.0:

[ 68%] Building CXX object internal/ceres/CMakeFiles/compressed_col_sparse_matrix_utils_test.dir/compressed_col_sparse_matrix_utils_test.cc.o
cd /home/de066732/git/yum-oecnav/ceres-solver/rpmbuild/ceres-solver-1.10.0/build/internal/ceres && /usr/lib64/ccache/c++   -DCERES_BUILDING_SHARED_LIBRARY -DCERES_GFLAGS_NAMESPACE=gflags -DEIGEN_MPL2_ONLY -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -fopenmp -Werror=all -Werror=extra -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -DNDEBUG  -I/home/de066732/git/yum-oecnav/ceres-solver/rpmbuild/ceres-solver-1.10.0/include -I/home/de066732/git/yum-oecnav/ceres-solver/rpmbuild/ceres-solver-1.10.0/internal -I/home/de066732/git/yum-oecnav/ceres-solver/rpmbuild/ceres-solver-1.10.0/internal/ceres -isystem /usr/include/eigen3 -I/usr/include/suitesparse -I/home/de066732/git/yum-oecnav/ceres-solver/rpmbuild/ceres-solver-1.10.0/build/config    -o CMakeFiles/compressed_col_sparse_matrix_utils_test.dir/compressed_col_sparse_matrix_utils_test.cc.o -c /home/de066732/git/yum-oecnav/ceres-solver/rpmbuild/ceres-solver-1.10.0/internal/ceres/compressed_col_sparse_matrix_utils_test.cc
Linking CXX executable ../../bin/compressed_col_sparse_matrix_utils_test
cd /home/de066732/git/yum-oecnav/ceres-solver/rpmbuild/ceres-solver-1.10.0/build/internal/ceres && /usr/bin/cmake -E cmake_link_script CMakeFiles/compressed_col_sparse_matrix_utils_test.dir/link.txt --verbose=1
/usr/lib64/ccache/c++   -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -fopenmp -Werror=all -Werror=extra -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -DNDEBUG    -Wl,-z,relro  CMakeFiles/compressed_col_sparse_matrix_utils_test.dir/compressed_col_sparse_matrix_utils_test.cc.o  -o ../../bin/compressed_col_sparse_matrix_utils_test -rdynamic ../../lib/libtest_util.so ../../lib/libceres.so.1.10.0 ../../lib/libgtest.so -lgflags -lglog -Wl,-rpath,/home/de066732/git/yum-oecnav/ceres-solver/rpmbuild/ceres-solver-1.10.0/build/lib 
/usr/bin/ld: CMakeFiles/compressed_col_sparse_matrix_utils_test.dir/compressed_col_sparse_matrix_utils_test.cc.o: undefined reference to symbol 'cholmod_free_sparse'
/usr/bin/ld: note: 'cholmod_free_sparse' is defined in DSO /lib64/libcholmod.so.2 so try adding it to the linker command line
/lib64/libcholmod.so.2: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[3]: *** [bin/compressed_col_sparse_matrix_utils_test] Error 1

This is on CentOS 7 x86_64 (gcc 4.8.2). Any ideas?

Thanks,
Taylor

Alex Stewart

unread,
Mar 11, 2015, 9:39:20 AM3/11/15
to ceres-...@googlegroups.com
Taylor,

The problem is that your SuiteSparse library is compiled as a shared library, and SuiteSparse is a private dependency of Ceres, but compressed_col_sparse_matrix_utils_test uses it directly.  This was fixed post the 1.10 release in the following commit:

Add SuiteSparse link dependency for compressed_col_sparse_matrix_utils_test - 378b5752177427f5b8a2807422ba77c50a164f93

It is a very simple non-invasive change, so you could easily patch the 1.10 release with it.

-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/CAKfKJYsLpcHvoxTaPUG43txwt5DNWGth8iadZJH%3DtU7Dngj-CQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Taylor Braun-Jones

unread,
Mar 11, 2015, 9:54:33 AM3/11/15
to ceres-...@googlegroups.com
Excellent. Thanks!

zheng rong

unread,
Aug 10, 2015, 7:20:50 PM8/10/15
to Ceres Solver
Hi Taylor and Lex,

I encountered similar error like this:


/usr/bin/ld: CMakeFiles/compressed_col_sparse_matrix_utils_test.dir/compressed_col_sparse_matrix_utils_test.cc.o: undefined reference to symbol 'cholmod_free_sparse'
//usr/lib/x86_64-linux-gnu/libcholmod.so.2.1.2: error adding symbols: DSO missing from command line

collect2: error: ld returned 1 exit status
make[2]: *** [bin/compressed_col_sparse_matrix_utils_test] Error 1
make[1]: *** [internal/ceres/CMakeFiles/compressed_col_sparse_matrix_utils_test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Is this caused by the same reason as mentioned above?

I can't understand the solution
 "Add SuiteSparse link dependency for compressed_col_sparse_matrix_utils_test - 378b5752177427f5b8a2807422ba77c50a164f93" very clearly, Could you please give more details?

This is on Ubuntu-14.04 x86-64.

Thanks,
Zheng



在 2015年3月11日星期三 UTC-4上午8:58:28,Taylor Braun-Jones写道:

zheng rong

unread,
Aug 10, 2015, 10:56:52 PM8/10/15
to Ceres Solver
Got it. I gited clone the latest version of Ceres, and everything works well.
Thanks all!

Zheng
Reply all
Reply to author
Forward
0 new messages