ppwwyyxx / OpenPano

Automatic Panorama Stitching From Scratch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clang: error: unsupported option '-fopenmp'

jounih opened this issue · comments

Hi, thanks for this great work.

I noticed it doesn't compile on OSX (using clang), "make" gives these errors:

[dep] third-party/lodepng/lodepng.cc ...
clang: error: unsupported option '-fopenmp'
[dep] stitch/warp.cc ...
clang: error: unsupported option '-fopenmp'
[dep] stitch/transform_estimate.cc ...
clang: error: unsupported option '-fopenmp'
[dep] stitch/stitcherbase.cc ...
clang: error: unsupported option '-fopenmp'

...and so on.

Compiling with gcc on Ubuntu (and probably OSX if installed gcc) works ok.

Any ideas what to fix in the makefile for clang?

Clang starts supporting openmp at some version. Works for me with clang on
Linux.

On Aug 3, 2016 11:00 AM, "Jouni Helminen" notifications@github.com wrote:

Hi, thanks for this great work.

I noticed it doesn't compile on OSX (using clang), "make" gives these
errors:

[dep] third-party/lodepng/lodepng.cc ...
clang: error: unsupported option '-fopenmp'
[dep] stitch/warp.cc ...
clang: error: unsupported option '-fopenmp'
[dep] stitch/transform_estimate.cc ...
clang: error: unsupported option '-fopenmp'
[dep] stitch/stitcherbase.cc ...
clang: error: unsupported option '-fopenmp'

...and so on.

Compiling with gcc on Ubuntu (and probably OSX if installed gcc) works ok.

Any ideas what to fix in the makefile for clang?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABUTtVn4u_7-c7eMWOP1S0Fh7vXYZSHnks5qcNZMgaJpZM4Jb6Lp
.

From my dealings with it, the clang on OSX is an Apple-customized one one that doesn't have OpenMP support. Changing the makefile or even the build system entirely (e.g. to cmake) doesn't help at all. As you have suggested yourself, the only way you can get around this issue is to get another compiler (latest clang or gcc) as well as their associated libraries and then try building the project again.

Thanks @GitZChen ! I should add these to the readme.

You are right, latest clang should have OpenMP support, but doesn't (yet) on MacOS. I installed Xcode 8 Beta 4 and it didn't include any updates to clang/LLVM version (but perhaps MacOS Sierra will).

So after a bit of fiddling, here is how to successfully compile OpenPano on MacOS El Capitan:

  1. Install brew (http://brew.sh/)
  2. "brew install gcc --without-multilib" (grab a coffee, this takes quite a while - but needed because default brew installation of gcc doesn't have OpenMP support)
  3. "export CXX=/usr/local/Cellar/gcc/6.1.0/bin/g++-6" (use the path from the output of brew gcc install. at the time of writing the above is correct, but may change. Do this or otherwise osx still uses clang to compile)
  4. "brew install eigen"
  5. run "make" in panorama /src - it compiles OK now

For 3, you can maybe try using "brew ls gcc" to list all installed components in the gcc formula then determine the path of g++ binary.

Also, in case anyone really wants to use clang instead of gcc, just substitute "gcc" with "llvm" and the path to "g++-6" with the path to the brew-installed "clang++" in the above instructions.

Though @jounih, don't you still need libjpeg?

Hi everyone,

I am following this thread, and tried the method suggested by @jounih, compiling . However I got many of these errors:

/var/folders/5_/k6wvp3594651b83cz4f_f4n80000gn/T//cc2ALrIr.s:1205:no such instruction: vmovaps %xmm0, -160(%rbp)' /var/folders/5_/k6wvp3594651b83cz4f_f4n80000gn/T//cc2ALrIr.s:1206:no such instruction:vmovaps %xmm1, -144(%rbp)'
/var/folders/5_/k6wvp3594651b83cz4f_f4n80000gn/T//cc2ALrIr.s:1207:no such instruction: vmovaps %xmm2, -128(%rbp)' /var/folders/5_/k6wvp3594651b83cz4f_f4n80000gn/T//cc2ALrIr.s:1208:no such instruction:vmovaps %xmm3, -112(%rbp)'

Did a quick look on Google, and looks like it is related to AVX on OSX problem. I've tried several methods suggested but no luck. Have you ever encountered this issue?

My machine is an 2013 MBP with i5. I did a check and it does have AVX1.0.

Thanks!

Never encountered that problem before compiling GCC. Though isn't this question off-topic for OpenPano? Maybe you'll have better luck asking it on SO instead?

How can I perform step 5 of jounih 's comment?

I know this is a bit old, but just in case someone is still looking for the solution, I want to say that the solution given by @jounih fixed the same problem I had. Just make sure that you get the right path of '/usr/local/Cellar/gcc/6.1.0/bin/g++-6' for the export. By the time of commenting, mine was "export CXX="/usr/local/Cellar/gcc/7.2.0/bin/g++-7"

In jounih's commented on Aug 4, 2016 •
In step 5 "run "make" in panorama /src - it compiles OK now"

what is panorama ? where is /src ?
When I run "make" , I get "make: *** No targets specified and no makefile found. Stop."

what is above link referring to ?

"src".

Hello ppwwyyxx , I need to run step 5 as i stated above.
Sorry I am unable to following from link you gave. Could you please describe what should I do now ?

You are right, latest clang should have OpenMP support, but doesn't (yet) on MacOS. I installed Xcode 8 Beta 4 and it didn't include any updates to clang/LLVM version (but perhaps MacOS Sierra will).

So after a bit of fiddling, here is how to successfully compile OpenPano on MacOS El Capitan:

  1. Install brew (http://brew.sh/)
  2. "brew install gcc --without-multilib" (grab a coffee, this takes quite a while - but needed because default brew installation of gcc doesn't have OpenMP support)
  3. "export CXX=/usr/local/Cellar/gcc/6.1.0/bin/g++-6" (use the path from the output of brew gcc install. at the time of writing the above is correct, but may change. Do this or otherwise osx still uses clang to compile)
  4. "brew install eigen"
  5. run "make" in panorama /src - it compiles OK now

Could you please help me run step 5 ? I did till 4. No clue about step 5 ?
I get below
"make: *** No targets specified and no makefile found. Stop."
No clue where is "panorama /src" ?

@ppwwyyxx dude, I did all 5 steps but it still is returning the error "unsupported option -fopenmp" :(
I've reiinstalled the gcc and set the env variable but it is still returning the error

After runing "make -C src" this is the error:

make: Entering directory '/Users/gbrennon/Documents/Prog/Github/OpenPano/src'
[cc] lib/debugutils.cc ...
clang: error: unsupported option '-fopenmp'
make: *** [Makefile:71: obj/lib/debugutils.o] Error 1
make: Leaving directory '/Users/gbrennon/Documents/Prog/Github/OpenPano/src'

Answering @tpsmahal step 5 can be executed with: "make -C src"

hi, brew install gcc error: Invalid options: --without-multilib