compilation failure with pgf90 13.2 on OSX

Hi,

I’m having problems compiling a piece of code on OSX with 13.2 version of the compiler. The code compiles fine with 13.2 on Linux with the same options, and the code also compiles with 12.10 on OSX, again with the same options.

The problem happens for -fastsse, or -O3, or -O2, but does not happen with -O1 or -O0.

any ideas?

Thanks,

Andy

Code:

      Subroutine LNM(nAtoms,Hess,Scrt1,nDim)
      Implicit None
      Integer nAtoms, nDim, i, j, ij, ji, ijTri
      Double Precision Hess(3*nAtoms*(3*nAtoms+1)/2),
     >                 Scrt1((3*nAtoms)**2)
      Do i = 1, nDim
       Do j = 1, i
        ijTri=i*(i-1)/2 + j
        ij = (j-1)*nDim + i
        ji = (i-1)*nDim + j
        Hess(ijTri) = 0.5d0*(Scrt1(ij)+Scrt1(ji))
        If (Abs(Hess(ijTri)).lt.1.0D-10) Hess(ijTri)=0d0
       End Do
      End Do
      End

Compilation output:

pjkws9:test andy$ pgf90 -c -fastsse test.f
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:162:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm11
                                      ^~~~~~
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:178:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm10
                                      ^~~~~~
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:309:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm11
                                      ^~~~~~
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:323:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm10
                                      ^~~~~~
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:422:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm11
                                      ^~~~~~
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:436:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm10
                                      ^~~~~~
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:578:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm11
                                      ^~~~~~
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:591:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm10
                                      ^~~~~~
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:699:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm11
                                      ^~~~~~
/var/folders/fh/kpzjpvyd2431jj97zh11_6sh0000gq/T/pgf909tVk3vurL8Kr.s:710:25: error: invalid operand for instruction
        blendvpd        %xmm0, %xmm9, %xmm10
                                      ^~~~~~

The symptoms indicate that the assembler is older than the current CPU, and does not understand some of the newer instructions that the processor can execute. I do not know about the PGI setup on OSX – whether the system assembler is used or PGI supplies its own assembler.

A work-around is to specify to the compiler that the code generation should target the latest CPU that the assembler knows about, using one of the -tp options.

Thanks, that certainly seems to be the case since:

pgf90 -c -fastsse -tp=p7-64 test.f

works, but:

pgf90 -c -fastsse -tp=penryn-64 test.f

does not, and I assume this is the default from:

pjkws9:test andy$ pgf90 -V

pgf90 13.2-0 64-bit target on Apple OS/X -tp penryn 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2013, STMicroelectronics, Inc.  All Rights Reserved.

but this is the same target as for 12.10:

pjkws9:test andy$ /opt/pgi/osx86-64/12.10/bin/pgf90 -V

pgf90 12.10-0 64-bit target on Apple OS/X -tp penryn 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2012, STMicroelectronics, Inc.  All Rights Reserved.

which works fine, and also so does explicitly specifying -tp=penryn-64, so I’m guessing there’s something wrong with OSX 13.2.

Hi Andy,

Which MacOSX version are you using? The problem is definitely an issue with the MacOSX tools you have installed, most likely clang, but we’ll need to reproduce it to be sure.

What is the output of the “pgcpuid” command? Also what clang version do you have (as found in your PGI installations “localrc” file)?

Note that “blendvpd” is a SSE4 instruction and is supported by a Penryn processor. Though, in 12.10 we hadn’t been generating it for Penryn. In 13.2, you will need to disable SSE vectorization (-Mvect=nosse) until we can figure out what needs to be updated on your system.

  • Mat

Mat,

Thanks for the info, here are the system details:

pjkws9:~ andy$ sw_vers -productVersion
10.8.2
pjkws9:~ andy$ xcodebuild -version
Xcode 4.5.2
Build version 4G2008a
pjkws9:~ andy$ pgcpuid 
vendor id       : GenuineIntel
model name      : Intel(R) Xeon(R) CPU           E5462  @ 2.80GHz
cpu family      : 6
model           : 7
stepping        : 6
processor count : 4
cores           : 4
clflush size    : 8
apic physical ID: 4
L2 cache size   : 6144KB
flags           : acpi apic cflush cmov cplds cx8 cx16 de dtes ferr fpu fxsr
flags           : ht lm mca mce mmx monitor msr mtrr nx pae pat pdcm pge pse
flags           : pseg36 selfsnoop speedstep sep sse sse2 sse3 ssse3 sse4.1
flags           : syscall tm tm2 tsc vme xtpr
type            : -tp penryn-64

and the file /opt/pgi/osx86/13.2/bin/localrc:

set GCCVERSION=40201;
set GCCDIR=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1;
set GCCINC=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include;
set MINOSX= 10.8.2;
set MINOSXNUM=108;
set OEM_INFO=32-bit target on Apple OS/X $INFOTPVAL;
set LOCALRC=YES;
set ISCLANG31=401;
set LC=$if(-Bstatic,-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc, -lgcc -lc -lgcc) -lSystem;
export PGI="/opt/pgi";
# makelocalrc executed by root Thu 21 Feb 2013

Hi Andy,

Engineering just sent me an updated compiler config file, osxrc, that should fix your issue. The email you have associated with your account is a general support email, if sent it to this address will you get it? If not, please send a note to PGI Customer Service (trs@pgroup.com) and I’ll have them sent it to you.

  • Mat

Mat,

The modified osxrc fixed the problem.

Thanks very much,

Andy