Building Modules

 

Common pre-requisites.

Starting from Open CASCADE 5.1.2 Open CASCADE is certified with using STL implementation by the supported compilers. Nevertheless the source code can be rebuilt using other implementations (for example STLPort) but Open CASCADE S.A.S. did not undertake any certification actions on such implementations and therefore cannot guarantee reliable work with other implementations.

You need about 4 GB of free disk space to rebuild Open CASCADE. 

Before compilation, you need to build (or to install the binaries of) 3rd party libraries mentioned in Hardware and Software Requirements.

 

Rebuilding on Windows.

 

Attention:

Rebuilding on Windows with MS Visual Studio project files.

The directory ros/adm/win32 contains two types of MS Visual Studio project files for MS VC++6.0 and VC++7.1 or VC++8.0 that you can use to rebuild Open CASCADE using either VC++6.0, VC++7.1 or VC++8.0 correspondingly. Each of them describes and builds one toolkit (.dll) or executable (.exe). They are designed to compile sources and to search include files in a directory structure created from downloaded archives. All these projects are gathered in workspaces corresponding to Open CASCADE modules.

 

The workspaces are listed below and must be rebuilt in accordance with that order. Inside every workspace there is a primary virtual project, called All, that should be used to rebuild all projects belonging to a workspace.

 

Below is the ordered list of workspaces to rebuilt.

Where * is dsw for VC++ 6.0 or sln for VC++ 7.1 and VC++8.0

 

Rebuilding on Windows with the nmake command.

Apart from MS Visual Studio project files the directory ros/adm/win32 contains a set of *.mak files that allow to build OCCT modules and the whole OCCT using the nmake command.

Example:

nmake –f All.mak : This string allows to build the whole Open CASCADE.

nmake –f TKernel.mak : This string allows to build TKernel toolkit.

 

Rebuilding on Unix and Linux with WOK-derived scripts.

On Unix and Linux each module can be rebuilt with a file named <module>.COMP located in the $CASROOT/adm/platform/ directory where platform is a result of the uname command. 

Attention:

Example:

cd $CASROOT/adm/Linux
csh -f FoundationClasses.COMP 

 

Rebuilding on Unix and Linux with autoconf, automake and libtool scripts.

Attention:

On Unix and Linux Open CASCADE can be also rebuilt using scripts based on GNU autoconf, automake and libtool. New corrected scripts have been placed in the $CASROOT/adm/make/... folders.

Set the environment variables CC to an ANSI C compiler, and CXX to your C++ compiler. If you are using GNU GCC, you can skip this step. If you have a Java compiler installed, add the include path for it to the CXXFLAGS environment variable. Although this is not required, it can be helpful for additional reliability. In many instances the same option must be passed to the link as well, do that by setting LDFLAGS.

Now use the ./configure with the correct option as described below.

--with-tcl=/path-where-tcl-is-installed :
for example --with-tcl=/usr/lib

--with-tk=/path-where-tk-is-installed :
for example --with-tk=/usr/lib

--with-gl-include=/path-where-gl-included-are-installed :
for example --with-gl-include=/usr/X11R6/include if GL/gl.h is located in /usr/X11R6/include


--with-gl-library=/path-where-gl- library-is-installed :
for example --with-gl-library=/usr/X11R6/lib if GL.so is located in this directory


--with-xmu-include=/path-where-xmu-included-ar-defined :
for example --with-xmu-include=/usr/X11/R6/include if /X11/Xmu/Xmu.h is located in /usr/X11R6/include

--with-xmu-library=/path-where-xmu-library-is-installed :
for example --with-xmu-library=/usr/X11R6/lib

--with-dps-include=/path-where-dps-included-ar-defined :
for example --with-dps-include=/usr/X11/R6/include/X11 if /DPS/dpsXclient.h is located in /usr/X11R6/include/X11


--with-dps-library=/path-where-xmu-library-is-installed :
for example --with-dps-library=/usr/X11R6/lib

--with-java-include=/path-where-java-included-are-istalled :
for example --with-java-include=/usr/java/include if jni.h is located in /usr/java/include

--enable-static=yes if you want to generate static library
--enable-shared=no if you don't want to generate shared library by default only shared library are built.

--enable-debug=yes/no - building in debug mode (yes: set -g key of compiler).
--enable-production=yes/no - building in optimase mode  (yes: set -O key of compiler).

for example :
./configure --with-tcl=/usr/lib --with-tk=/usr/lib --with-gl-include=/usr/X11R6/include --with-gl-library=/usr/X11R6/lib
--with-xmu-include=/usr/X11R6/include --with-xmu-library=/usr/X11R6/lib
--with-dps-include=/usr/X11R6/include/X11 --with-dps-library=/usr/X11R6/lib --prefix=/opt/OpenCASCADE

If configure exits successfully, you can then build all of Open CASCADE with the ./make command.