views:

196

answers:

2

I'm looking at an open-source library (DDS, a double-dummy bridge solver) which in its latest release (2.1.1) adds some very useful multi-tasking functionality requiring either a Windows system or OpenMP (indeed, that latest version won't even compile at all on a non-Windows system without full OpenMP support!-). Ubuntu 10.4 has a package available for an older version (1.1.9), which includes the Python interface to the library (pydds). I contributed to upstream long ago, but I'd really like to use (and contribute a Python interface to;-) the new functionality... but, for that, I need a C compiler and supporting libraries that will give me OpenMP functionality...!

Plus, I need them on both Ubuntu 10.4 and my good old Intel Macs which still run Mac OS X 10.5 (to avoid losing compatibility with my good old PowerPC Macs -- but I'm not holding out for a way to get OpenMP support on those PowerPC Macs too, though of course I'd just love to... the Intel-based ones would suffice!-).

I fully plan to hack as much as needed (and contribute patches upstream of course once I have them working, as I've long done on all open source code I've hacked on, including DDS itself in the past;-) on DDS itself, pydds, and any ancillary functionality for them, but... exactly because of that, I'd just love to avoid having to do a lot more "preliminary" hacking to get OpenMP support (for C) in the first place on the platforms I need it on!-).

So, is there (ideally!-) anything I could just apt-get install for Ubuntu 10.4, and a disk image or Darwinport or whatever for Mac OS X 10.5 at least on Intel processors, that I could use to get started...? I'm of course ready to build-from-sources, patch sources, etc., as needed, but I'd much rather not have to, if I can avoid it...;-).

+1  A: 

On Mac OSX 10.5, it looks like -fopenmp is not a valid option (gcc version 4.0.1).

$ gcc -fopenmp foo.c 
cc1plus: error: unrecognized command line option "-fopenmp"

However, I was able to compile and run on 10.6 (gcc version 4.2.1). So, it looks like your only options are 1) upgrade to 10.6, or 2) custom compile a version of gcc.

(Side Note: The man page for gcc on 10.5 does not mention -fopenmp, where 10.6 does.)

Garrett Hyde
+1  A: 

As suggested by Garrett Hyde, the version of gcc that ships with Mac OS 10.5 is too old to have OpenMP support. But no problem.

Install MacPorts (http://trac.macports.org/wiki/InstallingMacPorts) - you'll need to have Xcode installed, and then X11, both of which you should still be able to get from the apple site if you don't still have your install media. Then once macports is setup, "sudo port install gcc45" (or at least 44) and wait quite a while for it to build gcc and all of its dependencies. Anything gcc 4.4.x or later will have pretty solid OpenMP 3.0 support. And then you should be good to go.

As has been pointed out in comments, the stock gcc that comes with Ubuntu 10.4 also will work out of the box.

Jonathan Dursi