gyre
gyre copied to clipboard
unable to compile with -march=native
Hi Rich,
Our group has run into issues where on certain machines running older versions of linux, GYRE is not able to compile unless we either remove the compiler flag -march=native
from the standard set of build options in src/build/Make.inc
, or add a bunch more options to suppress particular instruction sets (in this case, passing -mno-bmi2
— see e.g. here). If we don't do this, we obtain error messages such as the following:
/tmp/cc902xwd.s:43: Error: no such instruction: 'shlx %rax,8(%rdi),%rax'
/tmp/cc902xwd.s:272: Error: no such instruction: 'shlx %rax,8(%rdi),%rax'
I've seen this happen when attempting to compile gyre_grid.f90
. This has happened on the following CPUs (from /proc/cpuinfo
) running linux 2.6.32:
- Intel(R) Xeon(R) CPU E5-2670 v3
- Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
This was particularly confusing to debug because these CPUs advertise themselves as supporting the relevant instruction sets (in this case bmi2
) in /proc/cpuinfo
. I'm pretty sure this is not a bug with GYRE per se, but I'm leaving this here in case 1. this is indicative of some deeper underlying issue, and/or 2. someone else can benefit from this quick fix.
Best regards, Joel Ong
Hmm, that's weird -- march=native should compile for the current host. This is more an SDK error than a GYRE error...
I've just checked on a 2.6.32 system, and GYRE it compiles without issue. I'm guessing the problem lies with an especially-old binutils (assembler) installation on your system.