libmesh icon indicating copy to clipboard operation
libmesh copied to clipboard

Make opt more optimized

Open lindsayad opened this issue 3 years ago • 3 comments

Some things we definitely want to do:

  • -O3

Some things we might want to do:

  • march
  • mtune

lindsayad avatar Apr 08 '21 19:04 lindsayad

Just in case you are not already aware of it, we have --enable-march which calls AX_GCC_ARCHFLAG (m4/ax_gcc_archflag.m4) to try and figure out the right flag to use for the current CPU. That m4 file should definitely be updated though, I don't think it has been for a while.

jwpeterson avatar Apr 08 '21 19:04 jwpeterson

Nice. Thanks for the heads up

lindsayad avatar Apr 08 '21 19:04 lindsayad

https://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html doesn't show any updates since the version you pulled. I'm surprised it doesn't seem to have a simple march=native fallback, though; gcc can try to autodetect available instruction sets even on processors newer than it is.

Maybe march=native is too risky for most users? I've run into a case where I had to rebuild a software stack on an older computer in a mixed network because some eager developer had decided to use march=native by default and thus newer-computer-built executables were crashing when run on older computers.

roystgnr avatar Apr 08 '21 20:04 roystgnr