Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29271 Discussions

Intel Visual Fortran with IMSL (version 11.1.048) is not working using windows 7!

RezaP
Beginner
1,125 Views
Hi,

I just bought Intel Visual Fortran 11.1.048 with IMSL and I have installed it on windows 7. I have set the directories for the Libraries and Includes. when I call a subroutine from IMSL, Visual Fortran cannot find the subroutine! is it because of the version that is not working with windows 7?

Here is an example of the error using BCLSF subroutine from IMSL for optimization:

error LNK2019: unresolved external symbol _BCLSF referenced in function _MAIN__ Source1.obj

I would appreciate any help.
Thanks,
Reza

0 Kudos
9 Replies
Steven_L_Intel1
Employee
1,125 Views
No, Windows 7 has nothing to do with this. Did you also add the lines:

INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:"libiomp5md.lib"

to one of your sources? You need to tell the compiler which set of IMSL libraries you want - it doesn't know otherwise.
0 Kudos
RezaP
Beginner
1,125 Views
Thanks Steve,

When I compile the code after add those lines, it doesn't give me an error but I get the following mesage after run the code:

'Test1.exe': Loaded 'C:\Program Files (x86)\Common Files\Intel\Shared Files\fortran\Bin\Intel64\libiomp5md.dll', Binary was not built with debug information.

is the message belong to the nature of the code or somethings wrong!

Regards,
Reza
0 Kudos
Steven_L_Intel1
Employee
1,125 Views
You can ignore that message. It's just the debugger saying that you can't debug that DLL (which you wouldn't want to anyway.)
0 Kudos
RezaP
Beginner
1,125 Views
Thanks Steve,

I am still have problem at least run an d example from IMSL Document! Here is a copy&paste of an example from IMSL BCLSF routine:

PROGRAM Test2
IMPLICIT NONE
INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:"libiomp5md.lib"

! Declaration of variables
INTEGER M, N
PARAMETER (M=2, N=2)
!
INTEGER IPARAM(7), ITP, NOUT
REAL FSCALE(M), FVEC(M), X(N), XGUESS(N), XLB(N), XS(N), XUB(N)
REAL XSCALE(N),RPARAM(7),FJAC(M,N),LDFJAC(M,N)
EXTERNAL ROSBCK
! Compute the least squares for the
! Rosenbrock function.
DATA XGUESS/-1.2E0, 1.0E0/
DATA XLB/-2.0E0, -1.0E0/, XUB/0.5E0, 2.0E0/
! All the bounds are provided
ITP = 0
! Default parameters are used
IPARAM(1) = 0
!
! CALL BCLSF (ROSBCK, M, ITP, XLB, XUB, X, xguess,
! & iparam,fvec)

CALL BCLSF (ROSBCK, M, N, XGUESS, ITP, XLB, XUB, XSCALE,
& FSCALE, IPARAM, RPARAM, X, FVEC, FJAC, LDFJAC)

! Print results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) X, FVEC, IPARAM(3), IPARAM(4)
!
99999 FORMAT (' The solution is ', 2F9.4, //, ' The function ',
& 'evaluated at the solution is ', /, 18X, 2F9.4, //,
& ' The number of iterations is ', 10X, I3, /, ' The ',
& 'number of function evaluations is ', I3, /)
ENDPROGRAM
!
SUBROUTINE ROSBCK (M, N, X, F)
INTEGER M, N
REAL X(N), F(M)
!
F(1) = 1.0E1*(X(2)-X(1)*X(1))
F(2) = 1.0E0 - X(1)
RETURN
END


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
here is the debug show:

'Test1.exe': Loaded 'C:\Windows\System32\KernelBase.dll'
'Test1.exe': Loaded 'C:\Program Files (x86)\Common Files\Intel\Shared Files\fortran\Bin\Intel64\libiomp5md.dll', Binary was not built with debug information.
'Test1.exe': Loaded 'C:\Windows\System32\imagehlp.dll'
'Test1.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
The program '[3120] Test1.exe: Native' has exited with code 0 (0x0).

After calling BCLSF, it exits!!!
0 Kudos
Steven_L_Intel1
Employee
1,125 Views
What is happening is that BCLSF is reporting an error and terminating the program. You don't see this because when yoiu step through it with the debugger, the console window is closed as soon as the program exits. If you "Start without debugging", you'd see this:

[plain] *** TERMINAL ERROR 3 from B2LSF.  The leading dimension of the Jacobian,
 ***          FJAC, must be greater than or equal to M while LDFJAC = 0 and M
 ***          = 2 are given.
     Here is a traceback of subprogram calls in reverse order:
     Routine name                    Error type  Error code
     ------------                    ----------  ----------
     B2LSF                                5           3    (Called internally)
     BCLSF                                0           0
     USER                                 0           0[/plain]

I notice that you are either looking at old documentation or have chosen to "convert" the example in the IMSL manual to the older "FORTRAN 77" calling convention. If I use the example in the current documentation, below, it works. I'd have to investigate further but my guess is that some of the mandatory arguments you pass need to be initialized. Note that the below example is free-form source.

[fortran]USE BCLSF_INT
USE UMACH_INT
IMPLICIT NONE
INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

! Declaration of variables
INTEGER M, N
PARAMETER (M=2, N=2)
!
INTEGER IPARAM(7), ITP, NOUT
REAL FSCALE(M), FVEC(M), X(N), XGUESS(N), XLB(N), XS(N), XUB(N)
EXTERNAL ROSBCK
! Compute the least squares for the
! Rosenbrock function.
DATA XGUESS/-1.2E0, 1.0E0/
DATA XLB/-2.0E0, -1.0E0/, XUB/0.5E0, 2.0E0/
! All the bounds are provided
ITP = 0
! Default parameters are used
IPARAM(1) = 0
!
CALL BCLSF (ROSBCK, M, ITP, XLB, XUB, X, xguess=xguess, &
iparam=iparam, fvec=fvec)
! Print results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) X, FVEC, IPARAM(3), IPARAM(4)
!
99999 FORMAT (' The solution is ', 2F9.4, //, ' The function ', &
'evaluated at the solution is ', /, 18X, 2F9.4, //, &
' The number of iterations is ', 10X, I3, /, ' The ', &
'number of function evaluations is ', I3, /)
END
!
SUBROUTINE ROSBCK (M, N, X, F)
INTEGER M, N
REAL X(N), F(M)
!
F(1) = 1.0E1*(X(2)-X(1)*X(1))
F(2) = 1.0E0 - X(1)
RETURN
END[/fortran]


0 Kudos
RezaP
Beginner
1,125 Views
Thank you, if I use f90 it is working but it doesn't work with F77!

0 Kudos
Steven_L_Intel1
Employee
1,125 Views
Well, no, the source I posted is free-form so you would want to use a .f90 file type. You aren't using F77 anyway. The source could be converted to fixed-form, but why would you want to do that?
0 Kudos
mecej4
Honored Contributor III
1,125 Views
It can be confusing for someone not used to the F90 way of calling overloaded subroutines/functions with optional arguments. Versions 5 and later of the IMSL libraries list only the F9x usage examples, and the argument descriptions list many of the required arguments in the F77 call as "optional" or "additional".

Merely changing the source code format from free to fixed and calling the F77 routine with an F9x argument list with no optional arguments will most often cause your program to crash mysteriously. If you do not provide an interface, the arguments are not checked at compile time.

If you wish to stay with the F77 interface, it will be less confusing to read the IMSL 4 documentation that came as an option with CVF 6, for example. Those old documents are no longer available at www.roguewave.com. Those old documents also show F77 example source codes.

Note, also, that using fixed-format source or using a ".f" or ".for" file suffix does not tell the compiler to treat the source as strictly Fortran-77. If, by mistake, your fixed format source code contains lines of code that are legal in Fortran 9X but would be erroneous in Fortran-77, they will not be flagged by default. Using the /Wcheck option may help up to a point.

In your F77 source listing, you have the following errors:

1. You should initialize two arrays:

DATA XS/2*1.0E0/, FSCALE/2*1.0E0/

2. The argument LDFJAC is completely botched up. The variable name is supposed to be suggestive: L(eading) D(imension of) FJAC, but intentions do not always bear fruit. LDFJAC should be declared integer, and set to the leading declared dimension of FJAC.

INTEGER LDFJAC
...
LDFJAC=M

0 Kudos
RezaP
Beginner
1,125 Views
Thanks Steve for the information. Now that makes sense!
0 Kudos
Reply