user16422658
user16422658

Reputation:

gcc-11 compiler optimisation levels not working on Mac m1

I have to complete a project for university where I need to be able to optimise using compiler optimisation levels. I am using OpenMP and as a result I have got the gcc-11 compiler from brew. I have watched this video https://www.youtube.com/watch?v=U161zVjv1rs and tried the same thing but I am getting an error:

gcc-11 -fopenmp jacobi2d1.c -o1 out/jacobi2d1

But I am getting the following error:

Compiler optimisation error

How do I do this?

Any advice would be appreciated

Upvotes: 0

Views: 246

Answers (1)

Jonathan Leffler
Jonathan Leffler

Reputation: 754820

Optimization levels are specified with -O1 etc, using capital letter O, not lower-case letter o.

Lower-case -o1 specifies that the output file should be 1, and then out/jacobi2d1 is an input file to be linked, but it is an existing executable and you can't link one executable into another — hence the error from the linker.

Upvotes: 1

Related Questions