$ export HP_F90OPTS="-O-lmylib" $ f90 -v hello.f90

LPATH environment variable

The LPATHenvironment variable is read by the linker to determine where to look for libraries to link with a program’s object file. Depending on whetherLPATH is set or not, one of the following actions occurs:

If LPATHis already set, only the directories listed in LPATHare searched. This happens, for example, whenLPATH is set in a user’s .kshrcor .cshrcfile, or after LPATHis defined from the command line.

IfLPATH is not set, the f90command sets defaultLPATH settings that are used when linking the object files listed on thef90 command line.

Because thef90 command sets LPATHbefore calling the linker, it should not be necessary to set this variable for most compilations. However, if you do need to set it (for example, you use theld command to link), the following directories should be the first items in LPATH:

/opt/fortran90/lib

/usr/lib

/opt/langtools/lib

The following command lines set LPATH to include these directories, using (respectively) the kshandcsh syntax:

$ export LPATH:/opt/fortran90/lib:/usr/lib:/opt/langtools/lib

% setenv LPATH "/opt/fortran90/lib:/usr/lib:/opt/langtools/lib"

To see how f90sets LPATHbefore calling the linker, compile with the -voption for verbose output. For an example, see “Linking with f90 vs. ld” (page 50).

MP_NUMBER_OF_THREADS environment variable

The MP_NUMBER_OF_THREADSenvironment variable sets the number of processors that are to execute a program that has been compiled for parallel execution. If you do not set this variable, it defaults to the number of processors on the executing machine.

The following command lines set MP_NUMBER_OF_THREADSto specify that programs compiled for parallel execution can execute on two processors:

$ export MP_NUMBER_OF_THREADS=2 # ksh syntax

% setenv MP_NUMBER_OF_THREADS 2 # csh syntax

For information about parallel execution, see “Compiling for parallel execution” (page 100).

Floating installation

More than one version of the HP Fortran compiler can be installed on one system at the same time. The floating installation feature allows you to install the compiler in any location. You can install as many compiler versions as required, depending on your system’s resources.

By default, HP Fortran is installed under the /opt/fortran90 directory. In earlier releases, the compiler driver (f90) looked for related files in subdirectories of the /opt/fortran90 directory. This prevented installation of more than one version of HP Fortran on the same system at the same time.

Only files in /opt/fortran90 are affected by floating installation. Regardless of the HP Fortran driver you use, the compiler still uses the libraries, linker, and other files located in /usr/lib and /usr/ccs.

Floating installation is designed to help facilitate in-house development. You must not ship libraries in non-standard places, because explicit runtime library specifications and linker options are required.

Floating installation

65

Page 65
Image 65
HP UX Fortran Software manual Floating installation, Lpath environment variable, Mpnumberofthreads environment variable