LiangliangNan / Easy3D

A lightweight, easy-to-use, and efficient C++ library for processing and rendering 3D data
GNU General Public License v3.0
1.35k stars 243 forks source link

cmake error in Ubuntu 20.04 #148

Closed amiltonwong closed 1 year ago

amiltonwong commented 1 year ago

Hi, all,

I'm building the package in Ubuntu 20.04. However, I came across the following error during cmake. Any hints to fix this issue?

Thanks~

(base) milton@milton-ws3:/data/code13/Easy3D/build$ cmake ..
-- Setting C++11
-- GLFW including X11 support
-- Found Backward: /data/code13/Easy3D/3rd_party/backward  
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Adding target: easy3d::util (easy3d_util)
-- Adding target: easy3d::core (easy3d_core)
-- Adding target: easy3d::fileio (easy3d_fileio)
-- Adding target: easy3d::kdtree (easy3d_kdtree)
-- Adding target: easy3d::algo (easy3d_algo)
-- Could NOT find Boost (missing: Boost_INCLUDE_DIR) 
-- Adding target: easy3d::renderer (easy3d_renderer)
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so  found components: OpenGL GLX 
-- OpenGL libraries: OPENGL_opengl_LIBRARY-NOTFOUND /usr/lib/x86_64-linux-gnu/libGLX.so
-- Adding target: easy3d::gui (easy3d_gui)
-- Adding target: easy3d::viewer (easy3d_viewer)
CMake Warning at tutorials/Tutorial_203_Viewer_wxWidgets/CMakeLists.txt:9 (message):
  Tutorial_203_Viewer_wxWidgets requires wxWidgets but wxWidgets was not
  found.  You can set 'wxWidgets_ROOT_DIR' to the root directory of wxWidgets
  (e.g., 'D:/dev/wxWidgets-3.2.1') to help CMake find wxWidgets.  Without
  wxWidgets, you will still be able to use all other features provided by
  Easy3D.

CMake Warning at tutorials/Tutorial_203_Viewer_wxWidgets/CMakeLists.txt:13 (message):
  Your CMake version is 3.16.3.  The 'findwxWidgets' module in CMake older
  than 3.24 may not detect wxWidgets.  You can update your CMake to a version
  >= 3.24, or copy the latest version of 'FindwxWidgets.cmake' from the
  following link to your system to fix this:
  https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindwxWidgets.cmake

-- ****************************************************************************
--     Package       : Easy3D
--     Version       : 2.5.2
--     Generator     : Unix Makefiles
--     System        : 64-bit Linux
-- ----------------------------------------------------------------------------
--     Build shared libraries :  ON
--     Build tutorials        :  ON
--     Build documentation    :  OFF
--     Build tests            :  OFF
--     With CGAL (>= v5.1)    :  OFF
--     With Qt5 (>= v5.6)     :  OFF
--     With ffmpeg (>= v3.4)  :  OFF
-- ----------------------------------------------------------------------------
--     Build directory        :  /data/code13/Easy3D/build
--     Installation directory :  /usr/local/easy3d-2.5.2
-- ****************************************************************************
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_opengl_LIBRARY (ADVANCED)
    linked by target "easy3d_renderer" in directory /data/code13/Easy3D/easy3d/renderer

-- Configuring incomplete, errors occurred!
See also "/data/code13/Easy3D/build/CMakeFiles/CMakeOutput.log".
See also "/data/code13/Easy3D/build/CMakeFiles/CMakeError.log".
LiangliangNan commented 1 year ago

Use the following command to setup the dev environment first:

sudo apt-get update
sudo apt-get install build-essential cmake-gui libxmu-dev libxi-dev libgl-dev
amiltonwong commented 1 year ago

@LiangliangNan , thanks for the reply. I've already installed build-essential cmake-gui libxmu-dev libxi-dev libgl-dev. Still the same issue. OpenGL libraries: OPENGL_opengl_LIBRARY-NOTFOUND /usr/lib/x86_64-linux-gnu/libGLX.so https://www.dropbox.com/s/3eh6mupyj6vpvay/cmake-gui.jpg?dl=0

LiangliangNan commented 1 year ago

After installing these pacakges, one has to clear the CMake cache and start a new build

amiltonwong commented 1 year ago

@LiangliangNan , As GPU is equipped in my system, and I can see there are other libGLX* in /usr/lib/x86_64-linux-gnu/ https://www.dropbox.com/s/1vphk2h97bl4t4m/libGLX.jpg?dl=0

/usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0  /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0.0.0  /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.470.57.02  /usr/lib/x86_64-linux-gnu/libGLX.so.0
/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0      /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0    /usr/lib/x86_64-linux-gnu/libGLX.so                   /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0

Is this the reason?

LiangliangNan commented 1 year ago

The libOpenGL.so seems missing. This is what I got on Ubuntu:

-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL GLX 
-- OpenGL libraries: /usr/lib/x86_64-linux-gnu/libOpenGL.so /usr/lib/x86_64-linux-gnu/libGLX.so

Try the following to install all necessary libraries: sudo apt-get install build-essential libgl1-mesa-dev mesa-common-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev;

LiangliangNan commented 1 year ago

I believe the issue has been solved so I am going to close it.