Closed Gyudori closed 3 years ago
I solved the problem with my edited CMakeLists.txt.
1. cmake_minimum_required(VERSION 2.8.3)
2. project(suitesparse)
3.
4. set(CMAKE_BUILD_TYPE Release)
5.
6. find_package(catkin_simple REQUIRED)
7. catkin_simple()
8.
9. include(ExternalProject)
10.
11. set(SUITESPARSE_INCLUDE_DEST ${CATKIN_DEVEL_PREFIX}/include/suitesparse)
12.
13. file(MAKE_DIRECTORY ${SUITESPARSE_INCLUDE_DEST})
14.
15. set(VERSION 4.2.1)
16.
17. ExternalProject_Add(suitesparse_src
18. DOWNLOAD_COMMAND bash -c "rm -f SuiteSparse-${VERSION}.tar.gz && wget --retry-connrefused --waitretry=1 --timeout=40 --tries 3 https://github.com/ethz-asl/thirdparty_library_binaries/raw/master/SuiteSparse-${VERSION}.tar.gz"
19. PATCH_COMMAND bash -c "tar -xzvf ../SuiteSparse-${VERSION}.tar.gz && rm -rf ../suitesparse_src-build/SuiteSparse && sed -i.bu \"s/\\/usr\\/local\\/lib/..\\/lib/g\" SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk && sed -i.bu \"s/\\/usr\\/local\\/include/..\\/include/g\" SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk && mv SuiteSparse ../suitesparse_src-build/"
20. CONFIGURE_COMMAND ""
21. BUILD_COMMAND bash -c "export CFLAGS=-DNTIMER && cd SuiteSparse && make library"
22. INSTALL_COMMAND bash -c "cd SuiteSparse && mkdir -p lib && mkdir -p include && make install && cd lib && cp libamd.2.3.1.a libcamd.2.3.1.a libcholmod.2.1.2.a libcxsparse.3.1.2.a libldl.2.1.0.a libspqr.1.3.1.a libumfpack.5.6.2.a libamd.a libcamd.a libcholmod.a libcxsparse.a libldl.a libspqr.a libumfpack.a libbtf.1.2.0.a libccolamd.2.8.0.a libcolamd.2.8.0.a libklu.1.2.1.a librbio.2.1.1.a libsuitesparseconfig.4.2.1.a libbtf.a libccolamd.a libcolamd.a libklu.a librbio.a libsuitesparseconfig.a ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_LIB_DESTINATION}/ && cd .. && cd include && cp amd.h cholmod_matrixops.h SuiteSparseQR_definitions.h umfpack_load_symbolic.h umfpack_save_symbolic.h btf.h cholmod_modify.h SuiteSparseQR.hpp umfpack_numeric.h umfpack_scale.h camd.h cholmod_partition.h umfpack_col_to_triplet.h umfpack_qsymbolic.h umfpack_solve.h ccolamd.h cholmod_supernodal.h umfpack_defaults.h umfpack_report_control.h umfpack_symbolic.h cholmod_blas.h cholmod_template.h umfpack_free_numeric.h umfpack_report_info.h umfpack_tictoc.h cholmod_camd.h colamd.h umfpack_free_symbolic.h umfpack_report_matrix.h umfpack_timer.h cholmod_check.h cs.h umfpack_get_determinant.h umfpack_report_numeric.h umfpack_transpose.h cholmod_cholesky.h klu.h umfpack_get_lunz.h umfpack_report_perm.h umfpack_triplet_to_col.h cholmod_complexity.h ldl.h umfpack_get_numeric.h umfpack_report_status.h umfpack_wsolve.h cholmod_config.h RBio.h umfpack_get_symbolic.h umfpack_report_symbolic.h cholmod_core.h spqr.hpp umfpack_global.h umfpack_report_triplet.h cholmod.h SuiteSparse_config.h umfpack.h umfpack_report_vector.h cholmod_io64.h SuiteSparseQR_C.h umfpack_load_numeric.h umfpack_save_numeric.h ${SUITESPARSE_INCLUDE_DEST}"
23. )
24.
25. install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/include/suitesparse
26. DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}
27. FILES_MATCHING PATTERN "*.h"
28. PATTERN "*.hpp")
29. install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/lib/
30. DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
31. FILES_MATCHING PATTERN "libamd*"
32. PATTERN "libbtf*"
33. PATTERN "libcamd*"
34. PATTERN "libcolamd*"
35. PATTERN "libccolamd*"
36. PATTERN "libcholmod*"
37. PATTERN "libcxsparse*"
38. PATTERN "libklu*"
39. PATTERN "libldl*"
40. PATTERN "librbio*"
41. PATTERN "libspqr*"
42. PATTERN "libsuitesparse*"
43. PATTERN "libsuitesparseconfig*"
44. PATTERN "libumfpack*"
45. )
46. cs_export(INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}/include/suitesparse
47. LIBRARIES
48. spqr
49. cholmod
50. ccolamd
51. amd
52. btf
53. camd
54. colamd
55. cxsparse
56. klu
57. ldl
58. rbio
59. suitesparseconfig
60. umfpack
61. lapack
62. blas
63. )
When I type this,
catkin build voxgraph
I got this error message:
rm: unrecognized option '--retry-connrefused'
And the CMakeLists.txt is like this:
I don't know why I got this error. The command of line 18 has separated commands using &&
So, after removing the
rm -f SuiteSparse-${VERSION}.tar.gz
and do againcatkin build voxgraph
then I got another error,tar: You may not specify more than one '-Acdtrux', '--delete' or '--test-label' option.
May be this is because of the 19th line of CMakeLists.txt
Is this CMakeLists.txt deprecated? Or I did something wrong?