IMSL
New Version of Imsl
===================
. To find the version of the new IMSL library compile and
execute versionm.f, where you compile using the alias
"f77imslnew", which is
f77 -o !$:r.exe $FFLAGS !* $LINK_FNL
and requires
source /opt/lib/ipt_1.2/ipt/bin/iptsetup.csh
which is currently(?) in my .cshrc file, but should probably
not be (interference with other programs, etc), but see
below for details on this.
(note: If using EG routines include $LINK_EG at the end of the
compile command).
The result of compiling version1.f using the new IMSL library
via f77imslnew is the following output:
[53]% versionm.exe
IMSL MATH/LIBRARY Version Number: IMSL Fortran Numerical Libraries Version 3
Operationg System ID Number: Solaris Version 2.3
Fortran Compiler Version Number: SPARCompiler Fortran 3.0.1
IMSL MATH/LIBRARY License Number: 999999
The result of compiling versionm.f using the old IMSL library
via f77imsl, which is
f77 !* -o !^:r.exe -L/opt/lib -limsl -lsocket -lnsl
is
[56]% versionm.exe
IMSL MATH/LIBRARY Version Number: IMSL MATH/LIBRARY Version 2.0
Operationg System ID Number: SunOS 4.1.1
Fortran Compiler Version Number: Sun FORTRAN f77 1.3.1 FCS
IMSL MATH/LIBRARY License Number: 504014-000
. For a Fortran program which calls a new IMSL routine to execute
LD_LIBRARY_PATH must contain
/opt/SUNWspro/SC3.0.1/lib
E.g.,
setenv LD_LIBRARY_PATH /opt/SUNWspro/SC3.0.1/lib:$LD_LIBRARY_PATH
If this is not the case then you ** may ** get a load error as
indicated by the following example:
[62]% cat fnl.f
C Declare variables
PARAMETER (IPATH=1, LDA=3, N=3)
PARAMETER (LIBVER=1, LICNUM=4)
CHARACTER VERSION*48, LICENSE*48, VERML*48
REAL A(LDA,LDA), B(N), X(N)
c* EXTERNAL LSARG, UMACH, VERML, WRRRN
C
C Set values for A and B
C
C A = ( 33.0 16.0 72.0)
C (-24.0 -10.0 -57.0)
C ( 18.0 -11.0 7.0)
C
C B = (129.0 -96.0 8.5)
C
DATA A/33.0, -24.0, 18.0, 16.0, -10.0, -11.0, 72.0, -57.0, 7.0/
DATA B/129.0, -96.0, 8.5/
C
CALL UMACH (2, NOUT)
C
C Verify the version of the library we are running
C by retrieving the version number via verml().
C Verify correct installation of the license number
C by retrieving the customer number via verml().
C
c* VERSION = VERML(LIBVER)
c* LICENSE = VERML(LICNUM)
c* WRITE(NOUT,*) 'Library version: ', VERSION
c* WRITE(NOUT,*) 'Customer number: ', LICENSE
C
CALL LSARG (N, A, LDA, B, IPATH, X)
C Print results
CALL WRRRN ('X', 1, N, X, 1, 0)
END
[37]% f77imslnew fnl.f
fnl.f:
MAIN:
[38]% fnl.exe
ld.so.1: fnl.exe: fatal: libF77.so.2: can't open file: errno=2
Killed
This will happen with ** any ** fortran program calaling an imsl
routine form the new imsl library. What is required is that
the file
libF77.so.2
which is located at
/opt/SUNWspro/SC3.0.1/lib/libF77.so.2
be included in
LD_LIBRARY_PATH
Alternatively, one can include the reference via "-L" as shown
below:
f77 -o fnl fnl.f $LINK_FNL $FFLAGS
fnl.f:
MAIN:
[10]% fnl
(without the -L referene or without using LD_LIBRARY_PATH, it
fails)
ld.so.1: fnl: fatal: libF77.so.2: can't open file: errno=2
Killed
[11]% f77 -L/opt/SUNWspro/SC3.0.1/lib/ -o fnl fnl.f $LINK_FNL $FFLAGS
fnl.f:
MAIN:
[12]% fnl
X
1 2 3
1.000 1.500 1.000
(with the -L refrherenc, it executes)
Note: with the -L reference
[16]% ldd fnl
libimsl.so => /opt/lib/ipt_1.2/lib/lib.solaris/libimsl.so
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libintl.so.1 => /usr/lib/libintl.so.1
libmp.so.1 => /usr/lib/libmp.so.1
libw.so.1 => /usr/lib/libw.so.1
and without the -L reference
[18]% ldd fnl
libimsl.so => /opt/lib/ipt_1.2/lib/lib.solaris/libimsl.so
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libF77.so.2 => (not found)
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libintl.so.1 => /usr/lib/libintl.so.1
libmp.so.1 => /usr/lib/libmp.so.1
libw.so.1 => /usr/lib/libw.so.1
Also note that when compiling and using the old imsl library we get
59]% f77imsl fnl.f
fnl.f:
MAIN:
[60]% ldd fnl.exe
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libF77.so.2 => /opt/SUNWspro/lib/libF77.so.2
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libintl.so.1 => /usr/lib/libintl.so.1
libmp.so.1 => /usr/lib/libmp.so.1
libw.so.1 => /usr/lib/libw.so.1
[61]%
Imsl recommends setting the LD_LIBRARY_PATH to include the
directory of
libF77.so.2 => /opt/SUNWspro/lib/libF77.so.2
because when a user uses imsl he/she must source iptsetup.csh
so he./she will automatically get LD_LIBRARY_PATH set.