File: BUILD.Unix.md

package info (click to toggle)
oce 0.18.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 301,460 kB
  • sloc: cpp: 1,190,610; ansic: 67,225; sh: 11,667; tcl: 7,954; cs: 5,221; python: 2,867; java: 1,522; makefile: 344; xml: 292; perl: 37
file content (124 lines) | stat: -rw-r--r-- 3,430 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
This file describes how to build OCE from sources on Linux or MacOSX.

Since the OCE release 0.3, the dev team definitely dropped the autotools
support and adopted the CMake build system. First ensure you have installed
CMake 2.8 or higher (http://www.cmake.org) before going further in the
compilation process.

The installation procedure detailed below is:
 1. Download/extract the OCE-xxxxx.tar.gz archive to any directory
 2. Configure
 3. make/make install
 4. Test installation

## 1. Content extraction

Unpack OCE-xxxx.tar.gz to some folder - ${DISTRIBUTIVE_DIR}.
For example DISTRIBUTIVE_DIR=/tmp/OCE-0.16

    $ tar -zxvf OCE-xxxx.tar.gz

then

    $ cd  ${DISTRIBUTIVE_DIR}

## 2. Configure step

It is a good practice to build in a separate directory:

    $ mkdir build
    $ cd build

CMake can be configured either by a user interface (Qt and ncurses interfaces
are available) or directly by running

    $ cmake ..

and editing the generated CMakeCache.txt file.

In the former case, the most common options can be defined from the
main window, and expert options can be modified in selecting "Advanced"
mode.

In the latter case, it is also possible to define options on the
command line.  If you edit CMakeCache.txt by hand, do not forget to
rerun cmake after modifying this file.

### 2.1. Defining flags

Here are default flags on Unix:

    OCE_BUILD_SHARED_LIB        ON
    OCE_DATAEXCHANGE            ON
    OCE_DRAW                    OFF
    OCE_INSTALL_PREFIX          /usr/local
    OCE_MODEL                   ON
    OCE_MULTITHREAD_LIBRARY     NONE
    OCE_OCAF                    ON
    OCE_VISUALISATION           ON
    OCE_WITH_FREEIMAGE          OFF
    OCE_WITH_GL2PS              OFF

In order to modify installation path and build DRAWEXE, one
can run these commands:

    flags=""
    flags="$flags -DOCE_INSTALL_PREFIX:PATH=$HOME/oce"
    flags="$flags -DOCE_DRAW:BOOL=ON"
    cmake $flags ..

### 2.2. Expert options

More expert options can be defined in the "Advanced mode".

#### 2.2.1 Additional flags:

OCE can be compiled with TBB or OpenMP in order to support parallel meshing.
By default, this support is disabled.  Enable it with
 
    flags="$flags -DOCE_MULTITHREAD_LIBRARY:STRING=TBB"

or

    flags="$flags -DOCE_MULTITHREAD_LIBRARY:STRING=OPENMP"

There are many more options, see CMakeCache.txt for a full list.

# 3. Make step

If configure exits successfully, you can then build the whole OCE
by running the following commands:

    make
    make install/strip

If you have more than one (for instance 2) cores on your machine, you can use
 
    make -j2

to enable multiprocessed compilation and speedup the whole compilation
process.

If you enabled tests when configuring by passing -DOCE_TESTING:BOOL=ON
flag to CMake, you can now run our battery of tests:

    make test

All tests should pass except BRepMeshTestSuite.testMeshTorus, this test
exhibits a bug which has not been fixed yet.

# 4. Test installation: OCE Draw Test Harness

You can launch Draw Test Harness in order to experiment with OCE.
With OCE you normally do not have to set any environment variable.

Launch $INSTALL_DIR/bin/DRAWEXE executable; on prompt, type

    > pload ALL

In order to load DRAW commands, you can then run demos

    > source $INSTALL_DIR/src/DrawResources/ModelingDemo.tcl
    > source $INSTALL_DIR/src/DrawResources/VisualizationDemo.tcl

Installation is succesful. Enjoy!