1 \feff Building 3rd-party libraries on MacOS X {#occt_dev_guides__building_3rdparty_osx}
2 ==============================================
5 @section dev_guides__building_3rdparty_osx_1 Introduction
7 This document presents additional guidelines for building third-party products
8 used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
10 The links for downloading the third-party products are available
11 on the web site of OPEN CASCADE SAS at http://www.opencascade.com/content/3rd-party-components.
13 There are two types of third-party products, which are necessary to build OCCT:
17 * FreeType 2.4.10 - 2.5.3.
20 * gl2ps 1.3.5 - 1.3.8;
21 * FreeImage 3.14.1 - 3.16.0
23 @section dev_guides__building_3rdparty_osx_2 Building Mandatory Third-party Products
25 @subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk 8.5
27 Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
29 @subsubsection dev_guides__building_3rdparty_osx_2_1_2 Installation from sources: Tcl 8.5
31 Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
33 1. Enter the *macosx* sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
37 2. Run the *configure* command
39 configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
41 For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
43 3. If the *configure* command has finished successfully, start the building process
47 4. If building is finished successfully, start the installation of Tcl.
48 All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*.
52 @subsubsection dev_guides__building_3rdparty_osx_2_1_3 Installation from sources: Tk 8.5
54 Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
56 1. Enter the *macosx* sub-directory of the directory where the source files of Tk are located <i>(TK_SRC_DIR)</i>.
60 2. Run the *configure* command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
62 configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
64 For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
66 3. If the *configure* command has finished successfully, start the building process:
70 4. If the building has finished successfully, start the installation of Tk. All binary and service files of the product will be copied to the directory defined by *TK_INSTALL_DIR* (usually it is TCL_INSTALL_DIR)
74 @subsection dev_guides__building_3rdparty_osx_2_2 FreeType 2.4.10
76 FreeType is required for text display in the 3D viewer.
78 Download the necessary archive from http://sourceforge.net/projects/freetype/files/ and unpack it.
80 1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
84 2. Run the *configure* command
86 configure --prefix=FREETYPE_INSTALL_DIR
88 For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
90 3. If the *configure* command has finished successfully, start the building process
94 4. If building has finished successfully, start the installation of FreeType.
95 All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*.
99 @section dev_guides__building_3rdparty_osx_3 Building Optional Third-party Products
101 @subsection dev_guides__building_3rdparty_osx_3_1 TBB 3.x or 4.x
103 This third-party product is installed with binaries from the archive
104 that can be downloaded from http://threadingbuildingblocks.org/.
105 Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*)
106 and pick the archive for Mac OS X platform.
107 To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_osx.tgz*).
109 @subsection dev_guides__building_3rdparty_osx_3_2 gl2ps 1.3.5
111 Download the necessary archive from http://geuz.org/gl2ps/ and unpack it.
113 1. Install or build cmake product from the source file.
115 2. Start cmake in GUI mode with the directory, where the source files of *fl2ps* are located:
119 * Press <i>[c]</i> to make the initial configuration;
120 * Define the necessary options in *CMAKE_INSTALL_PREFIX*;
121 * Press <i>[c]</i> to make the final configuration;
122 * Press <i>[g]</i> to generate Makefile and exit.
124 or just run the following command:
126 cmake –DCMAKE_INSTALL_PREFIX=GL2PS_INSTALL_DIR –DCMAKE_BUILD_TYPE=Release
128 3. Start the building of gl2ps
132 4. Start the installation of gl2ps. Binaries will be installed according to the *CMAKE_INSTALL_PREFIX* option
136 @subsection dev_guides__building_3rdparty_osx_3_3 FreeImage 3.14.1 or 3.15.x
138 Download the necessary archive from
139 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 Note that for building FreeImage on Mac OS X 10.7 you should replace *Makefile.osx*
143 in *FREEIMAGE_SRC_DIR* by the corrected file, which you can find in attachment to issue #22811 in OCCT Mantis bug tracker
144 (http://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug).
146 1. If you build FreeImage 3.15.x you can skip this step.
147 Modify <i>FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:</i>
149 In line 60 insert the following:
153 Modify <i>FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp:</i>
163 2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
167 3. Run the building process
171 4. Run the installation process
173 1. If you have the permission to write into <i>/usr/local/include</i> and <i>/usr/local/lib</i> directories, run the following command:
177 2. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.osx*:
187 Change lines 65-69 from:
189 install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
190 install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
191 install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
192 ranlib -sf $(INSTALLDIR)/$(STATICLIB)
193 ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
197 install -d $(INCDIR) $(INSTALLDIR)
198 install -m 755 $(HEADER) $(INCDIR)
199 install -m 755 $(STATICLIB) $(INSTALLDIR)
200 install -m 755 $(SHAREDLIB) $(INSTALLDIR)
201 ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
202 ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
204 Then run the installation process by the following command:
206 make PREFIX=FREEIMAGE_INSTALL_DIR install
208 5. Clean temporary files