Silverfrost Forums

Welcome to our forums

CheckMate causes runtime failure when calling NAG Library DLLs

22 Jun 2006 8:47 #767

We have been testing calling the DLL version of the NAG Fortran Library from FTN95 and SCC through Plato3. We notice that under CheckMate Win32 many programs fail with access violation but work under Debug Win32 or Release Win32. For instance, the NAG example program for calling the C05ADF routine is one of these that fail under CheckMate, but there are many others. Some don't actually fail but give absurd results when returning from the NAG routine. If you wish I can provide examples.

Zahid Aziz The University of Nottingham

22 Jun 2006 9:06 #770

Zahid

CheckMate includes all of the checking options.

I would try a test with just /CHECK, then /UNDEF (which includes /CHECK), then /FULL_UNDEF (which includes /UNDEF).

It is possible that it will work with /UNDEF but not /FULL_UNDEF and this may be sufficient.

23 Jun 2006 2:03 #775

Paul,

The Fortran program calling the c05adf NAG routine (using NAG DLLs) fails with /check and with /undef. It works with /full_debug.

A C example program calling NAG routine d02bgf fails with /check, /undef and /full_undef, but works with /debug.

Zahid.

23 Jun 2006 4:37 #779

Zahid

Maybe you should see if NAG has an comments on this.

A NAG DLL built for CVF should be accessed via /IMPORT_LIB on the FTN95 command line. This is the same as setting a Plato project reference with property 'STDCALL'.

If the NAG DLL is built for FTN95 then you will not need /IMPORT_LIB.

27 Jun 2006 1:18 #804

This problem occurs despite the fact that I have used /IMPORT_LIB (or the Plato project property stdcall).

Zahid Aziz

27 Jun 2006 1:28 #805

Zahid

From your reply I assume that the NAG DLL is a Fortran DLL built for CVF. I am also assuming the you are using the latest release 4.91. If you can send me a short sample program that illustrates the failure then I will investigate the problem as soon as I can.

Regards

Paul

27 Jun 2006 2:08 #806

Paul,

Yes, the NAG DLLs are built from the NAG Fortran Library using CVF.

I am using FTN95 4.9.0, which is the latest version that I can access through the Silverfrost website. I have checked just now, and can't see 4.91.

Here is a shortened version of the standard NAG example program for calling the routine c05adf:

  program nagexample
  DOUBLE PRECISION A, B, EPS, ETA, X
  INTEGER          IFAIL
  DOUBLE PRECISION F
  EXTERNAL         F
  WRITE (*,*) 'C05ADF Example Program Results'
  A = 0.0D0
  B = 1.0D0
  EPS = 1.0D-5
  ETA = 0.0D0
  IFAIL = 1
  CALL C05ADF(A,B,EPS,ETA,F,X,IFAIL)
  WRITE (*,*)
  IF (IFAIL.EQ.0) THEN
     WRITE (*,*) 'Zero =', X
  ELSE
     WRITE (*,*) 'IFAIL =', IFAIL
     IF (IFAIL.EQ.2 .OR. IFAIL.EQ.3) WRITE (*,*)
 +       'Final point = ', X
  END IF
  STOP
  END
  • DOUBLE PRECISION FUNCTION F(X)
    DOUBLE PRECISION            X
    INTRINSIC                   EXP
    F = EXP(-X) - X
    RETURN
    END
    

I have re-confirmed that it fails with access violation under Checkmate and works with Debug. You will need to link it with the two NAG DLL files.

Thanks, Zahid.

27 Jun 2006 4:38 #808

Zahid

Version 4.91 is available as a patch. Details are given in the Announcements.

You will need version 4.91 because it contains a relevant bug fix.

Please let me know if this problem is not fixed in the patch.

Regards

Paul

27 Jun 2006 7:08 #810

Paul,

Shortly after my last message I did get hold of 4.9.1 and tried it, but I got the same failure as before.

Zahid.

Please login to reply.