5

Currently we compile and run code on same hardware, so -march=native flag is used.

We are going to keep running on this hardware but compile on different architecture. So I need to replace native with whatever it is equivalent to on current hardware.

Is there a way to get gcc to report what native is equivalent to on particular hardware?

user2052436
  • 4,321
  • 1
  • 25
  • 46

1 Answers1

10

Yes, you can run the command

gcc -march=native -Q --help=target

to see the flags applied, including the resolved -march flag.

nos
  • 223,662
  • 58
  • 417
  • 506
  • We have Intel Xeon Gold 6148 dual-socket nodes, and `gcc -march=native -Q --help=target` reported `-march = knl'. This is surprising to me - we don't have any Phi accelerators. Is it expected? – user2052436 Jun 05 '19 at 21:37
  • @user2052436 you should ask that as a different question – phuclv Jun 06 '19 at 15:27