文章

Ubuntu 安装 OCCT

OCCT 依赖库

下载OpenCascade

OCC 7.7编译有问题,使能VTK时编译错误,下载最新版的OCC修复该问题:

1
2
# https://dev.opencascade.org/resources/git_repository
git clone https://git.dev.opencascade.org/repos/occt.git occt

编译安装命令

1. 编译安装第三方库

  • 注意要 tcl-dev, tk-dev, tcllib, tklib,除非自己编译安装,此时要设置TCL/TK相关的路径,比较麻烦。
1
2
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libx11-dev libgl1-mesa-dev libfreeimage-dev
sudo apt-get install rapidjson-dev libdraco-dev

tcl 8.6编译安装命令(tk 8.6相同的编译配置命令):

1
2
3
4
5
# https://www.tcl.tk/software/tcltk/8.6.html

cd tcl8.6.13/unix
./configure --enable-gcc  --enable-shared --enable-threads --enable-64bit
make && sudo make install

freeType编译安装命令:

1
2
3
4
# https://freetype.org/download.html

CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC' ./configure
make && sudo make install

FreeImage编译安装命令:

1
2
3
4
# https://freeimage.sourceforge.io/download.html
# 修改 Makefile.fip:增加 CXXFLAGS += -std=c++11
make -f Makefile.fip
# 拷贝头文件及 .so, .a 到相应目录

编译安装fdk-accffmpeg:

1
2
3
4
5
6
7
8
9
# install dependencies
sudo apt install libavformat-dev libavcodec-dev libswresample-dev libswscale-dev libavutil-dev libsdl1.2-dev libx264-dev nasm

# tdk-acc
./configure && make && sudo make install

# ffmpeg
./configure --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-filter=delogo --enable-shared --enable-pthreads
make && sudo make install

2. 编译安装 OCCT

1
2
3
4
5
6
7
8
cd opencascade-7.7.0
mdkir build && cd build

# 配置OCC编译,使能VTK, ITK等功能
ccmake ..

make -j6
sudo make install

几次配置截图之后,配置如下

ccmake1

ccmake2

3. 安装或编译 Qt5

  • 安装 Qt5
1
2
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
sudo apt-get install qtcreator
  • 编译 Qt5

编译及设置环境变量见 VTK(1):ubuntu 22.04 源码编译安装 Qt5.15.6

国内学习博客

http 链接:

2.OpenCASCADE - eryar - C++博客 (cppblog.com) http://cppblog.com/eryar/category/17808.html?Show=All

引用资料

本文由作者按照 CC BY 4.0 进行授权