OCCT提供源码,本文的编译直接在ARM板上进行编译。
注: 当前本文是基于glx跑起来的,应该是基于CPU, GPU的话后续探索更新文章来源地址https://www.toymoban.com/news/detail-756523.html
源码编译
- 下载地址
https://dev.opencascade.org/release
- 下载依赖
- 下载必须依赖 FreeType 和 Tcl/Tk
https://dev.opencascade.org/resources/download/3rd-party-components
- 安装所需要的依赖
- 解决 fontconfig/fontconfig.h: No such file or directory
sudo apt-get install libfontconfig1-dev
- 解决 fatal error: GL/glx.h: No such file or directory
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev
- 解决 fontconfig/fontconfig.h: No such file or directory
- 解压
将opencascade进行解压, 新建3rdparty 将 FreeType 和 Tcl/Tk解压到3rdparty下【后续编译脚本这样写的,如果有其他要求可自行修改】 - 编译
#/bin/bash CURRENT_DIR=$(cd $(dirname $0); pwd) DEPEND_3RDPARTY_DIR=${CURRENT_DIR}/3rdparty # build 3rdparty if [ ! -x "build_arm" ];then mkdir build_arm fi # input 3rdparty pushd ${DEPEND_3RDPARTY_DIR} FREETYPE_DIR=${DEPEND_3RDPARTY_DIR}/freetype-2.10.4 TCL_DIR=${DEPEND_3RDPARTY_DIR}/tcl8.5.0 TK_DIR=${DEPEND_3RDPARTY_DIR}/tk8.5.0 INSTALL_3RDPARTY_DIR=${DEPEND_3RDPARTY_DIR}/install #: << FREETYPEBUILD pushd ${FREETYPE_DIR} if [ ! -x "build" ];then mkdir build fi pushd build rm -irf * cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_3RDPARTY_DIR} \ .. \ && make -j4 && make install popd rm -irf build popd #FREETYPEBUILD #: << TCLBUILD # build tcl pushd ${TCL_DIR}/unix # 为了解决编译错误 # fixstrtod.c:(.text+0x0): multiple definition of fixstrtod export tcl_cv_strtod_buggy=1 export ac_cv_func_strtod=yes ./configure --prefix=${INSTALL_3RDPARTY_DIR} make clean make -j4 make install popd #TCLBUILD #: << TKBUILD # build tk pushd ${TK_DIR}/unix ./configure --prefix=${INSTALL_3RDPARTY_DIR} \ --with-cflags="-O2" \ --with-tcl=${INSTALL_3RDPARTY_DIR}/lib \ --with-tcllib=${INSTALL_3RDPARTY_DIR}/lib \ --x-includes=/usr/include/X11 \ --x-libraries=/usr/lib/X11/ make clean make -j4 make install popd #TKBUILD popd # : << OCCTBUILD INSTALL_DIR=${CURRENT_DIR}/install/arm if [ ! -x "build_arm" ];then mkdir build_arm fi # fontconfig/fontconfig.h: No such file or directory # sudo apt-get install libfontconfig1-dev # fatal error: GL/glx.h: No such file or directory # sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev pushd build_arm rm -irf * cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ -DBUILD_MODULE_Draw=OFF \ -D3RDPARTY_FREETYPE_INCLUDE_DIRS=${DEPEND_3RDPARTY_DIR}/install/include \ -D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2=${DEPEND_3RDPARTY_DIR}/install/include \ -D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build=${DEPEND_3RDPARTY_DIR}/install/include/freetype2 \ -D3RDPARTY_FREETYPE_LIBRARY_DIR=${DEPEND_3RDPARTY_DIR}/install/lib \ -D3RDPARTY_FREETYPE_LIBRARY=${DEPEND_3RDPARTY_DIR}/install/lib \ .. make -j6 && make install popd # OCCTBUILD
测试问题
- 安装依赖
- 报错couldn’t find RGB GLX visual or fbconfig
sudo apt install -y libgl1-mesa-glx libgl1-mesa-dri libglx-mesa0 sudo apt install -y mesa-utils mesa-utils-extra
- 测试glx是否可用
glxinfo -v
文章来源:https://www.toymoban.com/news/detail-756523.html
到了这里,关于OCCT ARM版本编译及安装的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!