1 Building 3rd-party libraries on Linux {#occt_dev_guides__building_3rdparty_linux}
6 @section dev_guides__building_3rdparty_linux_1 Introduction
8 This document presents additional guidelines for building third-party
9 products used by Open CASCADE Technology and samples on Linux platform.
11 The links for downloading the third-party products are available on the web site
12 of OPEN CASCADE SAS at
13 http://www.opencascade.org/getocc/require/.
15 There are two types of third-party products, which are necessary to build OCCT:
19 * FreeType 2.4.10 - 2.4.11;
22 * gl2ps 1.3.5 - 1.3.8;
23 * FreeImage 3.14.1 - 3.15.4.
25 @section dev_guides__building_3rdparty_linux_2 Building Mandatory Third-party Products
27 @subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
29 Tcl/Tk is required for DRAW test harness.
31 @subsubsection dev_guides__building_3rdparty_linux_2_1_1 Installation from binaries:
33 It is possible to download ready-to-install binaries from
34 http://www.activestate.com/activetcl/downloads
36 1. Download the binaries archive and unpack them to a directory, which is further referred to as *TCL_SRC_DIR*.
37 2. Enter the directory *TCL_SRC_DIR*.
41 3. Run the install command:
45 and follow the instructions.
47 @subsubsection dev_guides__building_3rdparty_linux_2_1_2 Installation from sources: Tcl
49 Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
51 1. Enter the unix sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
55 2. Run the *configure* command:
57 configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
59 For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
61 3. If the configure command has finished successfully, start the building process:
65 4. If building is finished successfully, start the installation of Tcl.
66 All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*
70 @subsubsection dev_guides__building_3rdparty_linux_2_1_3 Installation from sources: Tk
72 Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
74 1. Enter the unix sub-directory of the directory where the Tk source files are located <i>(TK_SRC_DIR)</i>
78 2. Run the configure command, where <i>TCL_LIB_DIR</i> is *TCL_INSTALL_DIR/lib*.
80 configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
82 For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
84 3. If the configure command has finished successfully, start the building process:
88 4. If the building has finished successfully, start the installation of Tk.
89 All binary and service files of the product will be copied
90 to the directory defined by *TK_INSTALL_DIR* (usually it is *TCL_INSTALL_DIR*)
94 @subsection dev_guides__building_3rdparty_linux_2_2 FreeType
96 FreeType is required for text display in the 3D viewer.
97 Download the necessary archive from http://sourceforge.net/projects/freetype/files/ and unpack it.
99 1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
103 2. Run the *configure* command:
105 configure --prefix=FREETYPE_INSTALL_DIR
107 For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
109 3. If the *configure* command has finished successfully, start the building process:
113 4. If the building has finished successfully, start the installation of FreeType.
114 All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*
118 @section dev_guides__building_3rdparty_linux_3 Building Optional Third-party Products
120 @subsection dev_guides__building_3rdparty_linux_3_1 TBB
122 This third-party product is installed with binaries from the archive that can be downloaded from http://threadingbuildingblocks.org.
123 Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
124 To install, unpack the downloaded archive of TBB product.
126 @subsection dev_guides__building_3rdparty_linux_3_2 gl2ps
128 Download the necessary archive from http://geuz.org/gl2ps/ and unpack it.
130 1. Install or build *cmake* product from the source file.
131 2. Start *cmake* in GUI mode with the directory where the source files of gl2ps are located:
135 * Press <i>[c]</i> to make the initial configuration;
136 * Define the necessary options in *CMAKE_INSTALL_PREFIX*
137 * Press <i>[c]</i> to make the final configuration
138 * Press <i>[g]</i> to generate Makefile and exit
140 or just run the following command:
142 cmake –DCMAKE_INSTALL_PREFIX=GL2PS_INSTALL_DIR –DCMAKE_BUILD_TYPE=Release
144 3. Start the building of gl2ps:
148 4. Start the installation of gl2ps. Binaries will be installed according to the *CMAKE_INSTALL_PREFIX* option.
152 @subsection dev_guides__building_3rdparty_linux_3_3 FreeImage
154 Download the necessary archive from http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
155 and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
157 1. Modify *FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h*:
158 In line 60 insert the following:
162 2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
166 3. Run the building process
170 4. Run the installation process
172 a. If you have the permission to write into directories <i>/usr/include</i> and <i>/usr/lib</i>, run the following command:
175 b. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.gnu*:
177 Change lines 7-9 from:
180 INCDIR ?= $(DESTDIR)/usr/include
181 INSTALLDIR ?= $(DESTDIR)/usr/lib
185 DESTDIR ?= $(DESTDIR)
186 INCDIR ?= $(DESTDIR)/include
187 INSTALLDIR ?= $(DESTDIR)/lib
189 Change lines 65-67 from:
191 install -m 644 -o root -g root $(HEADER) $(INCDIR)
192 install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
193 install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
197 install -m 755 $(HEADER) $(INCDIR)
198 install -m 755 $(STATICLIB) $(INSTALLDIR)
199 install -m 755 $(SHAREDLIB) $(INSTALLDIR)
209 Then run the installation process by the following command:
211 make DESTDIR=FREEIMAGE_INSTALL_DIR install
213 5. Clean temporary files
217 @subsection dev_guides__building_3rdparty_linux_3_4 OpenCL ICD Loader
219 If you have OpenCL SDK (one provided by Apple, AMD, NVIDIA, Intel, or other
220 vendor) installed on your system, you should find OpenCL headers and
221 libraries required for building OCCT inside that SDK.
223 Alternatively, you can use OpenCL ICD (Installable Client Driver) Loader
224 provided by Khronos group. The following describes steps used to build OpenCL
225 ICD Loader version 1.2.11.0.
227 1. Download OpenCL ICD Loader sources archive and OpenCL header files from
228 Khronos OpenCL Registry
229 http://www.khronos.org/registry/cl/
231 2. Unpack the archive and put headers in *inc/CL* sub-folder
233 3. Print *make* in the root of the unpacked archive to compile OpenCL libraries.
235 4. Create installation folder for OpenCL IDL Loader package and put there:
237 1. OpenCL header files in *include/CL* subfolder
239 2. *libOpenCL.so* (generated in *bin* subfolder of source package) in *lib* subfolder
241 @section dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
243 @subsection dev_guides__building_3rdparty_linux_4_1 Debian-based distributives
245 All 3rd-party products required for building of OCCT could be installed
246 from official repositories. You may install them from console using apt-get utility:
248 sudo apt-get install \
249 tcllib tklib tcl-dev tk-dev \
251 libxt-dev libxmu-dev \
257 To launch binaries built with WOK you need to install C shell and 32-bit libraries on x86_64 distributives:
259 sudo apt-get install \
261 libstdc++5:i386 libxt6:i386
263 Building is possible with any C++ compliant compiler :
265 sudo apt-get install \