Building Modules

Source package

Starting from Open CASCADE 6.3 the source package of the proper 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 different formats for experiments with Open CASCADE functionality

doc - This folder contains Open CASCADE documentation;

doc/Overview - This folder contains Open CASCADE Overview documentation;

doc/ReferenceDocumentation - This folder contains Open CASCADE reference documentation generated by doxygen;

doc - This folder contains Open CASCADE Overview documentation;

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

ros/adm/win32 - This folder contains Visual Studio workspace for Visual C++ 6.0, 7.1 and 8.0, which allows rebuilding Open CASCADE under Windows platform in 32 bit mode.

ros/adm/win64 - This folder contains Visual Studio workspace for Visual C++ 8.0, which allows rebuilding Open CASCADE under Windows platform in 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 Open CASCADE header files;

ros/src - This folder contains Open CASCADE 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.

Starting from Open CASCADE 5.1.2, Open CASCADE Technology 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 Technology.

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:

- Libraries (dll ,dlld ,lib and libd) and executable (exe) files built by MS Visual Studio projects on Windows platform, are now placed to the ros/win32 (ros/win64 for 64-bit) folder and replace their corresponding original libraries and executable files.

- Before compilation, you must define a path (menu Tools/Option, tab Directories of MS Visual Studio) to the include and library files of Tcl, Tk, Tix and have Java installed on your station. For building samples and tools make sure paths to Qt and Fltk are also added.

- When building Open CASCADE Technology libraries from sources on Windows NT platform, the macro USE_OLD_STREAMS can be defined to enforce it using the old-style streams library rather than new (STL) streams (by default).

Rebuilding on Windows with MS Visual Studio project files.

Staring from Open CASCADE 6.3 ros/adm/win32 folder contains vc6, vc7 and vc8 folders with MS Visual Studio project files for MS VC++6.0 , 7.1 and 8.0 correspondingly that can be used to rebuild Open CASCADE Technology in 32 bit mode. New ros/adm/win64 folder contains vc8 folder with MS Visual Studio project files for MS VC++8.0 that you can use to rebuild Open CASCADE Technology in 64 bit mode.

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 Technology 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.

- Foundation Classes (file FoundationClasses.*)

- Modeling Data (file ModelingData.*)

- Modeling Algorithms (file ModelingAlgorithms.*)

- Visualization (file Visualization.*)

- Application Framework (file ApplicationFramework.*)

- Data Exchange (file DataExchange.*)

- Draw (file Draw.*)

- WOK (file WOK.*)

- Wrappers (file Wrappers.*)

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

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

Attention

During the compilation by makefiles on Mandrake 10.1 OS 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

On Unix Open CASCADE can be also rebuilt using scripts based on GNU autoconf, automake and libtool. New improved scripts are located 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-are-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-are-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-installed :
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).

Additional flags:

--disable-draw - allows Open CasCade building without Draw.

--disable-wok - allows Open CasCade building without WOK.

--disable-wrappers - allows Open CasCade building without JCas (Wrappers).

If you want to build Draw, Wok or Jcas please define the following flags:

For Draw - --enable-draw=yes --with-tcl=/path-where-tcl-is-installed --with-tk=/path-where-tk-is-installed

For Wok - --enable-wok=yes --with-tcl=/path-where-tcl-is-installed --with-tk=/path-where-tk-is-installed

For Jcas - --enable-wrappers=yes --with-java-include=/path-where-java-included-are-istalled

Attention: 64-bit platforms are detected automatically.

Example:

The ./configure should be executed with the flags depending on the type of UNIX platform as described below:

flags="--with-gl-include=/usr/include --with-gl-library=/usr/lib"

flags="$flags --with-xmu-include=/usr/X11R6/include/X11"

flags="$flags --with-xmu-library=/usr/X11R6/lib"

flags="$flags --with-tcl=${TCLHOME}/lib"

flags="$flags --with-tk=${TCLHOME}/lib "

flags="$flags --disable-debug --enable-production"

flags="$flags --enable-wrappers=no”

flags="$flags --enable-wok=no”

flags="$flags --enable-draw=yes”

./configure $flags --prefix=${INSTALL_DIR}

where ${INSTALL_DIR} is the folder to which Open CASCADE Technology will be installed.

If configure exits successfully, you can build Open CASCADE Technology with the make command.

make install command will install Open CASCADE Technology in usable form without any additional operations.