Skip to content

Commit

Permalink
minor changes in INSTALL and README
Browse files Browse the repository at this point in the history
  • Loading branch information
tpaviot committed Oct 25, 2023
1 parent f3010c4 commit c8f1d57
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
43 changes: 23 additions & 20 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,41 @@ pythonOCC-7.7.2 needs the following libraries or programs to be installed before
can compile/use it:

* the python programming language (<https://www.python.org>). Python 3.8 or more is required.

* OpenCascade 7.7.2 (<https://dev.opencascade.org>)

* SWIG 4.1.1 (<https://www.swig.org>)

* rapidjson (<https://rapidjson.org/>) for Gltf import/export

* cmake

All the necessary libraries can be downloaded/installed using apt:
```bash
$ sudo apt-get update
$ sudo apt-get install -y wget libglu1-mesa-dev libgl1-mesa-dev libxmu-dev libxi-dev build-essential cmake libfreetype6-dev tk-dev python3-dev rapidjson-dev python3 git python3-pip libpcre2-dev
sudo apt-get update
sudo apt-get install -y wget libglu1-mesa-dev libgl1-mesa-dev libxmu-dev libxi-dev build-essential cmake libfreetype6-dev tk-dev python3-dev rapidjson-dev python3 git python3-pip libpcre2-dev
```

Build swig
----------
The required swgi version is 4.1.1. Unfortunately, the ubuntu ppa only provides an outdated 4.0.2 version. If swig 4.1.1 is not available on your machine, you have to download/build by yourself (depends on libpcre2, previously installed):
```bash
$ wget http://prdownloads.sourceforge.net/swig/swig-4.1.1.tar.gz
$ tar -zxvf swig-4.1.1.tar.gz
$ cd swig-4.1.1
$ ./configure && make -j4 && make install
wget http://prdownloads.sourceforge.net/swig/swig-4.1.1.tar.gz
tar -zxvf swig-4.1.1.tar.gz
cd swig-4.1.1
./configure && make -j4 && make install
```

Build OpenCascade
-----------------

Download/extract version 7.7.2 https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=cec1ecd0c9f3b3d2572c47035d11949e8dfa85e2;sf=tgz

```bash
$ wget -o occt-7.7.2.tgz https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=cec1ecd0c9f3b3d2572c47035d11949e8dfa85e2;sf=tgz
$ tar -zxvf occt-7.7.2.tgz
wget -o occt-7.7.2.tgz https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=cec1ecd0c9f3b3d2572c47035d11949e8dfa85e2;sf=tgz
tar -zxvf occt-7.7.2.tgz
```

Prepare the build stage:
```bash
$ cd occt-cec1ecd
$ mkdir cmake-build
$ cd cmake-build
cd occt-cec1ecd
mkdir cmake-build
cd cmake-build
```

Choose an installation destination. Default is /usr/local, but it is better to set up
Expand All @@ -57,8 +52,8 @@ $ cmake -DINSTALL_DIR=/opt/build/occt772 -DBUILD_RELEASE_DISABLE_EXCEPTIONS=OFF
```
then
```bash
$ make -j4
$ sudo make install
make -j4
sudo make install
```
and finally add the libraries to the system
```bash
Expand All @@ -80,14 +75,22 @@ RUN cmake \
-DOCCT_INCLUDE_DIR=/opt/build/occt772/include/opencascade \
-DOCCT_LIBRARY_DIR=/opt/build/occt772/lib \
-DPYTHONOCC_BUILD_TYPE=Release \
..
-DPYTHONOCC_INSTALL_DIR=/where_to_install
..

RUN make -j4 && make install
```

Build pythonocc with numpy support
----------------------------------
numpy enables fast STL file loading. In order to benefit from this feature, you must install the numpy package (including the dev part), and compile pythonocc with:
```bash
-DPYTHONOCC_MESHDS_NUMPY=ON
```

simple test
-----------
```
```bash
$ python
>>> from OCC.Core.gp import gp_Pnt
>>> p = gp_Pnt(1., 2., 3.)
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![Azure Build Status](https://dev.azure.com/tpaviot/pythonocc-core/_apis/build/status/tpaviot.pythonocc-core?branchName=master)](https://dev.azure.com/tpaviot/pythonocc-core/_build?definitionId=2)
[![Downloads Badge](https://anaconda.org/conda-forge/pythonocc-core/badges/downloads.svg)](https://anaconda.org/conda-forge/pythonocc-core)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/tpaviot/pythonocc-core.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/tpaviot/pythonocc-core/context:python)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/67c121324b8d4f37bc27029464c87020)](https://www.codacy.com/app/tpaviot/pythonocc-core?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=tpaviot/pythonocc-core&amp;utm_campaign=Badge_Grade)
[![Binder](http://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/tpaviot/pythonocc-binderhub/7.7.2)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3605364.svg)](https://doi.org/10.5281/zenodo.3605364)
Expand All @@ -10,7 +9,6 @@ pythonocc-core

About
-----

pythonocc provides 3D modeling and dataexchange features. It is intended to CAD/PDM/PLM and BIM related development. It is based on the OpenCascade Technology modeling kernel.

Latest release: [pythonocc-core 7.7.2 (October 2023)](https://github.com/tpaviot/pythonocc-core/releases/tag/7.7.2)
Expand Down Expand Up @@ -47,7 +45,6 @@ Build from source
-----------------
Read the [INSTALL.md](https://github.com/tpaviot/pythonocc-core/blob/master/INSTALL.md) instructions where you find compilation instructions for all platforms.


Cite as
-------
pythonocc is widely used in the industrial and academic communities. It is registered as a Zenodo open caccess software (https://zenodo.org/record/7471333) and should be cited as:
Expand Down

0 comments on commit c8f1d57

Please sign in to comment.