10

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...;-).

8
  • 2
    what about sudo apt-get install gcc libgomp1?
    – Anycorn
    Sep 4, 2010 at 19:28
  • @aaa, I do have gcc installed (the 4.4.3 that comes with ubuntu) -- would the library magically make it support the OMP-specific #pragmas that it currently warns about and ignores...? Sep 4, 2010 at 19:39
  • @aaa, OK, thanks, guess I'm gonna give it a try... any suggestion for MacOSX 10.5, BTW...? Sep 4, 2010 at 23:05
  • 3
    sorry, I do not do Apple
    – Anycorn
    Sep 6, 2010 at 19:26
  • 1
    @Adam, not sure what ticket you mean. My directory that you point to is from many years ago (Python 2.4.3, mentioned there, was then the "latest and greatest" version). Oct 13, 2010 at 21:14

2 Answers 2

4

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

1
  • 2
    OpenMp is only supported in gcc 4.2 and higher.
    – db42
    Jan 28, 2012 at 18:01
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.