[90264] trunk/dports/lang/pypy/Portfile

jmr at macports.org jmr at macports.org
Tue Feb 28 04:57:03 PST 2012


Revision: 90264
          http://trac.macports.org/changeset/90264
Author:   jmr at macports.org
Date:     2012-02-28 04:56:58 -0800 (Tue, 28 Feb 2012)
Log Message:
-----------
pypy: work around excessive compiler memory usage (#33256)

Modified Paths:
--------------
    trunk/dports/lang/pypy/Portfile

Modified: trunk/dports/lang/pypy/Portfile
===================================================================
--- trunk/dports/lang/pypy/Portfile	2012-02-28 11:40:50 UTC (rev 90263)
+++ trunk/dports/lang/pypy/Portfile	2012-02-28 12:56:58 UTC (rev 90264)
@@ -44,6 +44,25 @@
     build.cmd       ${prefix}/bin/python2.7
 #}
 
+# a lot of memory is used before the C compiler even runs, so limit build.jobs
+# according to available memory more tightly than the default
+if {![catch {sysctl hw.memsize} memsize]} {
+    if {$build_arch == "x86_64" || $build_arch == "ppc64"} {
+        incr memsize -4000000000
+    } else {
+        incr memsize -2000000000
+    }
+    if {$memsize <= 0} {
+        build.jobs 1
+    } elseif {${build.jobs} > $memsize / 1000000000 + 1} {
+        build.jobs [expr $memsize / 1000000000 + 1]
+    }
+}
+# memory usage bug in gcc 4.2 on x86_64
+if {${configure.compiler} == "gcc-4.2" && $build_arch == "x86_64"} {
+    configure.compiler llvm-gcc-4.2
+}
+
 platform darwin {
     # use arch -foo if available
     if {${os.major} >= 9} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120228/b8c7a24e/attachment.html>


More information about the macports-changes mailing list