Question

Building from source outside of macports is a breeze. Building with macports takes forever and seems to freeze the os every so often. Is this typical behavior? Although it seems like a nice packaging tool for os x, if I have to go through this pain every time during every install I think I'll do without it.

Was it helpful?

Solution

If you are running on an Intel Core 2 Duo you can double the speed of your builds by changing the Macports config option located here:

/opt/local/etc/macports/macports.conf

# Number of simultaneous make jobs (commands) to use when building ports
buildmakejobs       2

I was kicking myself when I discovered this AFTER I rebuilt gcc ;)

This option will allow you to use both cpu's for building packages.

OTHER TIPS

"freeze the os"? Can you be more specific? What packages were you trying to build on what version of OS X on what machine?

In my experience, MacPorts builds generally work correctly on almost any supported configuration, in my case ranging from a 256MB Pismo G3 (year 2000) running 10.4 up though a recent dual-core Intel iMac on 10.5. You have to be patient, though: it may take a long time especially if there are a lot of dependent packages, which is one of the drawbacks of using a package manager like MacPorts or Fink. The upside is that you generally have a much-more controlled and, one hopes, tested environment than if you installed individually packages from source yourself. And, if you haven't already, make sure you update to the latest MacPorts: 1.8.0 was just released and has some important improvements, including better support of universal builds.

MacPorts used to only build from source and this can lead to a difference of several orders of magnitudo when compared to a package system that fetch binaries. Consider as example the case of a somehow big package that takes few hours to be built and compare this to the time of downloading it as an archive having a size of a few tens of MBs.

MacPorts uses Apple's tools to build and it only adds a negligible overhead to the same build time that you would get outside of MacPorts, the bigger the package, the smaller the difference. If you experience a huge difference when building a program outside of MP you should file a ticket on the issue tracker with the details.

That said I see the question is quite old, since 2.0 there's support for binary archives -cf. Changelog- there's a macosforge supported repository with buildbots that produce signed archives and the default is to fetch these binary archives rather than building from source (that you can force using -s flag). The current user experience is more similar to binary managers like apt-get, with the ability to change configure and build options quite easily.

I don't mind waiting for Mac Ports to build from source on the latest packages. But why not harness all this processing power and offer users the option to let the build be automatically uploaded back to MacPorts or better still be hashed and offered peer-to-peer to other MacPorts users who can choose a 'turbo' option.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top