my@test:~/下载$ cd cmake-3.30.4/
my@test:~/下载/cmake-3.30.4$ ./bootstrap && make -j8 && sudo make install
---------------------------------------------
CMake 3.30.4, Copyright 2000-2024 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++
Makefile processor on this system is: make
g++ has setenv
g++ has unsetenv
...
---------------------------------------------
CMake has bootstrapped. Now run make.
[ 0%] Building C object Source/kwsys/CMakeFiles/cmsys.dir/ProcessUNIX.c.o
[ 0%] Building C object Source/kwsys/CMakeFiles/cmsys.dir/Base64.c.o
[ 0%] Building C object Source/kwsys/CMakeFiles/cmsys.dir/EncodingC.c.o
...
[ 1%] Built target cmsys
[ 2%] Built target cmsys_c
[ 3%] Built target cmsysTestsC
[ 3%] Built target testConsoleBufChild
cmake安装到了/usr/local/share/cmake-3.30路径
报错
CMake Error at /home/my/anaconda3/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
Failed to find "GL/gl.h" in
"/home/my/anaconda3/include;/croot/qt-main_1693210824277/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include;/croot/qt-main_1693210824277/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include/libdrm;/croot/qt-main_1693210824277/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include".
Call Stack (most recent call first):
/home/my/anaconda3/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:233 (include)
/home/my/anaconda3/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:100 (find_package)
Tests/CMakeLists.txt:280 (find_package)
会看到链接动态库到anaconda了,是由于没退出anaconda base环境造成的,先conda deactivate,再删除CMakeCache.txt,重新./bootstrap && make -j8 && sudo make install
5. 软链接
sudo ln -sf /usr/local/bin/cmake /usr/bin/
复制代码
6. 验证版本
my@test:~/下载/cmake-3.30.4$ cmake --version
cmake version 3.30.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).
my@test:~/下载/opencv-4.10.0/build$ cmake -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.10.0/modules ..
CMake Warning (dev) at CMakeLists.txt:127 (enable_language):
project() should be called prior to this enable_language() call.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /bin/c++ - skipped
如果有报错信息如下:
CMake Error at CMakeLists.txt:10 (message):
FATAL: In-source builds are not allowed.
You should create a separate directory for build files.
-- Configuring incomplete, errors occurred!
则须要先删除cmake缓存
rm ../CMakeCache.txt
复制代码
6. 编译
make -j8
复制代码
my@test:~/下载/opencv-4.10.0/build$ make -j8
[ 0%] Built target opencv_videoio_plugins
[ 0%] Built target opencv_dnn_plugins
[ 0%] Built target opencv_highgui_plugins
...
报错1
报错信息:
fatal error: openjpeg.h: No such file or directory
原因是找不到openjpeg文件,我的办理是修改报错信息中给的.hpp文件:
先locate openjpeg.h,输出/usr/include/openjpeg-2.3/openjpeg.h
修改.hpp文件的引入
//#include <openjpeg.h>
#include </usr/include/openjpeg-2.3/openjpeg.h>
报错2
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFLastDirectory@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFWriteEncodedStrip@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSwabArrayOfShort@LIBTIFF_4.0'
在确保libtiff-dev已安装的情况下,sudo apt-get install libtiff4-dev
cmake指令增长 -D BUILD_TIFF=ON
7. 安装opencv
sudo make install
复制代码
my@test:~/下载/opencv-4.10.0/build$ sudo make install
[ 0%] Built target opencv_dnn_plugins
[ 0%] Built target opencv_highgui_plugins
[ 2%] Built target libopenjp2
[ 2%] Built target opencv_videoio_plugins
...
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/share/licenses/opencv4/ippicv-readme.htm
SIBR_viewers的安装
GitHub - graphdeco-inria/gaussian-splatting: Original reference implementation of "3D Gaussian Splatting for Real-Time Radiance Field Rendering"
gs谈到了SIBR的安装,但是我的安装过程有报错
1. 依赖安装
报错信息:
CMake Error in src/core/system/CMakeLists.txt:
Imported target "Boost::system" includes non-existent path
"/include"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.”
直接有效的办理方法是创建/include文件夹,并将boot文件夹复制到include文件夹下
locate boost/version.hpp ##定位boost文件夹,我的boost文件是在 /usr/include/boost
sudo mkdir /include
sudo cp -r /usr/include/boost/ /include/ ##复制文件夹
4. 编译安装
cmake --build build -j24 --target install
复制代码
报错
报错信息:
In file included from /home/my/postg/thesis/gaussian-splatting/SIBR_viewers/src/./core/graphics/Utils.hpp:15,
from /home/my/postg/thesis/gaussian-splatting/SIBR_viewers/src/core/graphics/Utils.cpp:14:
/home/my/postg/thesis/gaussian-splatting/SIBR_viewers/src/./core/graphics/Config.hpp:29:12: fatal error: opencv2/opencv.hpp: 没有那个文件或目录
29 | # include <opencv2/opencv.hpp>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
办理方法:c++ 中——fatal error: opencv2/opencv.hpp: No such file or directory #include <opencv2/opencv.hpp>_opencv2: no such file or directory #include <openc-CSDN博客
./SIBR_gaussianViewer_app: error while loading shared libraries: libwebp.so.7: cannot open shared object file: No such file or directory
(1)检察依赖的动态链接库,发现部门没链接上
报错信息:
my@test:~/thesis/gaussian-splatting/SIBR_viewers/install/bin$ ./SIBR_gaussianViewer_app -m /home/my/thesis/gaussian-splatting/data/output/
./SIBR_gaussianViewer_app: /usr/local/lib/libtiff.so.5: no version information available (required by /lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2)
./SIBR_gaussianViewer_app: /usr/local/lib/libtiff.so.5: no version information available (required by /lib/libgdal.so.26)
./SIBR_gaussianViewer_app: /usr/local/lib/libtiff.so.5: no version information available (required by /lib/x86_64-linux-gnu/libpoppler.so.97)
./SIBR_gaussianViewer_app: /usr/local/lib/libtiff.so.5: no version information available (required by /lib/x86_64-linux-gnu/libgeotiff.so.5)
[SIBR] -- INFOS --: Initialization of GLFW
[SIBR] ## ERROR ##: FILE /home/my/thesis/gaussian-splatting/SIBR_viewers/src/core/graphics/Window.cpp
LINE 30, FUNC glfwErrorCallback
GLX: Failed to create context: GLXBadFBConfig
terminate called after throwing an instance of 'std::runtime_error'
what(): See log for message errors
已放弃 (核心已转储)
(1)是因为OpenGL的版本问题,办理如下,检察OpenGL的版本:
sudo apt install mesa-utils -y
glxinfo | grep OpenGL
复制代码
my@test:~/thesis/gaussian-splatting/SIBR_viewers/install/bin$ glxinfo | grep OpenGL
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 21.2.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
其中OpenGL core profile version string: 4.5,则直接指令带上MESA_GL_VERSION_OVERRIDE=4.5即可