PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

compilation failure with pgf90 13.2 on OSX
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
p.j.knowles



Joined: 20 Apr 2006
Posts: 18

PostPosted: Thu Feb 21, 2013 5:23 am    Post subject: compilation failure with pgf90 13.2 on OSX Reply with quote

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:
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:
Code:
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
                                      ^~~~~~
Back to top
View user's profile
mecej4



Joined: 19 Jun 2011
Posts: 55

PostPosted: Thu Feb 21, 2013 5:40 am    Post subject: Re: compilation failure with pgf90 13.2 on OSX Reply with quote

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.
Back to top
View user's profile
p.j.knowles



Joined: 20 Apr 2006
Posts: 18

PostPosted: Thu Feb 21, 2013 6:09 am    Post subject: Reply with quote

Thanks, that certainly seems to be the case since:

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


works, but:

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


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

Code:
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:

Code:
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.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6146
Location: The Portland Group Inc.

PostPosted: Thu Feb 21, 2013 10:25 am    Post subject: Reply with quote

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
Back to top
View user's profile
p.j.knowles



Joined: 20 Apr 2006
Posts: 18

PostPosted: Thu Feb 21, 2013 11:53 am    Post subject: Reply with quote

Mat,

Thanks for the info, here are the system details:

Code:
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:

Code:
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
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group