NVFORTRAN ignores options to compile without AVX2 instructions (SandyBridge processor)

I’m compiling some code for a sandybridge processor. In the source code, there’s a “dexp” function, which is resulting in an “illegal instruction” error, because it is being compiled as __fd_exp_1_avx2, which is unsupported on sandybridge processors, as they do not have AVX2 support. Even when I add -mcpu=sandybridge -tp=sandybridge -mno-avx2, it still compiles with this AVX2 instruction.

How can I solve this? I’m using HPC SDK 26.3.

Thanks.

Vinicius.

Hi vinicius16,

Sorry about that. My guess there’s some misconfiguration going on that’s causing the wrong intrinsic to be brought in. I filed a problem report, TPR #38436, and asked engineering to investigate.

The work around would be to use the flag “-tp=px” which targets a generic x86 processor.

% nvfortran test.F90 -Mkeepasm -tp=px
% grep exp test.s
        callq   __fd_exp_1

-Mat

Thanks, it worked here.