pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: OpenMP on Darwin



On 5/19/23 14:44, Jason Bacon wrote:
On 5/19/23 13:04, Greg Troxel wrote:
Jason Bacon <jtocino%gmx.com@localhost> writes:

One of the problems is that Apple's clang lacks OpenMP support.  I see
parallel/openmp has a buildlink3.mk, but including it does not appear to
be sufficient to make packages work on Darwin.

In the non-Apple pkgsrc world, when the base system compiler is
deficient we require a newer compiler from pkgsrc.  That would seem to
be the most straightforward path here.

Well, it's not quite that straightforward here.  The Xcode compiler
actually has OpenMP support, but apple requires "-Xpreprocessor
-fopenmp" instead of just "-fopenmp", and does not supply the libraries,
so they need to be installed separately.

parallel/openmp installs libomp along with an entire llvm 15 installation.

On Darwin, it should suffice to just build and install libomp using the
Xcode compiler and adjust compile/link flags.

I wouldn't necessarily be opposed to using lang/llvm, but it's a heavy
dependency, and I'm not sure how to force a package to use it anyway.

I'm mainly wondering if there are any examples in the tree successfully
using OpenMP on Darwin.  If they exist, I'd like to examine them before
reinventing the wheel.


biology/canu, which requires OpenMP, is now an example of how we *can* make OpenMP work on Darwin, though not necessarily how we *should*.

It uses parallel/openmp conditionally for libomp and has a few Darwin-specific compile and link hacks.

I plan to look into creating a libomp package that doesn't require lang/llvm when I can find some time.



Home | Main Index | Thread Index | Old Index