views:

1289

answers:

4

I guess the title says it all. 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.

+4  A: 

"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.

Ned Deily
+1... to chime in with Ned, if what you're building has a lot of package dependencies (and those packages have dependencies, and so on), you'll be waiting a long time to get your stuff compiled.
Shaggy Frog
by freeze the os I mean it becomes unresponsive for a few seconds. I'm running os x 10.6 on a core duo 2 macbook pro with 4gb mem. More than enough to handle even the most cpu/mem intense processes. I'm comparing macports to yum which I've used on linux systems for quite some time, and again macports just seems much less agile....
ennuikiller
Your computer periodically becomes unresponsive because a lot of builds and installs have very bursty IO patterns and it is bottlenecking on Disk IOs. It has nothing to do with CPU or memory. It is not nearly as bad with yum because yum is installing precompiled binary packages, not building them.
Louis Gerbarg
Well, yeah: if you're comparing installed pre-built binary packages to building packages from source - sure it's going to be slow! It would be nice if MacPorts did provide prebuilt packages but the infrastructure and testing to do that is more complex and not in the spirit of ports. Fink *tries* to do that - in the spirit of Debian apt-get - but they really don't have the resources to do it so they have a hybrid system of both source-only and binary packages with most of the binary packages not getting updated very often.
Ned Deily
And, not to sound glib, but, like many multi-person open-source projects, I bet either the MacPorts or Fink projects could use and would welcome more help.
Ned Deily
You can enable archive mode on your machine and MacPorts will look for archives from the same architecture that you drop in there before attempting to compile. You have to dump in the archive for now.
Nerdling
Using archive mode isn't very useful on the same machine unless you accidentally uninstall some current versions, is it? It can be more useful if you want to install the same packages on multiple machines at the same OS X and MacPorts version level and with the same architecture. Last time I tried, sharing universal architecture archive was messy because the architecture name was used in the path names; perhaps that has been fixed.
Ned Deily
+4  A: 

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.

galaxywatcher
thanks for the tip! mine was commented out as well!
ennuikiller
Can anyone confirm this? The comment on this field for me says "This# value may be set to 0 so the number of simultaneous make jobs will be set to# the number of CPU cores that are automatically detected, or the number of GB# of physical memory plus one, whichever is less."... so unless CPU detection is broken or you have < 2 gigs of ram, it should already be doing the right thing.
trenton
Test it for yourself. As I have done. Open up Activity Monitor, click CPU and watch the activity difference of each core when you vary the option during makes.
galaxywatcher
+1  A: 

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.

diceman
A: 

yes, you need to be patient, every time when i install something by macport, it take long time to fetch many thing, i don't know whether it's necessary..

lfx_cool