g++ compatibility / STL / boost and Qt / OpenMP
919808Feb 24 2012 — edited Nov 15 2012Hello everyone.
I am currently evaluating several compilers to maybe speed up an existing project that does heavy number crunching. Amongst others, I also gave the compiler suite that comes with the Oracle Solaris Studio a try and I am having a few questions that I'd kindly like to ask here. Thanks for any suggestions/informations/hints in advance.
1]
Since I do not want to recompile all dependencies (amongst others Qt, boost, ...) for the project, I was trying to use the new -compat=g flag but CC spit out more errors than one would imagine. It was unable to find the appropriate pathes and all and even after setting them accordingly with the appropriate -I flag, it choked on most of what it found. What is the correct way of using the -compat=g flag and what environment variables/flags do I have to set as well? I guess gcc 4.6 (which is the version I have installed) is not yet supported and won't really work?
2]
Am I assuming correctly that if I use -compat=g or use stlport4, I cannot make use of the optimized math library that comes with the compiler suite as a replacement for the regular libm?
3]
The project I am trying to compile, makes heavy use of the STL and boost. The standard libCstd does not support every feature - which also goes for some of the project's dependencies as well. Is the stlport4 or the native g++ stl the only way to solve this?
4]
With every compile, I get "CC: Warning: failed to detect system linker version, falling back to custom linker usage". I was unable to figure out what the actual repercussions are and how I could eventually fix this. If someone could please shed any light on this, it would be greatly appreciated.
5]
I have a small test program which basically is a loop that iterates UINT32_MAX times and does some calculation. I use OpenMP's parallel for without any hint to scheduling, number of threads or such. All compilers (g++, icc, path64) I tried, correctly put out 8 threads to handle the load. Except for the version compiled with solaris studio compiler. It only launched two threads and came in last. After manually forcing it to 8 threads (OMP_NUM_THREADS=8), it worked like a charm and even took the lead. Again, it is a simple and stupid test. But I wonder what I am missing because it should not be the user's job to set the right number of thread for his machine.
By the way, all tests have been performed on a x86_64 Linux system (Gentoo) w/ gcc 4.6.2 and Studio 12.3 (tar).
Thanks again and have a nice weekend,
matthias.