1.Emsdk
- (1) emsdk项目地址
- (2) 安装流程:
# 1.源码下载
>> git clone git@github.com:emscripten-core/emsdk.git
# 2.可安装版本查询
>> cd emsdk && ./emsdk list
# 3.安装最新版本emsdk
>> ./emsdk install latest
# 4.激活当前版本emsdk
>> ./emsdk activate latest
# 5.添加系统环境变量
>> vim ~/.zshrc
export EMSDK=/home/mirror/software/emsdk
export EMSCRIPTEN=/home/mirror/software/emsdk/upstream/emscripten
export EMSDK_NODE=/home/mirror/software/emsdk/node/16.20.0_64bit/bin
export PATH=$PATH:$EMSDK:$EMSCRIPTEN:$EMSDK_NODE
# 6.刷新系统环境变量
>> source ~/.zshrc
2.OpenCV
2.1 依赖项安装
>> sudo apt-get install build-essential
>> sudo apt-get install libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev libgtk2.0-dev
>> sudo apt-get install libopenblas-dev libatlas-base-dev liblapack-dev libhdf5-dev
# Ubuntu 20.04
>> sudo apt-get install libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev
# Ubuntu 22.04
>> sudo apt-get install libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-dev
# 查询Ubuntu版本
>> lsb_release -a
# Ubuntu 20.04
>> sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
# Ubuntu 22.04
>> sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu jammy-security main"
>> sudo apt update
# 修复签名
>> sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
>> sudo apt-get install libjasper1 libjasper-dev
>> sudo apt-get install libavresample-dev ffmpeg
# Ubuntu 22.04
>> sudo apt-get install libswresample-dev ffmpeg
2.2 源码安装
- (1) OpenCV下载地址
- (2) 编译安装
>> mkdir build && cd build
>> cmake .. -DBuild_opencv_world=ON
>> make -j8 && sudo make install
2.3 环境配置
# 1.编辑配置文件
>> vim /etc/ld.so.conf
# 2.添加如下内容
>> /usr/local/lib
# 3.更新环境变量
>> sudo ldconfig
# 4.查看安装版本
>> opencv_version
3.Protobuf
# 1.源码下载
>> wget https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.18.3.zip
# 2.源码解压并重命名
>> unzip v3.18.3.zip
# 3.源码编译及安装
>> ./autogen.sh && ./configure && mkdir build && cd build && cmake ../cmake -Dprotobuf_BUILD_TESTS=OFF
>> make -j 8 && sudo make install
4.dotnet
- (1) dotnet下载地址
- (2) 解压下载sdk包
>> mkdir Dotnet && cp [path to place]dotnet-sdk-7.0.410-linux-x64.tar.gz ./
>> cd Dotnet && tar -zxvf dotnet-sdk-7.0.410-linux-x64.tar.gz
>> rm dotnet-sdk-7.0.410-linux-x64.tar.gz && pwd
/root/software/Dotnet
- (3) 添加环境变量
# 1.添加环境变量
>> vim ~/.bashrc
export DOTNET_ROOT=/root/software/Dotnet
export PATH:$PATH:$DOTNET_ROOT
# 2.刷新环境变量,使之生效
>> source ~/.bashrc
# 3.查看dotnet信息
>> dotnet --info
.NET SDK:
Version: 7.0.410
Commit: 8b4848c3b2
Runtime Environment:
OS Name: ubuntu
OS Version: 22.04
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /root/software/Dotnet/sdk/7.0.410/
Host:
Version: 7.0.20
Architecture: x64
Commit: 0fb6ac59fb
.NET SDKs installed:
7.0.410 [/root/software/Dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.20 [/root/software/Dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.20 [/root/software/Dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/root/software/Dotnet]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
5.glfwpack编译安装
# 1.下载meshoptimizer源码
>> git clone --recursive git@github.com:zeux/meshoptimizer.git
# 2.下载basis_universal源码
>> git clone -b gltfpack https://github.com/zeux/basis_universal
# 3.编译工具
>> set basis_universal=[basis_universal路径]
# 使用上面环境变量形式设置basis_universal或直接命令行中将这个替换成你下载basis_universal的路径
>> cmake . -DMESHOPT_BUILD_GLTFPACK=ON -DMESHOPT_BASISU_PATH=basis_universal -DCMAKE_BUILD_TYPE=Release
>> cmake --build . --target gltfpack --config Release
6.OpenMesh
- (1) OpenMesh下载地址
- (2) 源码下载编译和安装
>> wget https://www.graphics.rwth-aachen.de/media/openmesh_static/Releases/11.0/OpenMesh-11.0.0.tar.gz
>> tar -zxvf OpenMesh-11.0.0.tar.gz
>> mv OpenMesh-11.0.0 OpenMesh && cd OpenMesh
>> mkdir build && cd build
>> cmake .. -DCMAKE_BUILD_TYPE=Release
>> make -j 8
>> sudo make install
7.pymeshfix
7.1 源码下载
>> git clone https://github.com/pyvista/pymeshfix && cd pymeshfix
7.2 配置修改
- (1)
pyproject.toml
将"numpy>=2,<3",
改为"numpy>=1,<2",
; - (2) 当python版本为
3.8.*
时,将setup.py
里面python_requires=">=3.9"
,改成python_requires=">=3.8"
; - (3) 安装:
>> pip install .
8.miniconda
>> curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
>> bash Miniconda3-latest-Linux-x86_64.sh
9.ceres
# CMake
>> sudo apt-get install cmake
# google-glog + gflags
>> sudo apt-get install libgoogle-glog-dev libgflags-dev
# Use ATLAS for BLAS & LAPACK
>> sudo apt-get install libatlas-base-dev
# Eigen3
>> sudo apt-get install libeigen3-dev
# SuiteSparse (optional)
>> sudo apt-get install libsuitesparse-dev
>> tar zxf ceres-solver-2.2.0.tar.gz
>> mkdir ceres-bin
>> cd ceres-bin
>> cmake ../ceres-solver-2.2.0
>> make -j3
>> make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
>> make install
10.ncnn及pnnx安装
-
(1) 下载ncnn源码
>> git clone git@github.com:Tencent/ncnn.git
-
(2) 编译安装ncnn
>> cd ncnn && mkdir build && cd build && make -j 8 && make install
- (3) 下载pnnx依赖库torch:https://download.pytorch.org/libtorch/cpu
>> wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.6.0%2Bcpu.zip
>> unzip libtorch-cxx11-abi-shared-with-deps-2.6.0+cpu.zip
- (4) 编译pnnx工具:
Torch_INSTALL_DIR
改成自己的torch解压路径
>> cd tools/pnnx && mkdir build && cd build
>> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DTorch_INSTALL_DIR=/home/mirror/software/libtorch ..
>> make -j 8
参考资料
- [1] OpenCV
- [2] emsdk
- [3] Protobuf
- [4] 使用安装脚本或通过提取二进制文件在 Linux 上安装 .NET
- [5] gltfpack
- [6] OpenMesh Document
- [7] pymeshfix
- [8] miniconda安装文档