Ubuntu源文件安装Open CASCADE(过来人心酸走过得坑)

一、背景:

由于gmsh需要使用到Open CASCADE来支持文件导入,所以需要安装Open CASCADE。但是在安装配置过程中,花了我整整一周多的时间,相当之痛苦。所以写一篇博客记录下来为大家做一个详细地教程,也方便以后自己回顾。废话不多说,上菜。

二、必备准备工作:

1.Open CASCADE的源码压缩包,下载地址:Download - Open CASCADE Technology

如果直接用浏览器下载可能会比较慢,建议使用谷歌下载,如果这里不会的话也只有慢慢等待了,或者找国内的镜像下载。我这里使用的是谷歌,其他方式我就不一一列举了,建议是官方下载最原始的压缩文件,是最全的。别的地方下载的可能会有些文件遗漏,导致后面安装的时候错误百出。

2.进入ubuntu终端命令行,依次输入一下四个命令(中间出现的(Y/N)全部输入Y),参考博文

sudo apt-get install software-properties-common
sudo apt-get install libtool autoconf automake gfortran gdebi
sudo apt-get install gcc-multilib libxi-dev libxmu-dev libxmu-headers
sudo apt-get install libx11-dev mesa-common-dev libglu1-mesa-dev
sudo apt-get install libfontconfig1-dev

3.继续在终端输入:

sudo apt-get install libfreetype6 libfreetype6-dev

4.继续在终端输入:

sudo apt-get install tcl tcl-dev tk tk-dev

5.解压 :

 tar -xvf opencascade-7.7.0.tgz 

6.进入源文件:

cd opencascade-7.7.0/

7.

mkdir build

8.

cd build

9.

ccmake ../

这里如果提示你没有ccmake ,就按照他给的提示进行安装即可。

我这里是:sudo apt  install cmake-curses-gui  # version 3.22.1-1ubuntu1.22.04.1

10.

cmake ../

11.

sudo make install

在这里很容易报错。一把都是什么库文件,头文件缺少什么的,按照给的error提示,找到相关文件进行添加头文件就行了,我这里的问题参考的我博客:《【已解决】error: ‘numeric_limits’ is not a member of ‘std’》

12.解决好后重新sudo make install ,等待完成。

13.

cd ..

14.

bash env.sh

**over**

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Open Cascade is a powerful open-source framework for 3D modeling and CAD/CAM/CAE applications. It provides a wide range of functionality for geometric modeling, visualization, and data exchange. However, Open Cascade does not have direct support for Python. If you want to use Open Cascade with Python, you can utilize the PyOCCT library. PyOCCT is a Python binding for Open Cascade, which allows you to access and utilize Open Cascade functionality through Python scripts. To get started with Open Cascade and Python, you need to follow these steps: 1. Install Open Cascade: Download and install the Open Cascade libraries from the official website (www.opencascade.com). Make sure to choose the appropriate version for your operating system. 2. Install PyOCCT: Once Open Cascade is installed, you can install the PyOCCT library using pip. Run the following command in your terminal: ``` pip install pythonocc-core ``` 3. Start coding: Now you can import the `occt` module in your Python script and start utilizing Open Cascade's functionality. Here's a simple example to create a box: ```python from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox from OCC.Display.SimpleGui import init_display box = BRepPrimAPI_MakeBox(10, 10, 10).Shape() display, start_display, add_menu, add_function_to_menu = init_display() display.DisplayShape(box) start_display() ``` This is just a basic example to get you started. Open Cascade provides a vast set of features, including advanced 3D modeling operations, meshing algorithms, and more. You can refer to the official Open Cascade documentation and PyOCCT's GitHub repository for more information and examples. Note: It's important to mention that PyOCCT is a separate project developed by the community and not officially maintained by the Open Cascade company.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值