views:

1605

answers:

5

I'm not much of a c++ programmer, just an end-user trying to install an existing project from source. One of the project dependencies is the boost library. When I tried to install boost on my osx 10.5.7 using "sudo port install boost", I got the following error message:

--->  Building boost with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_boost/work/boost_1_35_0" && gmake all " returned error 2
Command output: Makefile:2: *** missing separator.  Stop.

Error: Status 1 encountered during processing.

help?

EDIT: I suspect something is wrong with my system, though I am not sure what -- it's just a plain osx installation + the xcode CD that came with it, nothing fancy. [things are just so much easier on this front on linux!)

I did "sudo port selfupdate" and "sudo port upgrade outdated" as suggested in an answer, and the second one ran about all night, then failed with many errors, the last few are:

Error: The following dependencies failed to build: db46
Error: Unable to upgrade port: 1
--->  Extracting tiff
On Mac OS X 10.5, tiff 3.8.2 requires Xcode 3.1 or later but you have Xcode 3.0.
Error: Target org.macports.extract returned: incompatible Xcode version
Error: Unable to upgrade port: 1
--->  Activating xorg-renderproto @0.9.3_0
Error: Target org.macports.activate returned: Image error: /opt/local/include/X11/extensions/render.h is being used by the active render port.  Please deactivate this port first, or use 'port -f activate xorg-renderproto' to force the activation.
Error: The following dependencies failed to build: xorg-renderproto
Error: Unable to upgrade port: 1
+2  A: 

Try running 'sudo port selfupdate'. You are using an outdated version of MacPorts. Once this is done run 'port upgrade outdated' to update the ports you have and then try to install boost again.


Update: Update XCode as Paul mentioned in a post below. You can get it on the Apple Developer Site. You will probably have to signup to get a download link. As for the bug about the active render port you can safely disable this port as it has been replaced by xorg-renderproto. Deactivate it by running 'sudo port deactivate render'. Once that is done you can update again using 'port upgrade outdated' and it shouldn't take as long this time.

MitMaro
I agree. I have not had problems installing boost from ports in a long time, and 1.35 is _old_, 1.39 is the latest, 1.38 is known to be stable
njsf
But I don't need Xcode at all. Never used it, and not planning to. Just need the GNU tools. Is there a way to get by with that?
Yoav
+1  A: 

My experiences with MacPorts are a mixed blessing at best. Sometimes ports are out of date, or only half-done, it's very nice when it works, but unfortunatly doesn't always, so I kind of gave up on port to be honest...

That said, the default configure, bjam, ... combo from the boost distribution works flawlessly on os x, any reason you specifically want to get it working via port ?

Pieter
I have never had any serious problems with MacPorts other then ones I caused myself.
MitMaro
+1  A: 

In my experience you can easily do things with other installers that can break the port command from working correctly. Not to mention that MacPorts just breaks at the most random of times for me. Once I removed perl using the port command. It broke the whole port installation, don't even try this.

If you can I would just build Boost from source using gcc.It is actually not that difficult.

I have written an article on how to do this with some detail here. It has a specific focus on how to do this on Mac OS X but says how to do this on Windows as well.

The two commands you will need are:

Build debug libs using GCC:

bjam toolset= darwin variant=debug threading=multi link=static

Build release libs using GCC:

bjam toolset=darwin variant=release threading=multi link=static

More detailed info on doing this here.

Brock Woolf
+2  A: 

On Mac OS X 10.5, tiff 3.8.2 requires Xcode 3.1 or later but you have Xcode 3.0.

Isn't that the cause of port upgrade outdated failure?

Paul
That it is Paul. :) +1
MitMaro
A: 

I have anothe problem... right now I have the line

---> Building boost

stuck for about 1 hour... any suggestion?

Andrea