Building Modules

 

Source package

 

The source package of the Open CASCADE Technology including the source files of samples and tools and the set of building procedures is available for self-dependent preparation binary files on UNIX and Windows platforms.

 

The building tools are delivered in the form of Visual C++ Projects for Windows platform and a Makefile procedure for Unix platform.

 

Description of the Directory Tree

data - This folder contains files in various formats for experiments with OCCT functionality

doc - This folder contains OCCT documentation;

doc/Overview - This folder contains OCCT Overview documentation;

doc/ReferenceDocumentation - This folder contains OCCT Reference documentation generated by Doxygen;

ros/adm/make - This folder contains files of Makefile procedure, which allow rebuilding OCCT on Unix platforms;

ros/adm/msvc - This folder contains Visual Studio projects for Visual C++  2005, 2008 and 2010, which allow rebuilding OCCT under Windows platform in 32 and 64 bit mode.

ros/drv - This folder contains source files generated by WOK (private header files and instantiations of generic classes);

ros/inc - This folder contains all OCCT header files;

ros/src - This folder contains OCCT source files. They are organized in folders, one per development unit;

Samples - This folder contains source files and building procedure for Standard samples of applications and Tutorial (c# and mfc samples are applicable only for Windows platform);

 

 

 

 

Common pre-requisites.

Open CASCADE Technology is certified 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 2 GB of free disk space to rebuild Open CASCADE Technology. 

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

 

Rebuilding on Windows.

 

Attention:

gl2ps, TBB and FreeImage are optional products. To build Open CASCADE Technology with or without these products, use variable CSF_DEFINES to specify additional compiler macros:

Examples of definition in custom.bat file:

In env.bat file these definitions form the string

set CSF_DEFINES=;

 

In env.bat file these definitions form the string

set CSF_DEFINES=HAVE_TBB;HAVE_FREEIMAGE;HAVE_GL2PS

Rebuilding on Windows with MS Visual Studio project files.

ros/adm/msvc folder contains vc8, vc9 and vc10 folders with MS Visual Studio project files for MS VC 2005, 2008 and 2010 correspondingly that can be used to rebuild Open CASCADE Technology in 32 or 64 bit mode.

Each of them describes and builds one library (.dll) or executable (.exe). They are designed to compile sources and to search header files in a directory structure created from downloaded archives. All these projects are gathered in workspaces corresponding to OCCT modules.

 

The workspaces are listed below and must be rebuilt in accordance with that order.  

Below is the ordered list of workspaces to rebuild.

Additionally a common MS Visual Studio solution file OCCT.sln is provided. This solution comprises all OCCT projects and can be used for (re)building a complete set of OCCT libraries or separate OCCT module in one instance of Visual Studio.

 

Rebuilding on Linux with autoconf, automake and libtool scripts.

During the compilation by makefiles some Linux OS and on a station with NVIDIA video card you may experience problems because the installation procedure of NVIDIA video driver removes library libGL.so included in package libMesaGL from directory /usr/X11R6/lib and places this library libGL.so in directory /usr/lib. However, libtool expects to find the library in directory /usr/X11R6/lib, which causes compilation crash (See /usr/X11R6/lib/libGLU.la).
We suggest making links:

ln -s /usr/lib/libGL.so /usr/X11R6/lib/libGL.so
ln -s /usr/lib/libGL.la /usr/X11R6/lib/libGL.la

Attention: Before configure it is necessary to launch build_configure script to generate files configure and Makefile.in

Now use the ./configure with the correct options as described below:

./configure <FLAGS>

Where <FLAGS> is a set of the following directives:

--with-tcl=  defines location of tclConfig.sh

--with-tk=  defines location of tkConfig.sh

--with-freetype=  defines location of installed FreeType product

--with-ftgl=  defines location of installed Ftgl product

--with-gl2ps=  defines location of installed gl2ps product

--with-freeimage=  defines location of installed FreeImage product

--with-tbb-include= defines location of tbb.h

--with-tbb-library=  defines location of libtbb.so

--enable-debug=       yes: includes debug information

no: does not include debug information

--enable-production=   yes: switches code optimization

  no: switches off code optimization

--prefix= defines location for the installation of OCCT binaries

Additional flags:

--disable-draw - allows OCCT building without Draw.

Building without optional products:

Open CASCADE technology will be built without optional products if you will not define the following options:

–with-tbb-include=, –with-tbb-library= (without tbb),

--with-gl2ps= (without gl2ps)

--with-freeimage= (without freeimage)

 

Attention: 64-bit platforms are detected automatically.

 

Example:

> ./configure –prefix=/PRODUCTS/occt-6.5.3 --with-tcl=/PRODUCTS/tcltk-8.5.8/lib --with-tk=/PRODUCTS/tcltk-8.5.8/lib --with-freetype=/PRODUCTS/freetype-2.3.7 --with-ftgl=/PRODUCTS/ftgl-2.1.2 --with-gl2ps=/PRODUCTS/gl2ps-1.3.5 --with-freeimage=/PRODUCTS/freeimage-3.14.1 --with-tbb-include=/PRODUCTS/tbb30_018oss/include --with-tbb-library=/PRODUCTS/tbb30_018oss/lib/ia32/cc4.1.0_libc2.4_kernel2.6.16.21

If configure exits successfully, you can build OCCT with make command.

> make –j8 install