Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed in using OpenMVG as a third party library dependency in Ubuntu 18.04 and in test #2000

Closed
MrIsland opened this issue Jan 4, 2022 · 4 comments

Comments

@MrIsland
Copy link

MrIsland commented Jan 4, 2022

I wanna use OpenMVG as a third party and I think I have read the Build.md and other issues carefully. Sorry to bother you.

These is some info when I complie my program.
../lib/libLibOptimization.so: undefined reference to openMVG::P_From_KRt(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&, Eigen::Matrix<double, 3, 3, 0, 3, 3> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 4, 0, 3, 4>)'
../lib/libLibOptimization.so: undefined reference to openMVG::Triangulate2View(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 3, 0, 3, 3> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, openMVG::ETriangulationMethod)' ../lib/libLibOptimization.so: undefined reference to openMVG::TriangulateNView(Eigen::Matrix<double, 3, -1, 0, 3, -1> const&, std::vector<Eigen::Matrix<double, 3, 4, 0, 3, 4>, std::allocator<Eigen::Matrix<double, 3, 4, 0, 3, 4> > > const&, Eigen::Matrix<double, 4, 1, 0, 4, 1>
)'
collect2: error: ld returned 1 exit status
CMakeFiles/testrun.dir/build.make:115: recipe for target '../app/testrun' failed
make[2]: *** [../app/testrun] Error 1
CMakeFiles/Makefile2:139: recipe for target 'CMakeFiles/testrun.dir/all' failed
make[1]: *** [CMakeFiles/testrun.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2`

And I use these options already in my cmake file.
find_package(OpenMVG REQUIRED) include_directories(${OPENMVG_INCLUDE_DIRS}) target_link_libraries(main ${OPENMVG_LIBRARIES})

What's more, I just want to test whether the installing was right, so I tried make test again. But ..
`Running tests...
Test project /data/zhinanyu/OpenMVG/openMVG/build
Start 1: openMVG_test_Camera_Pinhole
1/85 Test #1: openMVG_test_Camera_Pinhole ..............................***Failed 0.02 sec
Start 2: openMVG_test_Camera_Pinhole_Radial
2/85 Test #2: openMVG_test_Camera_Pinhole_Radial .......................***Failed 0.00 sec
Start 3: openMVG_test_Camera_Pinhole_Brown
3/85 Test #3: openMVG_test_Camera_Pinhole_Brown ........................***Failed 0.00 sec
Start 4: openMVG_test_Camera_Pinhole_Fisheye
4/85 Test #4: openMVG_test_Camera_Pinhole_Fisheye ......................***Failed 0.00 sec
Start 5: openMVG_test_Camera_Spherical
5/85 Test #5: openMVG_test_Camera_Spherical ............................ Passed 0.61 sec
Start 6: openMVG_test_Camera_Subset_Parametrization
6/85 Test #6: openMVG_test_Camera_Subset_Parametrization ............... Passed 0.02 sec
Start 7: openMVG_test_Camera_IO
7/85 Test #7: openMVG_test_Camera_IO ................................... Passed 0.01 sec
Start 8: openMVG_test_kmeans
8/85 Test #8: openMVG_test_kmeans ...................................... Passed 0.19 sec
Start 9: openMVG_test_exif_IO
9/85 Test #9: openMVG_test_exif_IO ..................................... Passed 0.06 sec
Start 10: openMVG_test_ParseDatabase
10/85 Test #10: openMVG_test_ParseDatabase ............................... Passed 0.12 sec
Start 11: openMVG_test_features
11/85 Test #11: openMVG_test_features .................................... Passed 0.01 sec
Start 12: openMVG_test_image_describer
12/85 Test #12: openMVG_test_image_describer ............................. Passed 0.05 sec
Start 13: openMVG_test_akaze
13/85 Test #13: openMVG_test_akaze ....................................... Passed 0.88 sec
Start 14: openMVG_test_mser
14/85 Test #14: openMVG_test_mser ........................................ Passed 0.21 sec
Start 15: openMVG_test_sift
15/85 Test #15: openMVG_test_sift ........................................ Passed 0.26 sec
Start 16: openMVG_test_tbmr
16/85 Test #16: openMVG_test_tbmr ........................................ Passed 0.07 sec
Start 17: openMVG_graph_test_connectedComponent
17/85 Test #17: openMVG_graph_test_connectedComponent .................... Passed 0.01 sec
Start 18: openMVG_graph_test_triplet_finder
18/85 Test #18: openMVG_graph_test_triplet_finder ........................ Passed 0.01 sec
Start 19: openMVG_test_color_gradient
19/85 Test #19: openMVG_test_color_gradient .............................. Passed 0.00 sec
Start 20: openMVG_test_image
20/85 Test #20: openMVG_test_image ....................................... Passed 0.00 sec
Start 21: openMVG_test_image_drawing
21/85 Test #21: openMVG_test_image_drawing ............................... Passed 0.00 sec
Start 22: openMVG_test_image_integral
22/85 Test #22: openMVG_test_image_integral .............................. Passed 0.00 sec
Start 23: openMVG_test_image_io
23/85 Test #23: openMVG_test_image_io .................................... Passed 0.03 sec
Start 24: openMVG_test_image_filtering
24/85 Test #24: openMVG_test_image_filtering ............................. Passed 0.05 sec
Start 25: openMVG_test_image_resampling
25/85 Test #25: openMVG_test_image_resampling ............................ Passed 3.70 sec
Start 26: openMVG_test_linearProgramming
26/85 Test #26: openMVG_test_linearProgramming ........................... Passed 0.01 sec
Start 27: openMVG_lInftyCV_test_triangulation
27/85 Test #27: openMVG_lInftyCV_test_triangulation ...................... Passed 0.08 sec
Start 28: openMVG_lInftyCV_test_resection
28/85 Test #28: openMVG_lInftyCV_test_resection .......................... Passed 0.02 sec
Start 29: openMVG_lInftyCV_test_resection_robust
29/85 Test #29: openMVG_lInftyCV_test_resection_robust ................... Passed 2.50 sec
Start 30: openMVG_lInftyCV_test_global_translations_fromTriplets
30/85 Test #30: openMVG_lInftyCV_test_global_translations_fromTriplets ... Passed 0.02 sec
Start 31: openMVG_lInftyCV_test_global_translations_fromTij
31/85 Test #31: openMVG_lInftyCV_test_global_translations_fromTij ........ Passed 0.02 sec
Start 32: openMVG_lInftyCV_test_tijsAndXis
32/85 Test #32: openMVG_lInftyCV_test_tijsAndXis ......................... Passed 0.06 sec
Start 33: openMVG_lInftyCV_test_tijsAndXis_outlier
33/85 Test #33: openMVG_lInftyCV_test_tijsAndXis_outlier ................. Passed 0.08 sec
Start 34: openMVG_geodesy_test_geodesy
34/85 Test #34: openMVG_geodesy_test_geodesy ............................. Passed 0.02 sec
Start 35: openMVG_test_convex_hull
35/85 Test #35: openMVG_test_convex_hull ................................. Passed 0.01 sec
Start 36: openMVG_test_rigid_transformation3D_srt
36/85 Test #36: openMVG_test_rigid_transformation3D_srt .................. Passed 0.02 sec
Start 37: openMVG_test_plane_estimation_kernel
37/85 Test #37: openMVG_test_plane_estimation_kernel ..................... Passed 0.01 sec
Start 38: openMVG_test_half_space_intersection
38/85 Test #38: openMVG_test_half_space_intersection ..................... Passed 0.00 sec
Start 39: openMVG_test_frustum_intersection
39/85 Test #39: openMVG_test_frustum_intersection ........................ Passed 0.03 sec
Start 40: openMVG_test_frustum_box_intersection
40/85 Test #40: openMVG_test_frustum_box_intersection .................... Passed 0.02 sec
Start 41: openMVG_test_matching
41/85 Test #41: openMVG_test_matching .................................... Passed 0.02 sec
Start 42: openMVG_test_matching_filters
42/85 Test #42: openMVG_test_matching_filters ............................ Passed 0.00 sec
Start 43: openMVG_test_indMatch
43/85 Test #43: openMVG_test_indMatch .................................... Passed 0.00 sec
Start 44: openMVG_test_metric
44/85 Test #44: openMVG_test_metric ...................................... Passed 0.00 sec
Start 45: openMVG_test_Pair_Builder
45/85 Test #45: openMVG_test_Pair_Builder ................................ Passed 0.00 sec
Start 46: openMVG_test_triangulation
46/85 Test #46: openMVG_test_triangulation ............................... Passed 0.01 sec
Start 47: openMVG_test_triangulation_nview
47/85 Test #47: openMVG_test_triangulation_nview ......................... Passed 0.00 sec
Start 48: openMVG_test_solver_affine
48/85 Test #48: openMVG_test_solver_affine ............................... Passed 0.00 sec
Start 49: openMVG_test_solver_essential
49/85 Test #49: openMVG_test_solver_essential ............................ Passed 0.01 sec
Start 50: openMVG_test_solver_essential_five_point
50/85 Test #50: openMVG_test_solver_essential_five_point ................. Passed 0.01 sec
Start 51: openMVG_test_solver_essential_three_point
51/85 Test #51: openMVG_test_solver_essential_three_point ................ Passed 0.00 sec
Start 52: openMVG_test_solver_fundamental_kernel
52/85 Test #52: openMVG_test_solver_fundamental_kernel ................... Passed 0.00 sec
Start 53: openMVG_test_solver_homography_kernel
53/85 Test #53: openMVG_test_solver_homography_kernel .................... Passed 0.01 sec
Start 54: openMVG_test_solver_resection_kernel
54/85 Test #54: openMVG_test_solver_resection_kernel ..................... Passed 0.01 sec
Start 55: openMVG_test_solver_translation_knownRotation_kernel
55/85 Test #55: openMVG_test_solver_translation_knownRotation_kernel ..... Passed 0.01 sec
Start 56: openMVG_test_rotation_averaging
56/85 Test #56: openMVG_test_rotation_averaging .......................... Passed 0.01 sec
Start 57: openMVG_test_translation_averaging
57/85 Test #57: openMVG_test_translation_averaging ....................... Passed 0.05 sec
Start 58: openMVG_test_extract_columns
58/85 Test #58: openMVG_test_extract_columns ............................. Passed 0.01 sec
Start 59: openMVG_test_numeric
59/85 Test #59: openMVG_test_numeric ..................................... Passed 0.00 sec
Start 60: openMVG_test_poly
60/85 Test #60: openMVG_test_poly ........................................ Passed 0.00 sec
Start 61: openMVG_test_lm
61/85 Test #61: openMVG_test_lm .......................................... Passed 0.00 sec
Start 62: openMVG_test_l1_solver
62/85 Test #62: openMVG_test_l1_solver ................................... Passed 0.09 sec
Start 63: openMVG_test_rand_sampling
63/85 Test #63: openMVG_test_rand_sampling ............................... Passed 0.00 sec
Start 64: openMVG_test_robust_estimator_lineKernel
64/85 Test #64: openMVG_test_robust_estimator_lineKernel ................. Passed 0.00 sec
Start 65: openMVG_test_robust_estimator_MaxConsensus
65/85 Test #65: openMVG_test_robust_estimator_MaxConsensus ............... Passed 0.02 sec
Start 66: openMVG_test_robust_estimator_Ransac
66/85 Test #66: openMVG_test_robust_estimator_Ransac ..................... Passed 0.01 sec
Start 67: openMVG_test_robust_estimator_ACRansac
67/85 Test #67: openMVG_test_robust_estimator_ACRansac ................... Passed 0.05 sec
Start 68: openMVG_test_gms_filter
68/85 Test #68: openMVG_test_gms_filter .................................. Passed 0.01 sec
Start 69: openMVG_test_tracks
69/85 Test #69: openMVG_test_tracks ...................................... Passed 0.00 sec
Start 70: openMVG_test_union_find
70/85 Test #70: openMVG_test_union_find .................................. Passed 0.01 sec
Start 71: openMVG_test_global_quantile_gain_offset_alignment
71/85 Test #71: openMVG_test_global_quantile_gain_offset_alignment ....... Passed 0.01 sec
Start 72: openMVG_test_convert
72/85 Test #72: openMVG_test_convert ..................................... Passed 0.51 sec
Start 73: openMVG_test_progress
73/85 Test #73: openMVG_test_progress .................................... Passed 0.10 sec
Start 74: openMVG_test_sfm_data_io
74/85 Test #74: openMVG_test_sfm_data_io ................................. Passed 0.16 sec
Start 75: openMVG_test_sfm_data_BA
75/85 Test #75: openMVG_test_sfm_data_BA .................................***Failed 0.13 sec
Start 76: openMVG_test_sfm_data_utils
76/85 Test #76: openMVG_test_sfm_data_utils .............................. Passed 0.01 sec
Start 77: openMVG_test_sfm_data_filters
77/85 Test #77: openMVG_test_sfm_data_filters ............................ Passed 0.01 sec
Start 78: openMVG_test_sfm_data_graph_utils
78/85 Test #78: openMVG_test_sfm_data_graph_utils ........................ Passed 0.01 sec
Start 79: openMVG_test_sfm_data_triangulation
79/85 Test #79: openMVG_test_sfm_data_triangulation ......................***Failed 0.03 sec
Start 80: openMVG_test_global_SfM
80/85 Test #80: openMVG_test_global_SfM ..................................***Exception: SegFault 1.60 sec
Start 81: openMVG_test_sequential_SfM
81/85 Test #81: openMVG_test_sequential_SfM ..............................***Failed 0.49 sec
Start 82: openMVG_test_sequential_SfM2
82/85 Test #82: openMVG_test_sequential_SfM2 .............................***Failed 0.04 sec
Start 83: openMVG_test_stellar_SfM
83/85 Test #83: openMVG_test_stellar_SfM .................................***Failed 0.05 sec
Start 84: openMVG_test_split
84/85 Test #84: openMVG_test_split ....................................... Passed 0.01 sec
Start 85: openMVG_test_dynamic_bitset
85/85 Test #85: openMVG_test_dynamic_bitset .............................. Passed 0.00 sec

88% tests passed, 10 tests failed out of 85

Total Test time (real) = 13.18 sec

The following tests FAILED:
1 - openMVG_test_Camera_Pinhole (Failed)
2 - openMVG_test_Camera_Pinhole_Radial (Failed)
3 - openMVG_test_Camera_Pinhole_Brown (Failed)
4 - openMVG_test_Camera_Pinhole_Fisheye (Failed)
75 - openMVG_test_sfm_data_BA (Failed)
79 - openMVG_test_sfm_data_triangulation (Failed)
80 - openMVG_test_global_SfM (SEGFAULT)
81 - openMVG_test_sequential_SfM (Failed)
82 - openMVG_test_sequential_SfM2 (Failed)
83 - openMVG_test_stellar_SfM (Failed)
Errors while running CTest
Output from these tests are in: /data/zhinanyu/OpenMVG/openMVG/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
Makefile:70: recipe for target 'test' failed
make: *** [test] Error 8`

Can you give me a hand? Looking forward to your favorable help!
more:
cmake : 3.22.0-rc3 ubuntu: 18.04

@pmoulon
Copy link
Member

pmoulon commented Jan 5, 2022

test failures
-> it could be that OpenMVG and Ceres are using two different versions of Eigen.

  • Can you share the report that shows if OpenMVG is using internal or external libraries (it is at the end of the message once you call cmake)?

using OpenMVG as a third party
-> find_package(OpenMVG REQUIRED) include_directories(${OPENMVG_INCLUDE_DIRS}) target_link_libraries(main ${OPENMVG_LIBRARIES})

@MrIsland
Copy link
Author

MrIsland commented Jan 5, 2022

Thanks for your help !
And below is the report. It seems that both the Eigen and ceres are using external libraries, which I installed before.
image

(Is it right to let Eigen be the internal libraries?

@pmoulon
Copy link
Member

pmoulon commented Jan 5, 2022

Let's try this to debug:

  1. Can you share the output of the unit test by launching openMVG_test_Camera_Pinhole, openMVG_test_sfm_data_triangulation, and openMVG_test_sfm_data_BA or share the log file.
  2. Can you try to compile OpenMVG by forcing Eigen and Ceres to be the internal version by cleaning your CMake cache and commenting https://github.com/openMVG/openMVG/blob/develop/src/CMakeLists.txt#L259 and https://github.com/openMVG/openMVG/blob/develop/src/CMakeLists.txt#L274 and run the unit test again

If 2 is working we have a Eigen conflict.

@pmoulon
Copy link
Member

pmoulon commented Apr 29, 2022

Closing due to lack of feedback. Feel free to reopen

@pmoulon pmoulon closed this as completed Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants