سؤال

What are the trade-offs/concerns for using gcc 3.4 vs 4.4 for compiling modern Matlab MEX files?

I need to compile some off-the-shelf C++ code (kdtree) as a MEX file for use with MATLAB (R2012a) under Fedora v16. I have run into symbol problems using the latest GCC complier (4.6.x) that is the cluster default. And the system administrator is very resistant to making gcc 4.4.x, the officially supported compiler by Matlab available. (not sure why) So, instead he is proposing using the legacy (circa 2006) gcc 3.4.6 compiler. So my question is what if any trade-offs or issues are there with using the older gcc compiler? Performance? 64-bit support? Thread safety (or really multiple parallel calls)? etc?

هل كانت مفيدة؟

المحلول

You're mostly missing out on the preliminary implementation of c++11 features (including standardized threads, variadic templates, etc http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport). As long as both compilers produce binaries that are ABI compatible with MATLAB/Octave, there arent really any version-specific safety concerns. No c compiler can solve shared-state problems for you. Performance will be slightly different, but not significant. In either compiler version I'm sure theres a more optimial implementation of your code anyway. gcc 3.4 has 64bit support.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top