Long compilation of ParaView with early versions of gcc 4.4
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
The compilation of ParaView takes very long time on some Linux distributions.
The analysis has shown that this problem takes place with some versions of gcc compiler. For example, this problem is reproduced on:
- Mandriva 2010.0 64bits: gcc version 4.4.1.
- CentOS 5.5 64bits: gcc version 4.4.0.
The 'make' process freezes at compilation of ParaViewCore/ServerManager/SMApplication/vtkInitializationHelper.cxx file. The compilation, if not stopped, might take more than a week!!! :) In the end, the compilation of this file is successfully finished and rest of build procedure is done as usual. During the compilation of this file, CPU shows ~100% of loading (on multi-core systems only one core is loaded).
The analysis has shown that the problem is caused by ParaView_build/ParaViewCore/ServerManager/SMApplication/vtkSMGeneratedModules.h file that is generated by kwProcessXML tool. Namely, this (very big) file operates with huge hard-coded string variables, e.g.
// From file /data/mnt/vsr/tmp/ParaView-4.1.0_SRC/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml
static const char* const vtkSMDefaultModulesfiltersInterface0 =
"\n" " <ProxyGroup name="internal_filters">\n" ...
This problem can be fixed by patching of the Utilities/ProcessXML/ProcessXML.cxx file, in "void PrintHeader(const char* title, const char* file)" function, by replacing (in line 53)
<< "static const char* " << this->Prefix.c_str() << title << this->Suffix.c_str() << this->Count
<< "static const char* const " << this->Prefix.c_str() << title << this->Suffix.c_str() << this->Count
With this patch, the compilation of mentioned file takes just a second. No any negative side effect has been found after applying of this patch.