C H A P T E R  4

Sun Performance Library for x86

This chapter describes the differences between the SPARC and x86 versions of the Sun Performance Library, and how to use compiler and linking options for SSE2-enabled machines and for generic x86 machines that are not SSE2-enabled.

This release of Sun Performance Library includes libraries for the Solaris/x86 platform. Two versions are available:

The x86 version of Sun Performance Library is functionally identical to the SPARC version, with the following exceptions:


Compiling for x86 Platforms

The following versions of Solaris/x86 are required for SSE2 support:

As with the SPARC version, the Sun Performance Library is linked into the application using the -xlic_lib=sunperf flag.[1]

Use the -xarch flag to select between the SSE2 and compatibility versions of the Sun Performance Library. Setting -xarch=sse2 or -xtarget=pentium4 will build the SSE2 version of the library. Also, if building on a Pentium 4 machine running Solaris 9 update 6 or Solaris 10, setting -xarch=native or -xtarget=native or -fast will build the SSE2 version of the library. Any other link settings will build the compatibility version of the library.[2]

Examples:

The following compile and link settings will build the compatibility version of the Sun Performance Library:

f95 -xarch=generic -xlic_lib=sunperf example.f -o example

The following compile and link settings will build the SSE2 version of the Sun Performance Library:

f95 -xarch=sse2 -xlic_lib=sunperf example.f -o example

The following compile and link settings will build the SSE2 version of the Sun Performance Library if built on a Pentium 4 machine running Solaris 9 update 6, or build the compatibility on other platforms:

f95 -fast -xlic_lib=sunperf example.f -o example



caution icon

Caution - Programs that are compiled with -xarch=sse2 to run on Solaris x86 must be run only on platforms that are SSE2 enabled. Running such programs on platforms that are not SSE2-enabled could result in segmentation faults or incorrect results occurring without any explicit warning messages.




1 (Footnote) If compiling and linking a C/C++ program using the C/C++ compiler driver, cc, you may need to expliciltly link to the Fortran runtime libraries or use the Fortran F95 compiler driver to perform the link step. Refer to the performance_library README file to see whether this restriction applies to your distribution.
2 (Footnote) If statically linking the SSE2 library, you may also need to explicitly set the library path . Refer to the performance_library README file to see whether this restriction applies to your distribution