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

g2o installation fails because of some qt5 dependency #5

Closed
DefUs3r opened this issue Oct 12, 2020 · 15 comments
Closed

g2o installation fails because of some qt5 dependency #5

DefUs3r opened this issue Oct 12, 2020 · 15 comments

Comments

@DefUs3r
Copy link

DefUs3r commented Oct 12, 2020

I am getting the following error in g2o installation, which is because of qt5. I have tried with and without the optional deps for g2o but the error persists.
image

Package installation details:

  • Tried with and without optional dependencies of g2o. Error persists.
  • cmake and libeigen3-dev installed successfully
  • Optional deps of g2o install successfully.

System details:

  • Ubuntu 20.04
  • NVIDIA GTX 960M
@Shubodh
Copy link
Owner

Shubodh commented Oct 12, 2020

Hi @DefUs3r, please share the entire output text instead of image. If it is too long, please paste it on https://pastebin.com/ and share the link here. So firstly please do this.

Next, please do the following and share the output:

First let us install ccmake, it is a GUI for configuring files generated by cmake. Run sudo apt install cmake-curses-gui.

Just like how you run cmake .., run ccmake .. instead and share your output equivalent to the below (scroll down after you run ccmake ..):

 QGLVIEWER_INCLUDE_DIR            /usr/include/QGLViewer                                                                                   
 QGLVIEWER_LIBRARY_DEBUG          QGLVIEWER_LIBRARY_DEBUG-NOTFOUND                                                                         
 QGLVIEWER_LIBRARY_RELEASE        /usr/lib/x86_64-linux-gnu/libQGLViewer-qt5.so                                                            
 Qt5Core_DIR                      /home/shubodh/anaconda3/lib/cmake/Qt5Core                                                                
 Qt5Gui_DIR                       /home/shubodh/anaconda3/lib/cmake/Qt5Gui                                                                 
 Qt5OpenGL_DIR                    /home/shubodh/anaconda3/lib/cmake/Qt5OpenGL                                                              
 Qt5Widgets_DIR                   /home/shubodh/anaconda3/lib/cmake/Qt5Widgets                                                             
 Qt5Xml_DIR                       /home/shubodh/anaconda3/lib/cmake/Qt5Xml                                                                 
 Qt5_DIR                          /home/shubodh/anaconda3/lib/cmake/Qt5 

Also what does qmake --version give? (Need qt version)

@darthgera123
Copy link

darthgera123 commented Oct 14, 2020

similar error. I am getting this after cmake and into make at 58%

/usr/bin/ld: /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libQGLViewer-qt5.so: undefined reference to `qt_version_tag@Qt_5.12'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [g2o/apps/g2o_viewer/CMakeFiles/g2o_viewer.dir/build.make:101: ../bin/g2o_viewer] Error 1
make[1]: *** [CMakeFiles/Makefile2:1551: g2o/apps/g2o_viewer/CMakeFiles/g2o_viewer.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

I have installed all the optional stuff as well. cmake gives no error. Not sure what to do
The files are all installed in a conda env, do i need to reset the path?

@Shubodh
Copy link
Owner

Shubodh commented Oct 14, 2020

Hi @DefUs3r, please share the entire output text instead of image. If it is too long, please paste it on https://pastebin.com/ and share the link here. So firstly please do this.

Next, please do the following and share the output:

First let us install ccmake, it is a GUI for configuring files generated by cmake. Run sudo apt install cmake-curses-gui.

Just like how you run cmake .., run ccmake .. instead and share your output equivalent to the below (scroll down after you run ccmake ..):

 QGLVIEWER_INCLUDE_DIR            /usr/include/QGLViewer                                                                                   
 QGLVIEWER_LIBRARY_DEBUG          QGLVIEWER_LIBRARY_DEBUG-NOTFOUND                                                                         
 QGLVIEWER_LIBRARY_RELEASE        /usr/lib/x86_64-linux-gnu/libQGLViewer-qt5.so                                                            
 Qt5Core_DIR                      /home/shubodh/anaconda3/lib/cmake/Qt5Core                                                                
 Qt5Gui_DIR                       /home/shubodh/anaconda3/lib/cmake/Qt5Gui                                                                 
 Qt5OpenGL_DIR                    /home/shubodh/anaconda3/lib/cmake/Qt5OpenGL                                                              
 Qt5Widgets_DIR                   /home/shubodh/anaconda3/lib/cmake/Qt5Widgets                                                             
 Qt5Xml_DIR                       /home/shubodh/anaconda3/lib/cmake/Qt5Xml                                                                 
 Qt5_DIR                          /home/shubodh/anaconda3/lib/cmake/Qt5 

Also what does qmake --version give? (Need qt version)

@darthgera123 Please do what I suggested above and share your output. Also let me know your ubuntu version.

@darthgera123
Copy link

darthgera123 commented Oct 14, 2020

ubuntu 20.04
output of make is here - https://pastebin.com/9i7pDt2A
qmake version is QMake version 3.1 Using Qt version 5.9.7 in /home/gera/anaconda3/envs/mr_assignment1/lib

@DefUs3r
Copy link
Author

DefUs3r commented Oct 14, 2020

Hi @DefUs3r, please share the entire output text instead of image. If it is too long, please paste it on https://pastebin.com/ and share the link here. So firstly please do this.

Next, please do the following and share the output:

First let us install ccmake, it is a GUI for configuring files generated by cmake. Run sudo apt install cmake-curses-gui.

Just like how you run cmake .., run ccmake .. instead and share your output equivalent to the below (scroll down after you run ccmake ..):

 QGLVIEWER_INCLUDE_DIR            /usr/include/QGLViewer                                                                                   
 QGLVIEWER_LIBRARY_DEBUG          QGLVIEWER_LIBRARY_DEBUG-NOTFOUND                                                                         
 QGLVIEWER_LIBRARY_RELEASE        /usr/lib/x86_64-linux-gnu/libQGLViewer-qt5.so                                                            
 Qt5Core_DIR                      /home/shubodh/anaconda3/lib/cmake/Qt5Core                                                                
 Qt5Gui_DIR                       /home/shubodh/anaconda3/lib/cmake/Qt5Gui                                                                 
 Qt5OpenGL_DIR                    /home/shubodh/anaconda3/lib/cmake/Qt5OpenGL                                                              
 Qt5Widgets_DIR                   /home/shubodh/anaconda3/lib/cmake/Qt5Widgets                                                             
 Qt5Xml_DIR                       /home/shubodh/anaconda3/lib/cmake/Qt5Xml                                                                 
 Qt5_DIR                          /home/shubodh/anaconda3/lib/cmake/Qt5 

Also what does qmake --version give? (Need qt version)

Hello @Shubodh sir,
The qmake version for my system is

 QMake version 3.1
 Using Qt version 5.9.7 in /home/soumyasis/anaconda3/lib

I am attaching the log file for running the make -j8 command after cmake ../ and the error log as the following files:
error_log.txt
log.txt

The output of running the command cmake is as follows:

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Compiling on Unix
-- Found CHOLMOD: /usr/include/suitesparse  
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- A library with BLAS API found.
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
-- Found CHOLMOD and its dependencies
-- Found CSPARSE: /usr/include/suitesparse  
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Compiling with OpenGL support
-- Found QGLVIEWER: /usr/include/QGLViewer  
-- Compiling g2o apps
-- Compiling g2o examples
-- Compiling with GCC
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "3.3") 
-- Generating position indpendent code for slam2d because Qt5 was built with -reduce-relocations
-- Configuring done
-- Generating done
-- Build files have been written to: /location_of_g2o_repo/g2o/build

After I run ccmake on cmake build files, the output is as follows:
Screenshot from 2020-10-14 18-48-40
Screenshot from 2020-10-14 18-48-44

@Shubodh
Copy link
Owner

Shubodh commented Oct 14, 2020

@DefUs3r Just like how you ran cmake .., go into build folder and run ccmake ...

@DefUs3r
Copy link
Author

DefUs3r commented Oct 14, 2020

@DefUs3r Just like how you ran cmake .., go into build folder and run ccmake ...

Yeah, sorry I had just missed that. I just added the ccmake outputs too.

@Shubodh
Copy link
Owner

Shubodh commented Oct 14, 2020

Looking at your outputs, your setup seems to be exactly same as mine. Except that I am using 18.04. And that seems to be the main difference as your output qt_version_tag@Qt_5 .12 says: In 20.04 libqglviewer is 5.12 while in 18.04 it is 5.9.
But the thing is, author seems to be using and successfully maintaining the library on 20.04, so I'm sorry: I am not clear on what's the problem here. Can you please raise this issue on official g2o repo? It hasn't been asked till now and it seems from our thread that it is common on 20.04.
You could share the link of our discussion there.

p.s. After installing g2o, it won't take too long to do the g2o related tasks for our project. Don't worry, we can have an extension of couple days for you both if they take some time to respond. @darthgera123 @DefUs3r

@tkhabia
Copy link

tkhabia commented Oct 14, 2020

unable to install g2o viewer
Ubuntu 20.04.1 LTS
QMake version 3.1
Using Qt version 5.9.7 in /home/tanmay/anaconda3/lib

 QGLVIEWER_LIBRARY_DEBUG          QGLVIEWER_LIBRARY_DEBUG-NOTFOUND                                                                                                                                                
 QGLVIEWER_LIBRARY_RELEASE        /usr/lib/x86_64-linux-gnu/libQGLViewer-qt5.so                                                                                                                                   
 Qt5Core_DIR                      /home/tanmay/anaconda3/lib/cmake/Qt5Core                                                                                                                                        
 Qt5Gui_DIR                       /home/tanmay/anaconda3/lib/cmake/Qt5Gui                                                                                                                                         
 Qt5OpenGL_DIR                    /home/tanmay/anaconda3/lib/cmake/Qt5OpenGL                                                                                                                                      
 Qt5Widgets_DIR                   /home/tanmay/anaconda3/lib/cmake/Qt5Widgets                                                                                                                                     
 Qt5Xml_DIR                       /home/tanmay/anaconda3/lib/cmake/Qt5Xml                                                                                                                                         
 Qt5_DIR                          /home/tanmay/anaconda3/lib/cmake/Qt5                                                                                                                                            
 g2o_LIBRARY_OUTPUT_DIRECTORY     /home/tanmay/tanmay/mr/g2o/lib                                                                                                                                                  
 g2o_RUNTIME_OUTPUT_DIRECTORY     /home/tanmay/tanmay/mr/g2o/bin                                                                                                                                                  

@Shubodh
Copy link
Owner

Shubodh commented Oct 14, 2020

tkhabia and darthgera123's setups looks same as yours @DefUs3r. I feel this gives even more validation for our issue and raising the issue in the official repo is a good idea. @DefUs3r

@tkhabia
Copy link

tkhabia commented Oct 14, 2020

tkhabia and darthgera123's setups looks same as yours @DefUs3r. I feel this gives even more validation for our issue and raising the issue in the official repo is a good idea. @DefUs3r

so what do we do we have to complete it before the deadline and most of the project require g2o?

@DefUs3r
Copy link
Author

DefUs3r commented Oct 14, 2020

tkhabia and darthgera123's setups looks same as yours @DefUs3r. I feel this gives even more validation for our issue and raising the issue in the official repo is a good idea. @DefUs3r

Yes sir, will raise issue at the earliest. Meanwhile, if you would suggest an alternative for this library, it would be great.

@Shubodh
Copy link
Owner

Shubodh commented Oct 14, 2020

There are other factor graph optimization libraries but given the current necessities of the project, g2o is the easiest to use and porting to other libraries will take some effort.

Note that you can compile g2o without the optional requirements, then you will not be able run g2o_viewer (needs qt etc) but g2o would work. So you should be able to successfully finish off till 2.2.1 with this basic build. You can just skip 2.2.2 and do the rest of the project.

Only for 2.2.2 is g2o_viewer a mandatory requirement, this task will barely take an hour to finish off. You do this sole task after our issue is resolved.

So @DefUs3r @darthgera123 @tkhabia you can move ahead with finishing off the project except 2.2.2.

@Shubodh
Copy link
Owner

Shubodh commented Oct 14, 2020

@darthgera123 @DefUs3r @tkhabia Looking at what Rainer has replied here, I think I understand what the issue is. In Ubuntu 18.04, the version of qt matches with that of conda (5.9), that's why although your (20.04) and mine (18.04) configs are same, yours throws an error in 20.04. The default qt version in 20.04 is 5.12 but if you do it from within conda env, the issue is: QGLVIEWER_LIBRARY_RELEASE will be using 5.12 but rest of components of qt like Qt5Core_DIR are using conda's 5.9.

Just deactivate your conda environment and re-compile it, I think it will work fine. All of qt's components should be from /usr/lib/.. when you run ccmake as follows:

 QGLVIEWER_LIBRARY_RELEASE        /usr/lib/x86_64-linux-gnu/libQGLViewer-qt5.so                                                            
 Qt5Core_DIR                      /usr/lib/x86_64-linux-gnu/cmake/Qt5Core                                                                  
 Qt5Gui_DIR                       /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui                                                                   
 Qt5OpenGL_DIR                    /usr/lib/x86_64-linux-gnu/cmake/Qt5OpenGL                                                                
 Qt5Widgets_DIR                   /usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets                                                               
 Qt5Xml_DIR                       /usr/lib/x86_64-linux-gnu/cmake/Qt5Xml                                                                   
 Qt5_DIR                          /usr/lib/x86_64-linux-gnu/cmake/Qt5 

@DefUs3r
Copy link
Author

DefUs3r commented Oct 15, 2020

Hello all,
The issue has been resolved. In case you are still getting the same error, it has to do with the fact that your $PATH variable contains sym links to conda. The proper way to do that is to declare a variable NO_CONDA_PATH and then use with cmake to generate the makefiles. Additionally as a failsafe, one can follow these steps.

  • Make sure to do conda deactivate before starting anything. Remove any environment, even base.
  • Type export NO_CONDA_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • Now go to your g2o repository, make a folder build and do cd build
  • Instead of the cmake ../ mentioned by @Shubodh sir, use PATH=$NO_CONDA_PATH cmake ../
  • Instead of the command make mentioned by @Shubodh sir, use make -j8 to use threading for building. It is faster

This will guarantee a no-error installation. Thanks to @Shubodh @darthgera123 @tkhabia .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants