Building 3rd party libraries and tools

Open CASCADE uses a number of 3rd party libraries, both for functionality and for demo purposes.
Starting with version 6.4, this number has considerably grown and represents a challenge for a developer who needs to rebuild Open CASCADE. Some 3rd party libraries are available in both binary and source codes, some - in source code only thus requiring its rebuild, as Open CASCADE does not redistribute headers (and export libraries on Windows).

The list of required 3rd party libraries is provided in Open CASCADE documentation and online.

Note that some of the prerequisites do not even support configurations which are supported by Open CASCADE, e.g. Visual Studio 2010 and/or 64 bit modes. So many of them may not build out of the box. Many of them also provides terrible developer's experience with respect to build steps (e.g. obsolete Visual Studio project files, hard-coded paths, etc) requiring efforts to overcome this. This page is aimed at providing some recommendations on how to speed up this build process.

If you believe some steps can be simplified please suggest recommendations and update this page.

GNU Make

GNU Make is used to build FreeType.

Windows

  • Download version 3.80 or later.
  • Unzip into some directory (e.g. C:\DevTools\gmake\3.82)
  • Open Visual Studio prompt (e.g. Visual Studio 2005)
  • cd C:\DevTools\gmake\3.82
  • nmake /f NMakefile

This will build make.exe in .\WinRel and .\WinDebug directories.

  • Add C:\DevTools\gmake\3.82\WinRel to %PATH%

Unix (including Linux and MacOS)

Presumably nothing is required as GNU make is normally already pre-installed. Check that version is 3.80 or newer by typing 'make -v' in command prompt.

CMake

CMake is used to build GL2PS.

Windows

  • Download version 2.8.3. You may download binaries or source code and rebuild it. The below notes explain how to use binaries.
  • Unzip into some directory (e.g. C:\DevTools\cmake\2.8.3).
  • Add C:\DevTools\cmake\2.8.3\bin to %PATH%

Unix

(To be added)

FreeImage

Download the source code from http://freeimage.sourceforge.net/download.html.

Windows

  • Unzip into some directory (e.g. C:\DevTools\FreeImage\3.15.0-win32-vc8)
  • Launch Visual Studio and open respective solution file (available are Visual Studio 2005 and 2008)
  • Build in Release mode
  • The header, lib and dll files are located in ./Dist and ./Wrapper/FreeImagePlus/dist.

Unix

(To be added)

FreeType

Download the source code from http://sourceforge.net/projects/freetype/files.

Windows

  • Unzip into some directory (e.g. C:\DevTools\FreeType\2.4.4-win32-vc8)
  • Launch Visual Studio command prompt (e.g. Visual Studio 2005)
  • Make sure your %PATH% contains a path to GNU make
  • cd C:\DevTools\FreeType\2.4.4-win32-vc8
  • make setup visualc
  • make
  • make clean

FreeType is built as a static library freetype.lib located in ./objs.

Otherwise, you may use Visual Studio project files in ./builds/compiler/vc2005 or 2008 to build different configurations. Per documentation project files can be not up-to-date (though they seem to build the library just fine).

Unix

(To be added)

FTGL

FTGL seems to be no longer supported. The latest version (2.1.3rc5) is called release candidate and is dated 2008. Open CASCADE 6.4.x has been tested against 2.1.2.
Download the source code from http://sourceforge.net/projects/ftgl/files.

Windows

  • Unzip into some directory (e.g. C:\DevTools\ftgl\2.1.2-win32-vc8)
  • Edit the .dsp files in the win32_vcpp directory:
    • replace freetype204*.lib (e.g. freetype204MT_D.lib) with freetype.lib. In general case this must be the name of the FreeType library - either static or respective dynamic library name (see section on FreeType above).
  • Launch Visual Studio IDE and open the .dsw (or ftgl_dll.dsp only) file and convert to new Visual Studio project files.
  • Build all configurations (e.g. using Batch Build).

The .lib and .dll files will be output into ./win32_vcpp/build directory. You will need to use those which have _MTD[_d] in their names (e.g. ftgl_dynamic_MTD.dll). They are built with /MD or /MDd (for debug) options and dynamically link to run-time libraries.

Unix

(To be added)

GL2PS

Download the source code from http://geuz.org/gl2ps.

Windows

  • Unzip to some directory (e.g. C:\DevTools\gl2ps\1.3.5-win32-vc8)
  • Open command prompt
  • Make sure your %PATH% contains a path to cmake (see above).
  • cd C:\DevTools\gl2ps\1.3.5-win32-vc8
  • cmake -D CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release -G "Visual Studio 8 2005" .

This will generate project files for Visual Studio 2005 for two configurations - Debug and Release. For other generators, launch cmake without arguments and see which are available. Omit CMAKE_CONFIGURATION_TYPES to have all default configurations produced by cmake.

  • Launch Visual Studio and open the .sln file.
  • Build the shared project in Release and Debug modes. It seems that the lib and shared projects try to write the .lib file into the same directory, so avoid building the ALL_BUILD project.

The M_PI symbol may be not declared on your compiler. If you get an error during compilation add the following into gl2ps.c after the last #include:

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

Unix

(To be added)

Intel Threading Building Blocks (TBB)

If you are a commercial customer of Intel TBB or other products containing it (e.g. Parallel Studio) then you already have it in your environment.
Otherwise download the Open Source version from http://threadingbuildingblocks.org. You may download both source and binary code. If you prefer to use pre-built binaries you will not need the following steps.

Windows

  • Unzip to some directory (e.g. C:\DevTools\tbb\3.0.5)
  • Open Visual Studio command prompt
  • Make sure your %PATH% contains a path to GNU make (see above).
  • cd C:\DevTools\tbb\3.0.5
  • make arch=ia32 tbb_build_prefix=win32_vc8

For 64 bit configuration, open Visual Studio command prompt for Win64 and type:

  • make arch=intel64 tbb_build_prefix=win64_vc8

tbb_build_prefix is optional and specifies the directory which will contain binaries.

Unix

Same as for Windows.

Qt

Qt is only needed to run Qt-based examples shipped with Open CASCADE.
Download Qt Open Source version from http://qt.nokia.com.

Windows

  • Unzip to some directory (e.g. C:\DevTools\qt\4.7.1-win32-vc8)
  • Open Visual Studio command prompt
  • configure.exe —help

This will display available options and their default values.

  • run configure.exe adding (if needed) options you want to specify, e.g. configure.exe -D _USE_RTM_VERSION -opensource -debug-and-release -fast -no-accessibility -no-sql-sqlite -no-qt3support -no-phonon -no-phonon-backend -no-webkit -no-scripttools -no-libmng -no-openssl -no-dbus -no-stl -no-xmlpatterns -no-multimedia -no-audio-backend -qt-libpng -qt-libjpeg -qt-libtiff
  • nmake
  • nmake clean
  • set QTDIR in Control Panel and add %QTDIR%\bin to %PATH%

Unix

(To be added)

Java

Windows

(To be added)

Unix

(To be added)

Tcl

Windows

(To be added)

Unix

(To be added)