The solver fails to pick up a user Fortran shared library when running on an Opteron, using the PGF90 compiler. However the shared library is present.


Please note that this problem only occurs if the shared library has been compiled on a different machine from that used to run the solver. If this is the case, then the problem may be due to unresolved dependencies. A work-around for this problem is to copy some additional shared libraries into the directory containing the user Fortran shared library.

Before doing anything else, check the first error message given by the solver:

Error opening /home/fred/fortran/project/linux-amd64/libtest.so: libpgf90.so: cannot open shared object file: No such file or directory

If the problem is due to an unresolved dependency, then you will see a second shared object file listed (libpgf90.so in the above example). If so, then the procedure below can be used to work around the problem. Note that this advice is correct for CFX-10.0. Future releases may not require this procedure.


STEP 1: Re-make the shared library, instructing the compiler to check for dependencies.

This is done by using the -WL,-R$ORIGIN argument on the cfx5mkext command line. For example:

cfx5mkext test.F -WL,-R$ORIGIN


STEP 2: Use ldd to list the dependencies.

Example shown below, with sample output:

ldd linux-amd64/libPipeValve_inlet.so
libpgf90.so => /usr/pgi/linux86-64/5.2/libso/libpgf90.so
libpgf90_rpm1.so => /usr/pgi/linux86-64/5.2/libso/libpgf90_rpm1.so
libpgf902.so => /usr/pgi/linux86-64/5.2/libso/libpgf902.so
libpgf90rtl.so => /usr/pgi/linux86-64/5.2/libso/libpgf90rtl.so
libpgftnrtl.so => /usr/pgi/linux86-64/5.2/libso/libpgftnrtl.so
libg2c.so.0 => /usr/lib64/libg2c.so.0 (0x0000002a95d09000)
libc.so.6 => /lib64/libc.so.6 (0x0000002a95e2e000)
libpgc.so => /usr/pgi/linux86-64/5.2/libso/libpgc.so
libm.so.6 => /lib64/libm.so.6 (0x0000002a9618a000)
/lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2


STEP 3: Copy the required files to the directory containing the user Fortran sharedlibrary.

For the example listing shown in step 2, this would be all files named /usr/pgi/*.so. For example::

cp /usr/pgi/linux86-64/5.2/libso/libpgf90.so /usr/pgi/linux86-64/5.2/libso/libpgf90_rpm1.so /usr/pgi/linux86-64/5.2/libso/libpgf902.so /usr/pgi/linux86-64/5.2/libso/libpgf90rtl.so /usr/pgi/linux86-64/5.2/libso/libpgftnrtl.so /usr/pgi/linux86-64/5.2/libso/libpgc.so linux-amd64/.


STEP 4:On a machine without a compiler, check that all dependencies are resolved.

The ldd command is used to do this. Example shown below:

ldd linux-amd64/libPipeValve_inlet.so
libpgf90.so => /home/fred/fortran/project/linux-amd64/libpgf90.so
libpgf90_rpm1.so => /home/fred/fortran/project/linux-amd64/libpgf90_rpm1.so
libpgf902.so => /home/fred/fortran/project/linux-amd64/libpgf902.so
libpgf90rtl.so => /home/fred/fortran/project/linux-amd64/libpgf90rtl.so
libpgftnrtl.so => /home/fred/fortran/project/linux-amd64/libpgftnrtl.so
libg2c.so.0 => /usr/lib64/libg2c.so.0
libc.so.6 => /lib64/tls/libc.so.6
libpgc.so => /home/fred/fortran/project/linux-amd64/libpgc.so
libm.so.6 => /lib64/tls/libm.so.6
/lib64/ld-linux-x86-64.so.2





Show Form
No comments yet. Be the first to add a comment!