opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.42k stars 5.76k forks source link

Failed to build opencv 4.6.0 on CentOS 7 due to missing opengl symbols used by `rgbd/dynafu.cpp` #3299

Open xkszltl opened 2 years ago

xkszltl commented 2 years ago
System information (version)
Detailed description

Undefined reference to glGenRenderbuffersEXT and several other OpenGL functions. Was fine a few versions (4.5.5) and months ago (2022-04-27). Not sure if it's due to changes of something else in system or due to opencv itself.

$ cmake --build . -- -j1                                                                                 
[1/8] cd /media/Scratch/tmp.FilPhE8QZU/opencv/build/modules/cvv && /usr/local/bin/cmake -E cmake_autogen /media/Scratch/tmp.FilPhE8QZU/opencv/build/modules/cvv/CMakeFiles/opencv_cvv_autogen.dir/AutogenInfo.json Release
[2/5] : && /opt/rh/devtoolset-11/root/usr/bin/g++ -fPIC -fdebug-prefix-map='/media/Scratch/tmp.FilPhE8QZU'='/usr/local/src' -g   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -flto  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -O3 -DNDEBUG  -DNDEBUG  -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libopencv_rgbd.so.406 -o lib/libopencv_rgbd.so.4.6.0 modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_cleaner.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_registration.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_to_3d.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dqb.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/fast_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/hash_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu_frame.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/large_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/linemod.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/nonrigid_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/normal.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/odometry.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/plane.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/pose_graph.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf_functions.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/utils.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/volume.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/warpfield.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/opencl_kernels_rgbd.cpp.o  -Wl,-rpath,/media/Scratch/tmp.FilPhE8QZU/opencv/build/lib::::::::::::::::::::::::::::::  lib/libopencv_calib3d.so.4.6.0  -ldl  -lm  -lpthread  -lrt  3rdparty/lib/libippiw.a  3rdparty/ippicv/ippicv_lnx/icv/lib/intel64/libippicv.a  /lib64/libOpenGL.so  /lib64/libGLX.so  /lib64/libGLU.so  lib/libopencv_features2d.so.4.6.0  lib/libopencv_flann.so.4.6.0  lib/libopencv_imgproc.so.4.6.0  lib/libopencv_core.so.4.6.0 && :
FAILED: lib/libopencv_rgbd.so.4.6.0 
: && /opt/rh/devtoolset-11/root/usr/bin/g++ -fPIC -fdebug-prefix-map='/media/Scratch/tmp.FilPhE8QZU'='/usr/local/src' -g   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -flto  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -O3 -DNDEBUG  -DNDEBUG  -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libopencv_rgbd.so.406 -o lib/libopencv_rgbd.so.4.6.0 modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_cleaner.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_registration.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_to_3d.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dqb.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/fast_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/hash_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu_frame.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/large_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/linemod.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/nonrigid_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/normal.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/odometry.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/plane.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/pose_graph.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf_functions.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/utils.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/volume.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/warpfield.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/opencl_kernels_rgbd.cpp.o  -Wl,-rpath,/media/Scratch/tmp.FilPhE8QZU/opencv/build/lib::::::::::::::::::::::::::::::  lib/libopencv_calib3d.so.4.6.0  -ldl  -lm  -lpthread  -lrt  3rdparty/lib/libippiw.a  3rdparty/ippicv/ippicv_lnx/icv/lib/intel64/libippicv.a  /lib64/libOpenGL.so  /lib64/libGLX.so  /lib64/libGLU.so  lib/libopencv_features2d.so.4.6.0  lib/libopencv_flann.so.4.6.0  lib/libopencv_imgproc.so.4.6.0  lib/libopencv_core.so.4.6.0 && :
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o: in function `cv::dynafu::DynaFu::create(cv::Ptr<cv::kinfu::Params> const&)':
/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:159: undefined reference to `glGenRenderbuffersEXT'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:160: undefined reference to `glBindRenderbufferEXT'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:161: undefined reference to `glRenderbufferStorageEXT'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:164: undefined reference to `glGenFramebuffersEXT'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:165: undefined reference to `glBindFramebufferEXT'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:167: undefined reference to `glFramebufferRenderbufferEXT'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:171: undefined reference to `glGenRenderbuffersEXT'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:172: undefined reference to `glBindRenderbufferEXT'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:173: undefined reference to `glRenderbufferStorageEXT'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /tmp/ccFIHCan.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:175: undefined reference to `glFramebufferRenderbufferEXT'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Steps to reproduce

Here's the cmake arg list I'm using:

Issue submission checklist
xkszltl commented 2 years ago

It links to:

$ realpath -e /lib64/lib{OpenGL,GLX,GLU}.so
/usr/lib64/libOpenGL.so.0.0.0
/usr/lib64/libGLX.so.0.0.0
/usr/lib64/libGLU.so.1.3.1

Those OpenGL libs doesn't contain the glExt functions required:

$ readelf -a /lib64/libOpenGL.so | grep -egl{Bind,Frame,Gen,Render}
    57: 00000000000163e0     0 FUNC    GLOBAL DEFAULT    13 glBindVertexArray
    67: 0000000000018100     0 FUNC    GLOBAL DEFAULT    13 glGenerateMipmap
   162: 0000000000016300     0 FUNC    GLOBAL DEFAULT    13 glBindRenderbuffer
   170: 0000000000017fc0     0 FUNC    GLOBAL DEFAULT    13 glGenBuffers
   196: 0000000000016360     0 FUNC    GLOBAL DEFAULT    13 glBindTexture
   225: 0000000000016280     0 FUNC    GLOBAL DEFAULT    13 glBindFramebuffer
   227: 0000000000016340     0 FUNC    GLOBAL DEFAULT    13 glBindSamplers
   229: 0000000000017ec0     0 FUNC    GLOBAL DEFAULT    13 glFramebufferRenderbuffer
   257: 000000000001b7c0     0 FUNC    GLOBAL DEFAULT    13 glRenderbufferStorageMultisample
   262: 000000000001b780     0 FUNC    GLOBAL DEFAULT    13 glRenderMode
   301: 00000000000162a0     0 FUNC    GLOBAL DEFAULT    13 glBindImageTexture
   314: 0000000000016180     0 FUNC    GLOBAL DEFAULT    13 glBindAttribLocation
   321: 00000000000180c0     0 FUNC    GLOBAL DEFAULT    13 glGenTransformFeedbacks
   333: 0000000000018040     0 FUNC    GLOBAL DEFAULT    13 glGenQueries
   346: 00000000000162c0     0 FUNC    GLOBAL DEFAULT    13 glBindImageTextures
   403: 0000000000016420     0 FUNC    GLOBAL DEFAULT    13 glBindVertexBuffers
   418: 00000000000163c0     0 FUNC    GLOBAL DEFAULT    13 glBindTransformFeedback
   430: 0000000000018120     0 FUNC    GLOBAL DEFAULT    13 glGenerateTextureMipmap
   449: 00000000000163a0     0 FUNC    GLOBAL DEFAULT    13 glBindTextures
   454: 0000000000017f60     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTextureLayer
   468: 0000000000016260     0 FUNC    GLOBAL DEFAULT    13 glBindFragDataLocationIndexed
   484: 0000000000016240     0 FUNC    GLOBAL DEFAULT    13 glBindFragDataLocation
   543: 00000000000162e0     0 FUNC    GLOBAL DEFAULT    13 glBindProgramPipeline
   562: 0000000000017ea0     0 FUNC    GLOBAL DEFAULT    13 glFramebufferParameteri
   614: 0000000000016380     0 FUNC    GLOBAL DEFAULT    13 glBindTextureUnit
   619: 00000000000161a0     0 FUNC    GLOBAL DEFAULT    13 glBindBuffer
   637: 0000000000018080     0 FUNC    GLOBAL DEFAULT    13 glGenSamplers
   697: 0000000000017fe0     0 FUNC    GLOBAL DEFAULT    13 glGenFramebuffers
   716: 0000000000016220     0 FUNC    GLOBAL DEFAULT    13 glBindBuffersRange
   723: 000000000001b7a0     0 FUNC    GLOBAL DEFAULT    13 glRenderbufferStorage
   805: 0000000000016200     0 FUNC    GLOBAL DEFAULT    13 glBindBuffersBase
   834: 00000000000180a0     0 FUNC    GLOBAL DEFAULT    13 glGenTextures
   847: 0000000000018060     0 FUNC    GLOBAL DEFAULT    13 glGenRenderbuffers
   878: 0000000000018020     0 FUNC    GLOBAL DEFAULT    13 glGenProgramPipelines
   904: 00000000000161c0     0 FUNC    GLOBAL DEFAULT    13 glBindBufferBase
   910: 0000000000017ee0     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture
   917: 0000000000016400     0 FUNC    GLOBAL DEFAULT    13 glBindVertexBuffer
   923: 0000000000018000     0 FUNC    GLOBAL DEFAULT    13 glGenLists
   979: 0000000000017f00     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture1D
   981: 00000000000180e0     0 FUNC    GLOBAL DEFAULT    13 glGenVertexArrays
  1005: 0000000000017f20     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture2D
  1028: 00000000000161e0     0 FUNC    GLOBAL DEFAULT    13 glBindBufferRange
  1039: 0000000000017f40     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture3D
  1066: 0000000000016320     0 FUNC    GLOBAL DEFAULT    13 glBindSampler
xkszltl commented 2 years ago

Also repro on Ubuntu 18.04:

# cmake --build . -- -j1
[1/7] cd /tmp/scratch/opencv/build/modules/cvv && /usr/local/bin/cmake -E cmake_autogen /tmp/scratch/opencv/build/modules/cvv/CMakeFiles/opencv_cvv_autogen.dir/AutogenInfo.json Release
[2/4] : && /usr/bin/g++-8 -fPIC -fdebug-prefix-map='/tmp/scratch'='/usr/local/src' -g   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -flto  -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -O3 -DNDEBUG  -DNDEBUG  -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libopencv_rgbd.so.406 -o lib/libopencv_rgbd.so.4.6.0 modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_cleaner.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_registration.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_to_3d.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dqb.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/fast_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/hash_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu_frame.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/large_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/linemod.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/nonrigid_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/normal.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/odometry.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/plane.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/pose_graph.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf_functions.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/utils.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/volume.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/warpfield.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/opencl_kernels_rgbd.cpp.o  -Wl,-rpath,/tmp/scratch/opencv/build/lib::::::::::::::::::::::::::::  lib/libopencv_calib3d.so.4.6.0  -ldl  -lm  -lpthread  -lrt  3rdparty/lib/libippiw.a  3rdparty/ippicv/ippicv_lnx/icv/lib/intel64/libippicv.a  /usr/lib/x86_64-linux-gnu/libOpenGL.so  /usr/lib/x86_64-linux-gnu/libGLX.so  /usr/lib/x86_64-linux-gnu/libGLU.so  lib/libopencv_features2d.so.4.6.0  lib/libopencv_flann.so.4.6.0  lib/libopencv_imgproc.so.4.6.0  lib/libopencv_core.so.4.6.0 && :
FAILED: lib/libopencv_rgbd.so.4.6.0 
: && /usr/bin/g++-8 -fPIC -fdebug-prefix-map='/tmp/scratch'='/usr/local/src' -g   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -flto  -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -O3 -DNDEBUG  -DNDEBUG  -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libopencv_rgbd.so.406 -o lib/libopencv_rgbd.so.4.6.0 modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_cleaner.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_registration.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_to_3d.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dqb.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/fast_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/hash_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu_frame.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/large_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/linemod.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/nonrigid_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/normal.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/odometry.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/plane.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/pose_graph.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf_functions.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/utils.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/volume.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/warpfield.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/opencl_kernels_rgbd.cpp.o  -Wl,-rpath,/tmp/scratch/opencv/build/lib::::::::::::::::::::::::::::  lib/libopencv_calib3d.so.4.6.0  -ldl  -lm  -lpthread  -lrt  3rdparty/lib/libippiw.a  3rdparty/ippicv/ippicv_lnx/icv/lib/intel64/libippicv.a  /usr/lib/x86_64-linux-gnu/libOpenGL.so  /usr/lib/x86_64-linux-gnu/libGLX.so  /usr/lib/x86_64-linux-gnu/libGLU.so  lib/libopencv_features2d.so.4.6.0  lib/libopencv_flann.so.4.6.0  lib/libopencv_imgproc.so.4.6.0  lib/libopencv_core.so.4.6.0 && :
/usr/bin/ld: Dwarf Error: Invalid abstract instance DIE ref.
/tmp/cclW576Y.ltrans13.ltrans.o: In function `cv::dynafu::DynaFu::create(cv::Ptr<cv::kinfu::Params> const&)':
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x548): undefined reference to `glGenRenderbuffersEXT'
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x555): undefined reference to `glBindRenderbufferEXT'
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x56a): undefined reference to `glRenderbufferStorageEXT'
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x578): undefined reference to `glGenFramebuffersEXT'
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x585): undefined reference to `glBindFramebufferEXT'
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x59c): undefined reference to `glFramebufferRenderbufferEXT'
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x5aa): undefined reference to `glGenRenderbuffersEXT'
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x5b7): undefined reference to `glBindRenderbufferEXT'
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x5cc): undefined reference to `glRenderbufferStorageEXT'
<artificial>:(.text._ZN2cv6dynafu6DynaFu6createERKNS_3PtrINS_5kinfu6ParamsEEE+0x5e3): undefined reference to `glFramebufferRenderbufferEXT'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
# realpath -e /usr/lib/x86_64-linux-gnu/lib{OpenGL,GLX,GLU}.so
/usr/lib/x86_64-linux-gnu/libOpenGL.so.0.0.0
/usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0
/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
# readelf -a /usr/lib/x86_64-linux-gnu/libOpenGL.so | grep -egl{Bind,Frame,Gen,Render}
    55: 00000000000163e0     0 FUNC    GLOBAL DEFAULT    13 glBindVertexArray
    65: 0000000000018100     0 FUNC    GLOBAL DEFAULT    13 glGenerateMipmap
   158: 0000000000016300     0 FUNC    GLOBAL DEFAULT    13 glBindRenderbuffer
   166: 0000000000017fc0     0 FUNC    GLOBAL DEFAULT    13 glGenBuffers
   192: 0000000000016360     0 FUNC    GLOBAL DEFAULT    13 glBindTexture
   221: 0000000000016280     0 FUNC    GLOBAL DEFAULT    13 glBindFramebuffer
   223: 0000000000016340     0 FUNC    GLOBAL DEFAULT    13 glBindSamplers
   225: 0000000000017ec0     0 FUNC    GLOBAL DEFAULT    13 glFramebufferRenderbuffer
   253: 000000000001b7c0     0 FUNC    GLOBAL DEFAULT    13 glRenderbufferStorageMultisample
   258: 000000000001b780     0 FUNC    GLOBAL DEFAULT    13 glRenderMode
   297: 00000000000162a0     0 FUNC    GLOBAL DEFAULT    13 glBindImageTexture
   310: 0000000000016180     0 FUNC    GLOBAL DEFAULT    13 glBindAttribLocation
   317: 00000000000180c0     0 FUNC    GLOBAL DEFAULT    13 glGenTransformFeedbacks
   329: 0000000000018040     0 FUNC    GLOBAL DEFAULT    13 glGenQueries
   342: 00000000000162c0     0 FUNC    GLOBAL DEFAULT    13 glBindImageTextures
   398: 0000000000016420     0 FUNC    GLOBAL DEFAULT    13 glBindVertexBuffers
   413: 00000000000163c0     0 FUNC    GLOBAL DEFAULT    13 glBindTransformFeedback
   425: 0000000000018120     0 FUNC    GLOBAL DEFAULT    13 glGenerateTextureMipmap
   444: 00000000000163a0     0 FUNC    GLOBAL DEFAULT    13 glBindTextures
   449: 0000000000017f60     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTextureLayer
   462: 0000000000016260     0 FUNC    GLOBAL DEFAULT    13 glBindFragDataLocationIndexed
   477: 0000000000016240     0 FUNC    GLOBAL DEFAULT    13 glBindFragDataLocation
   536: 00000000000162e0     0 FUNC    GLOBAL DEFAULT    13 glBindProgramPipeline
   555: 0000000000017ea0     0 FUNC    GLOBAL DEFAULT    13 glFramebufferParameteri
   607: 0000000000016380     0 FUNC    GLOBAL DEFAULT    13 glBindTextureUnit
   612: 00000000000161a0     0 FUNC    GLOBAL DEFAULT    13 glBindBuffer
   630: 0000000000018080     0 FUNC    GLOBAL DEFAULT    13 glGenSamplers
   690: 0000000000017fe0     0 FUNC    GLOBAL DEFAULT    13 glGenFramebuffers
   709: 0000000000016220     0 FUNC    GLOBAL DEFAULT    13 glBindBuffersRange
   716: 000000000001b7a0     0 FUNC    GLOBAL DEFAULT    13 glRenderbufferStorage
   798: 0000000000016200     0 FUNC    GLOBAL DEFAULT    13 glBindBuffersBase
   827: 00000000000180a0     0 FUNC    GLOBAL DEFAULT    13 glGenTextures
   840: 0000000000018060     0 FUNC    GLOBAL DEFAULT    13 glGenRenderbuffers
   871: 0000000000018020     0 FUNC    GLOBAL DEFAULT    13 glGenProgramPipelines
   897: 00000000000161c0     0 FUNC    GLOBAL DEFAULT    13 glBindBufferBase
   903: 0000000000017ee0     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture
   910: 0000000000016400     0 FUNC    GLOBAL DEFAULT    13 glBindVertexBuffer
   916: 0000000000018000     0 FUNC    GLOBAL DEFAULT    13 glGenLists
   972: 0000000000017f00     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture1D
   974: 00000000000180e0     0 FUNC    GLOBAL DEFAULT    13 glGenVertexArrays
   998: 0000000000017f20     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture2D
  1021: 00000000000161e0     0 FUNC    GLOBAL DEFAULT    13 glBindBufferRange
  1032: 0000000000017f40     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture3D
  1059: 0000000000016320     0 FUNC    GLOBAL DEFAULT    13 glBindSampler

But Debian 11 seems fine.

xkszltl commented 2 years ago

One difference I found on Debian 11 is, it doesn't have /usr/lib/x86_64-linux-gnu/libOpenGL.so, only /usr/lib/x86_64-linux-gnu/libOpenGL.so.0. I wonder if this leads to some detection issue and the problematic file isn't built at all.

Those missing symbols are in libGL, this is consistent across distros, but only libGLX/libGLU/libOpenGL are listed on command line:

# readelf -a /lib64/libGL.so | grep -egl{Bind,Frame,Gen,Render}'.*EXT'
   179: 0000000000049cc0     0 FUNC    GLOBAL DEFAULT    13 glFramebufferDrawBufferEXT
   221: 0000000000044900     0 FUNC    GLOBAL DEFAULT    13 glBindMultiTextureEXT
   327: 0000000000044780     0 FUNC    GLOBAL DEFAULT    13 glBindFragDataLocationEXT
   405: 000000000004a520     0 FUNC    GLOBAL DEFAULT    13 glGenTransformFeedbacksEXT
   442: 0000000000044820     0 FUNC    GLOBAL DEFAULT    13 glBindFramebufferEXT
   606: 000000000004a5c0     0 FUNC    GLOBAL DEFAULT    13 glGenVertexShadersEXT
   634: 000000000004a680     0 FUNC    GLOBAL DEFAULT    13 glGenerateTextureMipmapEXT
   751: 0000000000049fa0     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTextureFaceEXT
   773: 0000000000044640     0 FUNC    GLOBAL DEFAULT    13 glBindBufferBaseEXT
   777: 0000000000049d60     0 FUNC    GLOBAL DEFAULT    13 glFramebufferRenderbufferEXT
   797: 0000000000049ce0     0 FUNC    GLOBAL DEFAULT    13 glFramebufferDrawBuffersEXT
  1025: 0000000000044a60     0 FUNC    GLOBAL DEFAULT    13 glBindTexGenParameterEXT
  1045: 0000000000049e80     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture2DMultisampleEXT
  1151: 0000000000049e20     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture1DEXT
  1224: 0000000000044c20     0 FUNC    GLOBAL DEFAULT    13 glBindVertexShaderEXT
  1304: 000000000004a360     0 FUNC    GLOBAL DEFAULT    13 glGenProgramPipelinesEXT
  1371: 00000000000446e0     0 FUNC    GLOBAL DEFAULT    13 glBindBufferRangeEXT
  1449: 000000000004a640     0 FUNC    GLOBAL DEFAULT    13 glGenerateMultiTexMipmapEXT
  1577: 00000000000449e0     0 FUNC    GLOBAL DEFAULT    13 glBindRenderbufferEXT
  1761: 0000000000055220     0 FUNC    GLOBAL DEFAULT    13 glRenderbufferStorageMultisampleEXT
  1852: 0000000000044920     0 FUNC    GLOBAL DEFAULT    13 glBindParameterEXT
  2032: 000000000004a4e0     0 FUNC    GLOBAL DEFAULT    13 glGenTexturesEXT
  2061: 0000000000049d20     0 FUNC    GLOBAL DEFAULT    13 glFramebufferReadBufferEXT
  2079: 0000000000044880     0 FUNC    GLOBAL DEFAULT    13 glBindImageTextureEXT
  2169: 0000000000049f00     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture3DEXT
  2172: 00000000000448c0     0 FUNC    GLOBAL DEFAULT    13 glBindLightParameterEXT
  2208: 00000000000447c0     0 FUNC    GLOBAL DEFAULT    13 glBindFragDataLocationIndexedEXT
  2290: 000000000004a4a0     0 FUNC    GLOBAL DEFAULT    13 glGenSymbolsEXT
  2321: 0000000000044680     0 FUNC    GLOBAL DEFAULT    13 glBindBufferOffsetEXT
  2346: 0000000000044b40     0 FUNC    GLOBAL DEFAULT    13 glBindTransformFeedbackEXT
  2370: 000000000004a600     0 FUNC    GLOBAL DEFAULT    13 glGenerateMipmapEXT
  2669: 000000000004a400     0 FUNC    GLOBAL DEFAULT    13 glGenQueriesEXT
  2683: 0000000000044ae0     0 FUNC    GLOBAL DEFAULT    13 glBindTextureUnitParameterEXT
  2713: 00000000000448e0     0 FUNC    GLOBAL DEFAULT    13 glBindMaterialParameterEXT
  2783: 000000000004a000     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTextureLayerEXT
  2818: 0000000000049f60     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTextureEXT
  2863: 000000000004a440     0 FUNC    GLOBAL DEFAULT    13 glGenRenderbuffersEXT
  2896: 0000000000044aa0     0 FUNC    GLOBAL DEFAULT    13 glBindTextureEXT
  2962: 0000000000055180     0 FUNC    GLOBAL DEFAULT    13 glRenderbufferStorageEXT
  3028: 000000000004a260     0 FUNC    GLOBAL DEFAULT    13 glGenFramebuffersEXT
  3086: 00000000000449a0     0 FUNC    GLOBAL DEFAULT    13 glBindProgramPipelineEXT
  3307: 0000000000049e60     0 FUNC    GLOBAL DEFAULT    13 glFramebufferTexture2DEXT
payamaminian commented 2 years ago

i have this issue too? is there any solution?