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

Unable to successfuly call IMSL routine

Brad_Smith
Beginner
357 Views
I have written a simple program to call an IMSL routine (below), which does not execute.

program Test_IMSL_Interface
INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'
Implicit none
Real(8), dimension (2,2) :: A
Real(8), dimension (2):: B,X
A(1,1)=3
A(1,2)=2
A(2,1)=4
A(2,2)=7
B(1)=7
B(2)=2
CALL D_LSARG (A,B,X)
Write(*,11) X(1)
Write(*,11) X(2)
11 Format (ES12.4)
End program Test_IMSL_Interface

The program compiles and links successfully but gives an error of access violation at the line CALL D_LSARG (A,B,X). Specific error: Access violation reading location 0xffffffffffffffff.

I have followed the instructions at

http://software.intel.com/en-us/articles/installing-and-using-the-imsl-libraries/

for adding the library and include paths to IMSL for Intel64. I am running MS Visual Studio/Intel 64, Version 11.1 on Win7 64 bit.

I would appreciate some help.

Thanks in advance.

Brad

0 Kudos
2 Replies
Steven_L_Intel1
Employee
357 Views
The error is that you are calling D_LSARG which is the "Fortran 90" interface specific, but you have not added:

USE LSARG_INT

to make that interface available. So the compiler doesn't know that D_LSARG wants the arrays passed by descriptor.

Add the USE LSARG_INT following the PROGRAM statement and change D_LSARG to LSARG. You should not use the specific names unless you are doing something that requires them, such as passing as an actual argument. Generics are your friend.
0 Kudos
Brad_Smith
Beginner
357 Views
Your correction worked fine.
Thank you very much Steve.

Brad
0 Kudos
Reply