1 Building 3rd-party libraries on Linux {#dev_guides__building_3rdparty_linux}
2 ============================================
5 @section dev_guides__building_3rdparty_linux_1 Introduction
7 This document presents additional guidelines for building third-party
8 products used by Open CASCADE Technology and samples on Linux platform.
10 The links for downloading the third-party products are available on the web site
11 of OPEN CASCADE SAS at
12 http://www.opencascade.org/getocc/require/.
14 There are two types of third-party products, which are necessary to build OCCT:
16 * Mandatory products: Tcl 8.5, Tk 8.5, FreeType 2.4.10
17 * Optional products: TBB 3.x or 4.x, gl2ps 1.3.5, FreeImage 3.14.1
19 @section dev_guides__building_3rdparty_linux_2 Building Mandatory Third-party Products
21 @subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk 8.5
23 Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
25 @subsubsection dev_guides__building_3rdparty_linux_2_1_1 Installation from binaries
27 It is possible to download ready-to-install binaries from
28 http://www.activestate.com/activetcl/downloads
30 * 1. Download the binaries archive and unpack them to some TCL_SRC_DIR.
31 * 2. Enter the directory TCL_SRC_DIR.
37 * 3. Run the install command
43 and follow instructions.
45 @subsubsection dev_guides__building_3rdparty_linux_2_1_2 Installation from sources: Tcl 8.5
47 Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
49 * 1. Enter the unix sub-directory of the directory where the source files of Tcl are located (TCL_SRC_DIR).
55 * 2. Run the configure command
58 configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
61 For a 64 bit platform also add --enable-64bit option to the command line.
63 * 3. If the configure command has finished successfully, start the building process
69 * 4. If building is finished successfully, start the installation of Tcl.
70 All binary and service files of the product will be copied to the directory defined by TCL_INSTALL_DIR
76 @subsubsection dev_guides__building_3rdparty_linux_2_1_3 Installation from sources: Tk 8.5
78 Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
80 * 1. Enter the unix sub-directory of the directory where the source files of Tk are located (TK_SRC_DIR).
86 * 2. Run the configure command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
89 configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
92 where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
94 For a 64 bit platform also add --enable-64bit option to the command line.
96 * 3. If the configure command has finished successfully, start the building process
102 * 4. If building has finished successfully, start the installation of Tk.
103 All binary and service files of the product will be copied
104 to the directory defined by TK_INSTALL_DIR (usually TK_INSTALL_DIR is TCL_INSTALL_DIR)
110 @subsection dev_guides__building_3rdparty_linux_2_2 FreeType 2.4.10
112 FreeType is required for display of text in 3D viewer.
113 Download the necessary archive from http://sourceforge.net/projects/freetype/files/ and unpack it.
115 * 1. Enter the directory where the source files of FreeType are located (FREETYPE_SRC_DIR).
121 * 2. Run the configure command
124 configure --prefix=FREETYPE_INSTALL_DIR
127 For a 64 bit platform also add CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC' option to the command line.
129 * 3. If the configure command has finished successfully, start the building process
135 * 4. If building has finished successfully, start the installation of FreeType.
136 All binary and service files of the product will be copied to the directory defined by FREETYPE_INSTALL_DIR
142 @section dev_guides__building_3rdparty_linux_3 Building Optional Third-party Products
144 @subsection dev_guides__building_3rdparty_linux_3_1 TBB 3.x or 4.x
146 This third-party product is installed with binaries from the archive that can be downloaded from http://threadingbuildingblocks.org.
147 Go to \"Downloads page\", find the release version you need (e.g. tbb30_018oss) and pick the archive for Linux platform.
148 To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_lin.tgz*).
150 @subsection dev_guides__building_3rdparty_linux_3_2 gl2ps 1.3.5
152 Download the necessary archive from http://geuz.org/gl2ps/ and unpack it.
154 * 1. Install or build cmake product from source file.
155 * 2. Start cmake in GUI mode with the directory where the source files of gl2ps are located:
159 * 2.1. Press [c] to make the initial configuration
160 * 2.2. Define the necessary options CMAKE_INSTALL_PREFIX
161 * 2.3. Press [c] to make the final configuration
162 * 2.4. Press [g] to generate Makefile and exit
164 or just run the following command:
167 cmake –DCMAKE_INSTALL_PREFIX=GL2PS_INSTALL_DIR –DCMAKE_BUILD_TYPE=Release
170 * 3. Start building of gl2ps
176 * 4. Start the installation of gl2ps. Binaries will be installed according to the CMAKE_INSTALL_PREFIX option
182 @subsection dev_guides__building_3rdparty_linux_3_3 FreeImage 3.14.1
184 Download the necessary archive from http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
185 and unpack it. The directory with unpacked sources is further referred to as FREEIMAGE_SRC_DIR.
187 * 1. Modify FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:
188 In line 60 insert the following:
194 * 2. Enter the directory where the source files of FreeImage are located (FREEIMAGE_SRC_DIR).
200 * 3. Run the building process
206 * 4. Run the installation process
207 * 4.1. If you have permissions to write to /usr/include and /usr/lib directories then run the following command:
211 * 4.2. If you don’t have permissions to write to /usr/include and
212 /usr/lib directories then you need to modify the file FREEIMAGE_SRC_DIR/Makefile.gnu:
214 Change lines 7-9 from:
218 INCDIR ?= $(DESTDIR)/usr/include
219 INSTALLDIR ?= $(DESTDIR)/usr/lib
225 DESTDIR ?= $(DESTDIR)
226 INCDIR ?= $(DESTDIR)/include
227 INSTALLDIR ?= $(DESTDIR)/lib
230 Change lines 65-67 from:
233 install -m 644 -o root -g root $(HEADER) $(INCDIR)
234 install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
235 install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
241 install -m 755 $(HEADER) $(INCDIR)
242 install -m 755 $(STATICLIB) $(INSTALLDIR)
243 install -m 755 $(SHAREDLIB) $(INSTALLDIR)
258 Then run the installation process by the following command:
261 make DESTDIR=FREEIMAGE_INSTALL_DIR install
264 * 5. Clean the temporary files
270 @section dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
272 @subsection dev_guides__building_3rdparty_linux_4_1 Debian-based distributives
274 All 3rd-party products required for building of OCCT could be installed
275 from official repositories. You may install them from console using apt-get utility:
278 sudo apt-get install \
279 tcllib tklib tcl-dev tk-dev \
281 libxt-dev libxmu-dev \
288 To launch WOK-prebuilt binaries you need install C shell and 32-bit libraries on x86_64 distributives:
291 sudo apt-get install \
293 libstdc++5:i386 libxt6:i386
296 Any compliant C++ compiler is required for building anyway:
299 sudo apt-get install \
303 @see http://www.opencascade.org for details