LIBPATH: Setting library search paths
Under normal circumstances, you only need LIBPATH if shared libraries
are located in different directories at run time rather than at compile
time. To use LIBPATH, set it at run time
to the names of any directories that contain required user libraries,
plus /usr/lib:
# Compile and link
xlf95 -L/usr/lib/mydir1 -L/usr/lib/mydir2 -lmylib1 -lmylib2 test.f
# When the libraries are in the same directories as at compile
# time, the program finds them.
a.out
# If libmylib1.a and libmylib2.a are moved to /usr/lib/mydir3,
# you must set the LIBPATH variable:
export LIBPATH=/usr/lib/mydir3:/usr/lib
a.out
When running the compiler, ensure that the library libxlf90.a is in /usr/lib or is in a directory named in the LIBPATH setting. Otherwise, you cannot run the compiler, because it is dynamically linked with the libxlf90.a library.