This discussion is archived
8 Replies Latest reply: Jan 31, 2012 9:16 PM by user12616316 RSS

SS12.3 FORTRAN code requires SSE2?

913341 Newbie
Currently Being Moderated
I maybe the last person left on Earth with a machine old enough to notice this, but...

It appears that code generated by the Studio 12.3 compiler on Solaris/x86 requires SSE2 instructions REGARDLESS of -xarch setting to the contrary.
See sample runs below.

Does anybody have a work around that will allow me to use SS12.3 compilers?
This problem did not occur with the SS12.2 compilers (use of which is my only work around at the moment).

-Paul
$ uname -a
SunOS cloon 5.10 Generic_142901-03 i86pc i386 i86pc
$ /usr/sbin/prtdiag | grep Processor
==== Processor Sockets ====================================
Intel Pentium III Processor      PGA 370

$ cat hello.f
       program hello
          print *, "Hello World!"
       end program hello
$ f77 -V
NOTICE: Invoking /usr/local/solarisstudio12.3/bin/f90 -f77 -ftrap=%none -V
f90: Sun Fortran 95 8.6 SunOS_i386 2011/11/16

$ f77 -xarch=generic hello.f && ./a.out 
NOTICE: Invoking /usr/local/solarisstudio12.3/bin/f90 -f77 -ftrap=%none -xarch=generic hello.f
hello.f:
 MAIN hello:
ld.so.1: a.out: fatal: /usr/local/solarisstudio12.3/lib/libfsu.so.1: hardware capability unsupported: 0x1000  [ SSE2 ]
Killed

$ f77 -xarch=pentium_pro hello.f && ./a.out 
NOTICE: Invoking /usr/local/solarisstudio12.3/bin/f90 -f77 -ftrap=%none -xarch=pentium_pro hello.f
hello.f:
 MAIN hello:
ld.so.1: a.out: fatal: /usr/local/solarisstudio12.3/lib/libfsu.so.1: hardware capability unsupported: 0x1000  [ SSE2 ]
Killed

$ f77 -xarch=i386 hello.f && ./a.out 
NOTICE: Invoking /usr/local/solarisstudio12.3/bin/f90 -f77 -ftrap=%none -xarch=i386 hello.f
f90: Warning: illegal use of -xarch option, illegal value ignored: i386
hello.f:
 MAIN hello:
ld.so.1: a.out: fatal: /usr/local/solarisstudio12.3/lib/libfsu.so.1: hardware capability unsupported: 0x1000  [ SSE2 ]
Killed
  • 1. Re: SS12.3 FORTRAN code requires SSE2?
    user12616316 Newbie
    Currently Being Moderated
    The system requirements listed for Solaris Studio 12.3 on Intel say that a 64-bit CPU is required. All the 64-bit Intel-32 CPUs support the SSE2 instructions.

    Nonetheless, I am not certain we intended to disallow generating code for 32-bit Intel CPUs that do not support SSE2. I recall that we discussed requiring SSE2 support, but I am not certain what we decided. I know that we require the SSE instructions for our implementation of quadruple-precision arithmetic, but the Pentium III supports SSE. I have asked the question internally, and I shall let you know what I am told.

    Robert Corbett
  • 2. Re: SS12.3 FORTRAN code requires SSE2?
    user12616316 Newbie
    Currently Being Moderated
    I checked and found that statically linked programs run successfully. Try adding the option -Bstatic.

    Robert Corbett
  • 3. Re: SS12.3 FORTRAN code requires SSE2?
    913341 Newbie
    Currently Being Moderated
    I am sorry I missed that a 64-bit CPU is a requirement for use on Intel.
    However, use of -Bstatic does appear to resolve the problem for me.

    Thanks,
    -Paul
  • 4. Re: SS12.3 FORTRAN code requires SSE2?
    user12616316 Newbie
    Currently Being Moderated
    I am sorry, but linking statically solves the problem only for simple cases. It does not work for programs that use ALLOCATE and DEALLOCATE statements.

    Robert Corbett
  • 5. Re: SS12.3 FORTRAN code requires SSE2?
    913341 Newbie
    Currently Being Moderated
    I also found it a bit challenging to get -Bstatic passed in the right place(s) when building large projects with Makefiles.
    So, I am left unable to compile FORTRAN codes for my PentiumIII w/ SS12.3, but am using C and C++ w/o any problems.
    For FORTRAN I am sticking w/ the 12.2 compilers.

    So, are there plans to "lower the bar" to eliminate SSE2 requirements?

    I'd like to request either of the following:
    + Fix code generation and/or runtime libs to honor -xarch=pentium_pro and -xarch=sse.
    + Remove from the allowed/documented -Xarch options any that the compiler can't honor.

    Obviously, I'd prefer the first option.
    But removing the "inoperative" options would be better than the current state.

    -Paul
  • 6. Re: SS12.3 FORTRAN code requires SSE2?
    user12616316 Newbie
    Currently Being Moderated
    I am sorry, but unless the bug is escalated, it is unlikely to be fixed.

    Robert Corbett
  • 7. Re: SS12.3 FORTRAN code requires SSE2?
    913341 Newbie
    Currently Being Moderated
    OK, that is understandable.
    -Paul
  • 8. Re: SS12.3 FORTRAN code requires SSE2?
    user12616316 Newbie
    Currently Being Moderated
    There is a way to fix the problem as a field modification. The problem is the result of the HWCAP bit for SSE2 being set in libfsu.so.1. The bit should be set because one of the object files included in libfsu.so.1 uses some SSE2 instructions. However, those instructions are in code that is invoked only by programs that use a compiler option that is not commonly used in codes compiled for Solaris. If the HWCAP bit for SSE2 is cleared, it should allow most programs to work on a Pentium III.

    The HWCAP bits are in the capabilities section of the shared object libfsu.so.1. The name of the capabilities section is .SUNW_cap. The current value of the only entry in the capabilities section of libfsu.so.1 is 0x1801. The bit 0x1000 is the SSE2 bit. If the entry in the capabilities section is replaced with 0x0801, the SSE2 bit will be clear.

    Although it is possible to write a simple program to clear the SSE2 bit, the utility elfedit provides an easier way to clear the bit. Elfedit is available in OpenSolaris and Solaris 11. An ELF file for Solaris 10 could be modified on a machine running OpenSolaris or Solaris 11 and then copied back to Solaris 10.

    Robert Corbett

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points