fix incompatibility with OCCT 6.5.2
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Here is a short description of the problem (I was reported on it in one of my previous mails).
The problem is that VTK embeds statically own patched versions of freetype and ftgl libraries (used to draw fonts). The freetype library (v2.4.4) is embedded in a proper way - to avoid any problems with external freetype, VTK uses special mangling of the symbols exported by freetype: all functions are renamed, and the library is named libvtkfreetype. However, this is not done in the same way with ftgl. The VTK provides internal libvtkftgl library that is a patched version of ftgl v1.32. Since version 6.4, OCCT also uses freetype / ftgl for the font drawing. However, OCCT uses these libraries by dynamic linking, moreover it uses newer versions (freetype 2.3.7 and ftgl 2.1.2). This raises compatibility problem since SALOME becomes linked to two different versions of ftgl! This causes crash in SALOME run-time when drawing fonts (for example, when displaying any mesh group in VTK viewer).
The only solution I could find is a creation of a patch for Paraview / VTK. In order to avoid problem with symbols tables, all ftgl classes (of internal libvtkftgl used in Paraview) are wrapped to the namespace. This allows using different mangling for the symbols. I have quickly tested resulting patch and did not found problems for the moment.
Also, this patch is compatible with Paraview 3.12rc2. Probably, it is good idea to send this patch to Kitware to include it in the final Paraview 3.12. EDF as a Kitware customer can forward this mail to the Paraview development team.
Also, there's an additional point about building OCCT 6.5.2 and its pre-requisites on 64bit platforms. For 64bit platforms CFLAGS="-fPIC -m64" configure option should be used. Please find updated OCCT_building.pdf attached (see p 2.3.7).