Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang: error: unsupported option '-fopenmp' #16

Closed
jounih opened this issue Aug 3, 2016 · 17 comments
Closed

clang: error: unsupported option '-fopenmp' #16

jounih opened this issue Aug 3, 2016 · 17 comments

Comments

@jounih
Copy link

jounih commented Aug 3, 2016

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?

@ppwwyyxx
Copy link
Owner

ppwwyyxx commented Aug 3, 2016

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

On Aug 3, 2016 11:00 AM, "Jouni Helminen" [email protected] 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
.

@GitZChen
Copy link

GitZChen commented Aug 4, 2016

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.

@ppwwyyxx
Copy link
Owner

ppwwyyxx commented Aug 4, 2016

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

@jounih
Copy link
Author

jounih commented Aug 4, 2016

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

@GitZChen
Copy link

GitZChen commented Aug 4, 2016

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?

@paranoidpixel
Copy link

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!

@GitZChen
Copy link

GitZChen commented Aug 7, 2016

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?

@cardiomoon
Copy link

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

@ermiaswalelgne
Copy link

ermiaswalelgne commented Sep 28, 2017

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"

@tpsmahal
Copy link

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

@ppwwyyxx
Copy link
Owner

@tpsmahal
Copy link

what is above link referring to ?

@ppwwyyxx
Copy link
Owner

"src".

@tpsmahal
Copy link

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 ?

@tpsmahal
Copy link

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" ?

@gbrennon
Copy link

gbrennon commented Oct 30, 2018

@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"

@trunghvbk
Copy link

trunghvbk commented Sep 13, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants