0023962: Moving OCCT documentation to sources
[occt.git] / dox / dev_guides / building / automake.md
1 Building with Automake {#dev_guides__building__automake}
2 ======================
3
4 This file describes steps to build OCCT libraries from complete source
5 archive on Linux with GNU build system (Autotools).
6
7 If you are building OCCT from bare sources (as in Git repository), or do some 
8 changes affecting CDL files, you need to use WOK to re-generate header files
9 and build scripts / projects. See file \ref wok "WOK" for instructions.
10
11 Before building OCCT, you need to install required third-party libraries; see
12 OCCT_Build3rdParty_Linux.pdf for instructions.
13
14 Note that during compilation by makefiles on some Linux OS on a station with 
15 NVIDIA video card you may experience problems because the installation 
16 procedure of NVIDIA video driver removes library libGL.so included in package 
17 libMesaGL from directory /usr/X11R6/lib and places this library libGL.so in 
18 directory /usr/lib. However, libtool expects to find the library in directory 
19 /usr/X11R6/lib, which causes compilation crash (See /usr/X11R6/lib/libGLU.la). 
20
21 To prevent this, suggest making links: 
22
23  ln -s /usr/lib/libGL.so /usr/X11R6/lib/libGL.so 
24  ln -s /usr/lib/libGL.la /usr/X11R6/lib/libGL.la 
25
26   1.In OCCT root folder, launch build_configure script 
27
28    This will generate files configure and Makefile.in for your system.
29
30   2.Go to the directory where OCCT will be built, and run configure to generate
31    makefiles.
32
33    $CASROOT/configure \<FLAGS\>
34
35    Where \<FLAGS\> is a set of options.
36    The following flags are mandatory:
37
38    * --with-tcl=  defines location of tclConfig.sh
39    * --with-tk=  defines location of tkConfig.sh
40    * --with-freetype=  defines location of installed FreeType product
41    * --prefix= defines location for the installation of OCCT binaries
42
43    Additional flags:
44
45    * --with-gl2ps=  defines location of installed gl2ps product
46    * --with-freeimage=  defines location of installed FreeImage product
47    * --with-tbb-include= defines location of tbb.h
48    * --with-tbb-library=  defines location of libtbb.so
49    * --enable-debug=       yes: includes debug information, no: does not include debug information
50    * --enable-production=   yes: switches code optimization, no: switches off code optimization
51    * --disable-draw - allows OCCT building without Draw.
52
53    If location of FreeImage, TBB, and Gl2Ps is not specified, OCCT will be
54    built without these optional libraries.
55
56    
57    Attention: 64-bit platforms are detected automatically.
58
59    Example:
60
61    > ./configure -prefix=/PRODUCTS/occt-6.5.5 --with-tcl=/PRODUCTS/tcltk-8.5.8/lib --with-tk=/PRODUCTS/tcltk-8.5.8/lib --with-freetype=/PRODUCTS/freetype-2.4.10 --with-gl2ps=/PRODUCTS/gl2ps-1.3.5 --with-freeimage=/PRODUCTS/freeimage-3.14.1 --with-tbb-include=/PRODUCTS/tbb30_018oss/include --with-tbb-library=/PRODUCTS/tbb30_018oss/lib/ia32/cc4.1.0_libc2.4_kernel2.6.16.21
62
63   3.If configure exits successfully, you can build OCCT with make command.
64
65    > make -j8 install
66
67 To start DRAW, launch
68
69    > draw.sh