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.com/content/3rd-party-components.
15 There are two types of third-party products, which are necessary to build OCCT:
19 * FreeType 2.4.10 - 2.5.3;
22 * gl2ps 1.3.5 - 1.3.8;
23 * FreeImage 3.14.1 - 3.16.0;
26 @section dev_guides__building_3rdparty_linux_2 Building Mandatory Third-party Products
28 @subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
30 Tcl/Tk is required for DRAW test harness.
32 @subsubsection dev_guides__building_3rdparty_linux_2_1_2 Installation from sources: Tcl
34 Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
36 1. Enter the unix sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
40 2. Run the *configure* command:
42 configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
44 For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
46 3. If the configure command has finished successfully, start the building process:
50 4. If building is finished successfully, start the installation of Tcl.
51 All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*
55 @subsubsection dev_guides__building_3rdparty_linux_2_1_3 Installation from sources: Tk
57 Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
59 1. Enter the unix sub-directory of the directory where the Tk source files are located <i>(TK_SRC_DIR)</i>
63 2. Run the configure command, where <i>TCL_LIB_DIR</i> is *TCL_INSTALL_DIR/lib*.
65 configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
67 For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
69 3. If the configure command has finished successfully, start the building process:
73 4. If the building has finished successfully, start the installation of Tk.
74 All binary and service files of the product will be copied
75 to the directory defined by *TK_INSTALL_DIR* (usually it is *TCL_INSTALL_DIR*)
79 @subsection dev_guides__building_3rdparty_linux_2_2 FreeType
81 FreeType is required for text display in the 3D viewer.
82 Download the necessary archive from http://sourceforge.net/projects/freetype/files/ and unpack it.
84 1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
88 2. Run the *configure* command:
90 configure --prefix=FREETYPE_INSTALL_DIR
92 For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
94 3. If the *configure* command has finished successfully, start the building process:
98 4. If the building has finished successfully, start the installation of FreeType.
99 All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*
103 @section dev_guides__building_3rdparty_linux_3 Building Optional Third-party Products
105 @subsection dev_guides__building_3rdparty_linux_3_1 TBB
107 This third-party product is installed with binaries from the archive that can be downloaded from http://threadingbuildingblocks.org.
108 Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
109 To install, unpack the downloaded archive of TBB product.
111 @subsection dev_guides__building_3rdparty_linux_3_2 gl2ps
113 Download the necessary archive from http://geuz.org/gl2ps/ and unpack it.
115 1. Install or build *cmake* product from the source file.
116 2. Start *cmake* in GUI mode with the directory where the source files of gl2ps are located:
120 * Press <i>[c]</i> to make the initial configuration;
121 * Define the necessary options in *CMAKE_INSTALL_PREFIX*
122 * Press <i>[c]</i> to make the final configuration
123 * Press <i>[g]</i> to generate Makefile and exit
125 or just run the following command:
127 cmake –DCMAKE_INSTALL_PREFIX=GL2PS_INSTALL_DIR –DCMAKE_BUILD_TYPE=Release
129 3. Start the building of gl2ps:
133 4. Start the installation of gl2ps. Binaries will be installed according to the *CMAKE_INSTALL_PREFIX* option.
137 @subsection dev_guides__building_3rdparty_linux_3_3 FreeImage
139 Download the necessary archive from http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
140 and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
142 1. Modify *FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h*:
143 In line 60 insert the following:
147 2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
151 3. Run the building process
155 4. Run the installation process
157 a. If you have the permission to write into directories <i>/usr/include</i> and <i>/usr/lib</i>, run the following command:
160 b. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.gnu*:
162 Change lines 7-9 from:
165 INCDIR ?= $(DESTDIR)/usr/include
166 INSTALLDIR ?= $(DESTDIR)/usr/lib
170 DESTDIR ?= $(DESTDIR)
171 INCDIR ?= $(DESTDIR)/include
172 INSTALLDIR ?= $(DESTDIR)/lib
174 Change lines 65-67 from:
176 install -m 644 -o root -g root $(HEADER) $(INCDIR)
177 install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
178 install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
182 install -m 755 $(HEADER) $(INCDIR)
183 install -m 755 $(STATICLIB) $(INSTALLDIR)
184 install -m 755 $(SHAREDLIB) $(INSTALLDIR)
194 Then run the installation process by the following command:
196 make DESTDIR=FREEIMAGE_INSTALL_DIR install
198 5. Clean temporary files
202 @subsection dev_guides__building_3rdparty_linux_3_4 VTK
204 You can download VTK sources from http://www.vtk.org/VTK/resources/software.html
206 ### The building procedure:
208 Download the necessary archive from http://www.vtk.org/VTK/resources/software.html and unpack it.
210 1. Install or build *cmake* product from the source file.
211 2. Start *cmake* in GUI mode with the directory where the source files of *VTK* are located:
215 * Press <i>[c]</i> to make the initial configuration
216 * Define the necessary options in *VTK_INSTALL_PREFIX*
217 * Press <i>[c]</i> to make the final configuration
218 * Press <i>[g]</i> to generate Makefile and exit
220 3. Start the building of VTK:
224 4. Start the installation of gl2ps. Binaries will be installed according to the *VTK_INSTALL_PREFIX* option.
228 @section dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
230 @subsection dev_guides__building_3rdparty_linux_4_1 Debian-based distributives
232 All 3rd-party products required for building of OCCT could be installed
233 from official repositories. You may install them from console using apt-get utility:
235 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 libgl2ps-dev
237 To launch binaries built with WOK you need to install C shell and 32-bit libraries on x86_64 distributives:
239 # you may need to add i386 if not done already by command "dpkg --add-architecture i386"
240 sudo apt-get install csh libstdc++6:i386 libxt6:i386 libxext6:i386 libxmu6:i386
242 Building is possible with C++ compliant compiler:
244 sudo apt-get install g++