Open CASCADE Technology
7.5.0
|
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://opencascade.com/content/3rd-party-components. On Linux and OS X, it is recommended to use the version installed in the system natively.
This document presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform. It is assumed that you are already familiar with MS Visual Studio / Visual C++.
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of run-time binaries.
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
There are two types of third-party products used by OCCT:
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, c:\occ3rdparty).
Further in this document, this folder is referred to as 3rdparty.
Tcl/Tk is required for DRAW test harness.
Installation from sources: Tcl
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
Edit the line "call ... vcvars32.bat" to have correct path to the version of Visual Studio to be used for building, for instance:
call "%VS80COMNTOOLS%\vsvars32.bat"
If you are building 64-bit version, set environment accordingly, e.g.:
call "%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
set INSTALLDIR=D:\OCCT\3rdparty\tcltk-86-32
nmake -nologo -f makefile.vc release htmlhelp install %1
Edit file rules.vc replacing line
SUFX = tsgx
by
SUFX = sgx
This is to avoid extra prefix 't' in the library name, which is not recognized by default by OCCT build tools.
In the command prompt, run buildall.vc.bat
You might need to run this script twice to have tclsh executable installed; check subfolder bin of specified installation path to verify this.
> cd D:\OCCT\3rdparty\tcltk-86-32\bin > cp tclsh86.exe tclsh.exe
Installation from sources: Tk
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
Apply the same steps as described for building Tcl above, with the same INSTALLDIR. Note that Tk produces its own executable, called wish.
You might need to edit default value of TCLDIR variable defined in buildall.vc.bat (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
FreeType is required for text display in a 3D viewer. You can download its sources from https://sourceforge.net/projects/freetype/files/
Build the freetype project.
As a result, you will get a freetype import library (.lib) in the freetype\obj\win32\vc20xx folder.
If you build FreeType for a 64 bit platform, select in the main menu Build - Configuration Manager and add x64 platform to the solution configuration by copying the settings from Win32 platform:
Update the value of the Output File for x64 configuration:
Build the freetype project.
As a result, you will obtain a 64 bit import library (.lib) file in the freetype\x64\vc20xx folder.
To build FreeType as a dynamic library (.dll) follow steps 6, 7 and 8 of this procedure.
Edit file freetype\include\freetype\config\ftoption.h:
in line 255, uncomment the definition of macro FT_EXPORT and change it as follows:
#define FT_EXPORT(x) __declspec(dllexport) x
Build the freetype project.
As a result, you will obtain the files of the import library (.lib) and the dynamic library (.dll) in folders freetype \objs\release or \objs\debug .
If you build for a 64 bit platform, follow step 5 of the procedure.
To facilitate the use of FreeType libraries in OCCT with minimal adjustment of build procedures, it is recommended to copy the include files and libraries of FreeType into a separate folder, named according to the pattern: freetype-compiler-bitness-building mode, where:
The include subfolder should be copied as is, while libraries should be renamed to freetype.lib and freetype.dll (suffixes removed) and placed to subdirectories lib *and *bin, respectively. If the Debug configuration is built, the Debug libraries should be put into subdirectories libd and bind.
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb. Go to the Download page, find the release version you need (e.g. tbb30_018oss) and pick the archive for Windows platform.
Unpack the downloaded archive of TBB product into the 3rdparty folder.
Further in this document, this folder is referred to as tbb.
This third-party product should be built as a dynamically loadable library (.dll file). You can download its sources from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
Unpack the downloaded archive of FreeImage product into 3rdparty folder.
As a result, you should have a folder named 3rdparty\FreeImage.
Rename it according to the rule: freeimage-platform-compiler-building mode, where
Further in this document, this folder is referred to as freeimage.
Open the solution file freeimage\FreeImage..sln* in your Visual Studio.
If you use a Visual Studio version higher than VC++ 2008, apply conversion of the workspace. Such conversion should be suggested automatically by Visual Studio.
Select a configuration to build.
Note:
If you want to build a debug version of FreeImage binaries then you need to rename the following files in FreeImage and FreeimagePlus projects:
Project -> Properties -> Configuration Properties -> Linker -> General -> Output File
FreeImage*d*.dll to FreeImage.dll FreeImagePlus*d*.dll to FreeImagePlus.dll
Project -> Properties -> Configuration Properties -> Linker -> Debugging-> Generate Program Database File
FreeImage*d*.pdb to FreeImage.pdb FreeImagePlus*d*.pdb to FreeImagePlus.pdb
Project -> Properties -> Configuration Properties -> Linker -> Advanced-Import Library
FreeImage*d*.lib to FreeImage.lib FreeImagePlus*d*.lib to FreeImagePlus.lib
Project -> Properties -> Configuration Properties -> Build Events -> Post -> Build Event -> Command Line
FreeImage*d*.dll to FreeImage.dll FreeImage*d*.lib to FreeImage.lib FreeImagePlus*d*.dll to FreeImagePlus.dll FreeImagePlus*d*.lib to FreeImagePlus.lib
Additionally, rename in project FreeImagePlus
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
from FreeImage*d*.lib to FreeImage.lib
Start the building process.
As a result, you should have the library files of FreeImage product in freeimage\Dist folder (FreeImage.dll and FreeImage.lib) and in freeimage\Wrapper\FreeImagePlus\dist folder (FreeImagePlus.dll and FreeImagePlus.lib).
VTK is an open-source, freely available software system for 3D computer graphics, image processing and visualization. VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into 3rdparty folder.
As a result, you will get a folder named, for example, 3rdparty\VTK-6.1.0.
Further in this document, this folder is referred to as VTK.
This document presents additional guidelines for building third-party products used by Open CASCADE Technology and samples on Linux platform.
The links for downloading the third-party products are available on the web site at https://opencascade.com/content/3rd-party-components.
There are two types of third-party products, which are necessary to build OCCT:
Tcl/Tk is required for DRAW test harness.
Installation from sources: Tcl
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
cd TCL_SRC_DIR/unix
Run the configure command:
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add –enable-64bit option to the command line.
make
make install
Installation from sources: Tk
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
cd TK_SRC_DIR/unix
Run the configure command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib.
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
For a 64 bit platform also add –enable-64bit option to the command line.
make
make install
FreeType is required for text display in the 3D viewer. Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
cd FREETYPE_SRC_DIR
Run the configure command:
configure --prefix=FREETYPE_INSTALL_DIR
For a 64 bit platform also add CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC' option to the command line.
make
make install
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb. Go to the Download page, find the release version you need and pick the archive for Linux platform. To install, unpack the downloaded archive of TBB product.
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/ and unpack it. The directory with unpacked sources is further referred to as FREEIMAGE_SRC_DIR.
#include string.h
cd FREEIMAGE_SRC_DIR
make
Run the installation process
a. If you have the permission to write into directories /usr/include and /usr/lib, run the following command:
make install
b. If you do not have this permission, you need to modify file FREEIMAGE_SRC_DIR/Makefile.gnu:
Change lines 7-9 from:
DESTDIR ?= / INCDIR ?= $(DESTDIR)/usr/include INSTALLDIR ?= $(DESTDIR)/usr/lib
to:
DESTDIR ?= $(DESTDIR) INCDIR ?= $(DESTDIR)/include INSTALLDIR ?= $(DESTDIR)/lib
Change lines 65-67 from:
install -m 644 -o root -g root $(HEADER) $(INCDIR) install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR) install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
to:
install -m 755 $(HEADER) $(INCDIR) install -m 755 $(STATICLIB) $(INSTALLDIR) install -m 755 $(SHAREDLIB) $(INSTALLDIR)
Change line 70 from:
ldconfig
to:
\#ldconfig
Then run the installation process by the following command:
make DESTDIR=FREEIMAGE_INSTALL_DIR install
make clean
You can download VTK sources from https://www.vtk.org/VTK/resources/software.html
Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it.
ccmake VTK_SRC_DIR
make
make install
Debian-based distributives
All 3rd-party products required for building of OCCT could be installed from official repositories. You may install them from console using apt-get utility:
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libxt-dev libxmu-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libfreeimage-dev libtbb-dev
To launch binaries built with WOK you need to install C shell and 32-bit libraries on x86_64 distributives:
# you may need to add i386 if not done already by command "dpkg --add-architecture i386" sudo apt-get install csh libstdc++6:i386 libxt6:i386 libxext6:i386 libxmu6:i386
Building is possible with C++ compliant compiler:
sudo apt-get install g++
This document presents additional guidelines for building third-party products used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
There are two types of third-party products, which are necessary to build OCCT:
Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
Installation from sources: Tcl 8.5
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
cd TCL_SRC_DIR/macosx
Run the configure command
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add –enable-64bit option to the command line.
make
make install
Installation from sources: Tk 8.5
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
cd TK_SRC_DIR/macosx
Run the configure command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
For a 64 bit platform also add –enable-64bit option to the command line.
make
make install
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
cd FREETYPE_SRC_DIR
Run the configure command
configure --prefix=FREETYPE_INSTALL_DIR
For a 64 bit platform also add CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC' option to the command line.
make
make install
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb. Go to the Download page, find the release version you need (e.g. tbb30_018oss) and pick the archive for Mac OS X platform. To install, unpack the downloaded archive of TBB 3.0 product (tbb30_018oss_osx.tgz).
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/ and unpack it. The directory with unpacked sources is further referred to as FREEIMAGE_SRC_DIR.
Note that for building FreeImage on Mac OS X 10.7 you should replace Makefile.osx in FREEIMAGE_SRC_DIR by the corrected file, which you can find in attachment to issue #22811 in OCCT Mantis bug tracker (https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug).
If you build FreeImage 3.15.x you can skip this step. Modify FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:
In line 60 insert the following:
#include string.h
Modify FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp:
In line 320 replace:
SwapShort(value);
with:
SwapShort(&value);
cd FREEIMAGE_SRC_DIR
make
make install
If you do not have this permission, you need to modify file FREEIMAGE_SRC_DIR/Makefile.osx:
Change line 49 from:
PREFIX ?= /usr/local
to:
PREFIX ?= $(PREFIX)
Change lines 65-69 from:
install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR) install -m 644 -o root -g wheel $(HEADER) $(INCDIR) install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR) ranlib -sf $(INSTALLDIR)/$(STATICLIB) ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
to:
install -d $(INCDIR) $(INSTALLDIR) install -m 755 $(HEADER) $(INCDIR) install -m 755 $(STATICLIB) $(INSTALLDIR) install -m 755 $(SHAREDLIB) $(INSTALLDIR) ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME) ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
Then run the installation process by the following command:
make PREFIX=FREEIMAGE_INSTALL_DIR install
make clean