Hi Dirk,
Previously I patched the compiler check for intel icpc and clang. Today I found a minor problem with my old patch (while doing something unrelated to Rcpp, but I think it is a good idea to fix it anyway)
To summary the issue,
We now check if the compiler is Intel or GCC, if it is, which check if we are use libstdc++ (intel may use others), and if it is, we check that the libstdc++ is at least the one distributed with GCC 4.4, and then we choose c++11 <unordered_map> or tr1 <unordered_map> accordingly.
Previously I used __GLIBCXX__ to check that libstdc++ is at least 4.4. However, I made the wrong assumption that this macro is incremental in the sense that the bigger the better. However, for a newer release of GCC 4.3 series, it may have a larger __GLIBCXX__ than an older GCC 4.4 series release, and thus the macro is actually useless.
In reality, this is not a really a big problem, since it affect only one particular GCC release (GCC 4.3.6) and GNU is not going to release any newer version of GCC 4.3 or earlier series. However I provided a two line patch attached in the email. The compiler being affected is that particular GCC 4.3.6.
Best,
Yan Zhou
--- /home/zhou/R/x86_64-pc-linux-gnu-library/3.1/Rcpp/include/Rcpp/platform/compiler.h 2013-03-07 06:42:59.822939026 +0000
+++ compiler.h 2013-03-08 15:23:03.406976117 +0000
@@ -90,7 +90,7 @@
#include <cmath>
#if defined(__INTEL_COMPILER) || (defined(__GNUC__) && !defined(__clang__))
#if defined(__GLIBCXX__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
- #if __GLIBCXX__ >= 20090421 // GCC 4.4.0
+ #if GCC_VERSION >= 40400
#define HAS_CXX0X_UNORDERED_MAP
#define HAS_CXX0X_UNORDERED_SET
#define HAS_CXX0X_INITIALIZER_LIST
@@ -113,7 +113,7 @@
// Check TR1 Headers
#if defined(__INTEL_COMPILER) || (defined(__GNUC__) && !defined(__clang__))
#if defined(__GLIBCXX__)
- #if __GLIBCXX__ >= 20070719 // GCC 4.2.1
+ #if GCC_VERSION >= 40400
#define HAS_TR1_UNORDERED_MAP
#define HAS_TR1_UNORDERED_SET
#endif
_______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
