[R-sig-ME] patch for building lme4a on Mac OS X

Daniel Myall daniel.lists at zeno.co.nz
Fri Apr 23 23:25:13 CEST 2010


Below is a patch for lme4a from SVN to build on Mac OS X (at least 
leopard/snow leopard and under R 2.11 but I assume for Mac OS X in general).

Note: could potentially make cleaner by checking for __sun and _AIX at 
top as well but I am not sure if there are cases where __GNUC__ are 
defined on these systems and alloca.h shouldn't be used. Hence I left 
them as they were.


Index: pkg/lme4a/src/lme4utils.h
--- pkg/lme4a/src/lme4utils.h   (revision 791)
+++ pkg/lme4a/src/lme4utils.h   (working copy)
@@ -33,7 +33,11 @@
   * is freed automatically on return from a function. When using gcc the
   * builtin version is much faster. */

-#ifdef __GNUC__
+#ifdef __APPLE__
+/* This is necessary (and sufficient) for Mac OS X leopard/snow leopard
+ * Note that __GNUC__ is also defined on Mac OS X so this needs to go 
first */
+# include <alloca.h>
+#elif defined(__GNUC__)
  # undef alloca
  # define alloca(x) __builtin_alloca((x))
  #elif defined(__sun) || defined(_AIX)

More information about the R-sig-mixed-models mailing list