- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Fortran Forum,
when I try to use the library NEQNF to solve a generic non-linear system, I get the following error:
forrtl: severe (157): Program Exception - access violation
I really do not know what the problem might be, also because I do not have any issues when I use another library, for example ZREAL.
Visual studio actually builds the code, but when I run it, I get this type of error. I'm using VS 2012 in Debug Win32.
What could be the source of this problem and how can I solve it? I write here an example of a code to solve a generic non-linear system:
Can anyone offer any suggestions?
Thanks.
Federico
PROGRAM NONLINEARSYSTEM include 'link_fnl_shared.h' USE NEQNF_INT !USE IMSL_LIBRARIES IMPLICIT NONE INTEGER(4) N,ITMAX PARAMETER (N=2) REAL(8) X(N),X0(N) REAL(8) ERRREL EXTERNAL SYST ERRREL = 1.0E-5 X0(1) = 1. X0(2) = 1. ITMAX=10000 CALL NEQNF(SYST, X, ERRREL, N, ITMAX, XGUESS=X0) END PROGRAM SUBROUTINE SYST (X,F,N) IMPLICIT NONE INTEGER(4) N REAL(8) X(N),F(N) F(1) = X(1) * X(1) - X(2) F(2) = X(2) + LOG (X(1)) - 2 RETURN END SUBROUTINE SYST
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your test program runs and gives the final x = [1.31410, 1.72685] after about 8 function evaluations, when built with IFort 2017 Update 4 and IMSL 7.
Please provide details regarding your OS, compiler and IMSL FNL versions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My compiler is Visual Studio 2012, and I run the debug Win32 on windows 7. About IMSL FNL version I use IMSL 7 too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please compile and run with the /traceback option added, and report the traceback output in your reply.
I again built the program using the old version IFort 11.1.072 and FNL 7.0.1, and the program ran correctly (IA32 or Intel64). Please state which compiler version you use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And just to avoid confusion, Visual Studio is not a compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I just started working on Visual Studio in Fortran language.
First of all, I would like to thank you for your availability.
Actually my compiler is: Intel (R) Visual Fortran Compiler XE 13.0.1.119 [IA-32]
I attach what I think the traceback output is. Otherwise, please tell me where I can find the traceback output. Again, I thank you for your time.
Federico.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The traceback has the correct format, but the PC (program counter) values indicate that you probably used the older IMSL installer imsl_7.0.1.027_setup.exe rather than the current imsl_7.0.1.033_setup.exe. Can you confirm this, assuming that you installed IMSL yourself?
I am afraid that there are few IMSL users who use the same versions of VS, Ifort and IMSL as you, so reproducing the bug can be troublesome.
If you can find the file BUILDLOG.HTM (this is produced when Visual Studio is used to build your EXE), please post it, there may be some clues in it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just found out that the actual that the actual IMSL version I am using is:
IMSL(R) Fortran Numerical Library
Version 6.0.0
About the file BUILDLOG, this is the output. (Unfortunately, I cannot attach a file with extension .htm)
Federico.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/iface:cvf I think is wrong it should be the default calling convention not "compact visual fortran" convention which was stdcall based
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Andrew,
How can I use the default calling convention instead of cvf?
Thank you,
Federico.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do not use the /iface: option at all, or specify /iface:default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you all very much! Now, it seems to be working: I just changed that option as suggested.
Federico
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page