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

Error: forrtl: severe (157): Program Exception - access violation -- using VNI IMSL library

GoldenRetriever
Beginner
1,903 Views

Hi there,

I got this problem when using Multivariate Quadrature subroutine TWODQ from VNI IMSL libraries (the same problem with QDAGS subroutine)

The program gives the error: forrtl: severe (157): Program Exception - access violation

that happens at the line: mainret = _tmain(__argc, _targv, _tenviron); in crt0.c tab. I dont know what is this.

Anyone could point out the problem of my case please help. I would be appreciated and response..

Thanks n Cheers

***********************

System details:

Complier: Intel Visual Fortran Compiler.v11.1.048 for IA-32

Library: VNI.IMSL.Fortran.Intel IA32 for Intel Fortran Compiler 11.0

Microsoft Visual Studio 2008

Windows 7 32-bit

The project properties is configured as recommended by VNI.

Addition options for Command Line: /heap-arrays and /F6000000 also added

The code is copied from the example provided in VNI's User's Guide (page 894 Fortran Numerical MATH LIBRARY):

**************************************

INCLUDE 'link_fnl_static.h'
include 'link_fnl_shared.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'
USE IMSL_LIBRARIES

USE TWODQ_INT
USE UMACH_INT
IMPLICIT NONE
INTEGER IRULE, NOUT
REAL A, B, ERRABS, ERREST, ERRREL, F, G, H, RESULTS
EXTERNAL F, G, H
! Get output unit number
CALL UMACH (2, NOUT)
! Set limits of integration
A = 0.0
B = 1.0
! Set error tolerances
ERRABS = 0.0
ERRREL = 0.01
! Parameter for oscillatory function
IRULE = 6
CALL TWODQ (F, A, B, G, H, RESULTS, ERRABS, ERRREL, IRULE, ERREST)
! Print results
! WRITE (NOUT,99999) RESULTS, ERREST
! 99999 FORMAT ( Result =, F8.3, 13X, Error estimate = , 1PE9.3)
END

REAL FUNCTION F (X, Y)
REAL X, Y
REAL COS
INTRINSIC COS
F = Y*COS(X+Y*Y)
RETURN
END
!
REAL FUNCTION G (X)
REAL X
G = 1.0
RETURN
END
!
REAL FUNCTION H (X)
REAL X
H = 3.0
RETURN
END

*************************************************************

0 Kudos
10 Replies
ZlamalJakub
New Contributor III
1,903 Views

Is not problem on the following lines?

INCLUDE 'link_fnl_static.h'
include 'link_fnl_shared.h'

I think that only static or shared libraries can be used to link, not both (so only one from them should be used).

Jakub

0 Kudos
Steven_L_Intel1
Employee
1,903 Views
I can't reproduce this. I do agree that you don't want both INCLUDE lines (keep the STATIC one.)
0 Kudos
GoldenRetriever
Beginner
1,903 Views

Thanks Jakub and Steve. I got it runs after removing the line INCLUDE 'link_fnl_static.h'

I used to keep INCLUDE 'link_fnl_static.h' in my code, it worked well with my other programs; but for this particular example, it only works with include 'link_fnl_shared.h'. Still don't know why.

TD
0 Kudos
ysjiang
Beginner
1,903 Views

In my system(Visual Studio 2005+IVF11.1), your code can be run correctly.

And if reoving the lineINCLUDE 'link_fnl_static.h' or the lineINCLUDE 'link_fnl_static.h', it worked well.

On the other hand,it seems that there isno need to use 'USE IMSL_LIBRARIES' and 'USE TWODQ_INT

USE UMACH_INT' at the same time.

I don't know why^_^.

0 Kudos
Steven_L_Intel1
Employee
1,903 Views
IMSL_LIBRARIES contains USEs of all the _INT modules. Because that's a LOT of definitions, my preference would be to use only the _INT modules, but sometimes it might make sense to just use IMSL_LIBRARIES and get everything.
0 Kudos
GoldenRetriever
Beginner
1,903 Views
I still don't understand why in my laptop (Windows 7-32bit) it only run with INCLUDE 'link_fnl_shared.h' while If I want to run the same program on my desktop (Windows Vista - 32bit) I have to use INCLUDE 'link_fnl_static.h'
Both computer use the same version of Studio 2008 and Intel complier 11.1

Any explaination on this would be appreciated..
0 Kudos
Steven_L_Intel1
Employee
1,903 Views
You don't say what goes wrong. Using link_fnl_shared.h should work either place as long as both the Fortran and IMSL DLLs were on the system and pointed to by PATH. link_fnl_static.h should work anywhere. Note that with the latter, by default, you still need the DLL form of the OpenMP libraries (libiomp5md.dll) - this can be overridden.

What errors do you get?
0 Kudos
GoldenRetriever
Beginner
1,903 Views
In that program if I used link_fnl_shared.h and run with debug tool, the program exited with note: " The program '...' has exited with code 3 (0x3)"
When I run the built file (.exe) in Windows command window, it show the error as: "OMP:Error #15: Initializing libiomp5md.dll, but found libguide40.dll already initialized"

I'm not use if that information gives you any idea or you expect to see more than that?
Thanks Steve
0 Kudos
Steven_L_Intel1
Employee
1,903 Views
You have something that is referencing libguide40.lib. It may be a linker project property, an OBJCOMMENT directive in the source, or you're linking to some other object or library that was built with an old compiler. Make sure you are using the IMSL that is from the same version as the compiler.

There should be no references to libguide40.lib in your application if built with version 11.1.

Also, you want to make sure that the IMSL LIB folder listed in PATH points to an 11.1-supplied version of IMSL and not an older one.
0 Kudos
GoldenRetriever
Beginner
1,903 Views
Thanks Steve. I will have a look on details to see if thing can be fixed.
0 Kudos
Reply