OS X compiling, clang and openmp

Hi there,
I used to help out a bit with OS X 10.6 builds a while back.
Had some personal things to prioritize and also my mac died at some point, but now have a bit of time and a new system, 10.11.3, and wanted to try compiling again.

Compiling ‘master’ branch with native Apple clang without openmp seems to work fine.
For openmp, tried following advice on
http://rawpedia.rawtherapee.com/macOS
http://rawtherapee.com/oldforum/viewtopic.php?f=10&t=6307&sid=b850eacf8abd014759e729990f644b11
and llvm/openmp website, also tried macport’s clang +openmp and libomp, as it seems macport clang supports openmp now (?)
Must be missing something basic because trying to compile with openmp always hits a dead end on the ‘make -j8 install’ stage, with the following errors that start out with:

/Users/xxx/builds/RawTherapee/rtengine/dcraw.cc:1948:48: error: call to
      'abs' is ambiguous
                    ushort dist = (ushort)sqrt(abs(corners[i][0] - row) * abs(c...
/Users/xxx/builds/RawTherapee/rtengine/dcraw.cc:1948:75: error: call to
      'abs' is ambiguous
  ...ushort dist = (ushort)sqrt(abs(corners[i][0] - row) * abs(corners[i][0] - row) ...
/Users/xxx/builds/RawTherapee/rtengine/dcraw.cc:1948:102: error: call to
      'abs' is ambiguous
  ...(ushort)sqrt(abs(corners[i][0] - row) * abs(corners[i][0] - row) + abs(corners[...
/Users/xxx/builds/RawTherapee/rtengine/dcraw.cc:1948:129: error: call to
      'abs' is ambiguous
  ...- row) * abs(corners[i][0] - row) + abs(corners[i][1] - col) * abs(corners[i][1...
2 warnings and 4 errors generated.
make[2]: *** [rtengine/CMakeFiles/rtengine.dir/dcraw.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [rtengine/CMakeFiles/rtengine.dir/all] Error 2
make: *** [all] Error 2

I didn’t include the full log, and there are also some warnings like

 /rtengine/dcraw.cc:8371:30: warning: use of
       logical '&&' with constant operand [-Wconstant-logical-operand]

This happens on both ‘master’ and ‘gtk3’ branches.

Also, for the no-openmp version to work, the ‘libiconv’ patch needs to be done, as described in the old forum post by maraker. I don’t know if it’s required for openmp linking, (I haven’t gotten past compiling yet…) but if it is maybe it good to mention it on the rawpedia entry, I guess in general I’m a bit confused as to what is now the way to compile on 10.10 and later with openmp

Thanks

p.s. old Mac died but it’s harddrive lives on :slight_smile: will try to find some time to boot from the old drive and try to do some builds for pre 10.10, hopefully this weekend or the next

1 Like

Hey

Good to see you’re eager to make new builds!

It would be better if you filed this compilation problem in GitHub, along with a full log. More devs will see it.

[quote=“ion12, post:1, topic:884”]
for the no-openmp version to work, the ‘libiconv’ patch needs to be done (…) maybe it good to mention it on the rawpedia entry[/quote]None of the devs use OS X. I had some success patching and documenting things in RT for OS X users but you need to be very clear. In this case it would be best if you documented the libiconv business in RawPedia yourself, as I can’t verify anything I write. Why would you use a non-OpenMP version at all when there is an OpenMP-capable compiler? A non-OpenMP build will run much slower than an OpenMP one.

I don’t want to use the non-openmp version, unfortunately that’s the only version I was able to compile (wanted to check if at least I got all the dependencies and cmake right).

re: libiconv, maraker, the user who explained on the old forum post I’ve linked to how he built for 10.11 said the patch he posted there is necessary. I can confirm that I needed the patch to get RT to work, but obviously just with with no openmp so far.

I can post error logs to github, but it’s probably not really a bug? I can’t get clang with openmp to compile RT but others have done so successfully in the past, so most likely I’m doing something wrong.

I’ll try to build again and keep detailed logs and post on github if I still can’t figure it out, but if someone who built successfully can help with some clear step by step instructions regarding openmp, that would be great.

OpenMP support in Clang is relatively new, what version of the compiler are you using?