forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Import of NAG library
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Manfred



Joined: 05 Mar 2013
Posts: 10

PostPosted: Tue Mar 05, 2013 5:32 pm    Post subject: Import of NAG library Reply with quote

Hello together,
I started using silverforst some days ago because I am working on my PhD thesis and I have to make a simulation in fortran.
Because of many functions NAG library is very interesting to me.
Unfortunately it doesnt work, that I can import the NAG library and I dont know what my mistake is.
I have already downloaded the NAG library as .dll and saved it in the same folder like my fortran programm. In Plato I use the "add references".
With "external g05saf" I want to start my simple program.
The outout of the mistakes is the following:
Compiling and linking file: FreeFormat1.f95
Failed to load specific version of the framework, attempt to load latest version
I:\Dissertation\Fortran_test\FreeFormat1.F95(19) : error 809 - C:\Program Files\NAG\FL23\fldll234ml\lib\FLDLL234M_mkl.lib is neither a DLL nor a DBK file
I:\Dissertation\Fortran_test\FreeFormat1.F95(19) : error 809 - I:\Dissertation\Fortran_test\FLDLL234M_nag.lib is neither a DLL nor a DBK file
I:\Dissertation\Fortran_test\FreeFormat1.F95(19) : error 809 - C:\Program Files\NAG\FL23\fldll234ml\lib\FLDLL234M_nag.lib is neither a DLL nor a DBK file
Assembly file I:\Dissertation\Fortran_test\FreeFormat1.EXE for .NET 2.0 produced

Compilation failed.

Can anybody help me?

Thanks a lot!
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2124
Location: South Pole, Antarctica

PostPosted: Tue Mar 05, 2013 8:24 pm    Post subject: Reply with quote

It all depends with/for what compiler library (i suppose you have static one with the extension LIB) was made. Usually such libraries compiled with ancient Microsoft Fortran compiler work OK, then some made with Compaq or Intel may work and may not (they may swear like hell during compilation but work OK). The dynamic (with extension DLL) libraries should work with any compilers. As well as obviously the libraries supplied with Fortran sources.

I do not know your experience with this compiler or just with programming. For simplest experiment try making fortran text file which calls your NAG library routine (let's call your program MyProg.for) and then compile and link it with NAG LIB or DLL library under command prompt this way

>FTN95 MyProg.for
>SLINK MyProg.OBJ NAG.LIB

If all will be fine you'll get MYPROG.EXE file. Of you have Fortran sources of NAG library then extract needed subroutine and either add it to the same file MyProg.for or compile two files separately and slink like above.

If first way is the only option and it does not work because your library is not compatible then may be developers will help. Tricks also exist to wrap the library into DLL with the original compiler then all will definitely work.


Last edited by DanRRight on Wed Mar 06, 2013 9:09 am; edited 2 times in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6092
Location: Salford, UK

PostPosted: Wed Mar 06, 2013 8:59 am    Post subject: Reply with quote

It looks like you are compiling for .NET when you should be compiling for Win32. If you are using Plato or Visual Studio then it is simply a matter of selecting a different configuration from the toolbar. If you are working from a command line then do not use /CLR.

If you need to use .NET then things get a little more complicated.
Back to top
View user's profile Send private message
Manfred



Joined: 05 Mar 2013
Posts: 10

PostPosted: Wed Mar 06, 2013 10:36 am    Post subject: Reply with quote

Yes I was compiling with for .NET.
I have changed this to Win32 but then I get the Error: 101c3df7 routine at address 101C3DF7 [+0000]
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6092
Location: Salford, UK

PostPosted: Wed Mar 06, 2013 3:50 pm    Post subject: Reply with quote

Is this a compilation error or a run time error, etc. A lot more information is needed to be able to diagnose the problem.
Back to top
View user's profile Send private message
Manfred



Joined: 05 Mar 2013
Posts: 10

PostPosted: Wed Mar 06, 2013 4:42 pm    Post subject: Reply with quote

it is an access violation, with the hint: The instruction at address 101c3df7 attempted to read from location 00003bf2
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6092
Location: Salford, UK

PostPosted: Wed Mar 06, 2013 9:01 pm    Post subject: Reply with quote

Do you get the error report when compiling or when running the executable?
We need all the information you have and probably some you are not aware of yet.
Back to top
View user's profile Send private message
Manfred



Joined: 05 Mar 2013
Posts: 10

PostPosted: Wed Mar 06, 2013 10:58 pm    Post subject: Reply with quote

Compiling is always succesful.
And when I want to run the programm it stops with the above written message
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6092
Location: Salford, UK

PostPosted: Thu Mar 07, 2013 8:49 am    Post subject: Reply with quote

OK. Now compile the program using CHECKMATE (/CHECKMATE on the FTN95 command line) and then run the program using the debugger (SDBG).
You can do this from Plato or Visual Studio or you can run SDBG as a separate application.

This will probably show where to problem arises.
Back to top
View user's profile Send private message
Manfred



Joined: 05 Mar 2013
Posts: 10

PostPosted: Thu Mar 07, 2013 2:06 pm    Post subject: Reply with quote

Also if I use the Checkmate I dont get any more information than access violation!
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6092
Location: Salford, UK

PostPosted: Thu Mar 07, 2013 5:47 pm    Post subject: Reply with quote

But if you run using the debugger it will fail at the line causing the problem and you can do something about it.
Back to top
View user's profile Send private message
Manfred



Joined: 05 Mar 2013
Posts: 10

PostPosted: Thu Mar 07, 2013 9:05 pm    Post subject: Reply with quote

There is a message, that "g05saf" is unknown in the FLDLL234M_nag whether it should be in this folder
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1215

PostPosted: Fri Mar 08, 2013 1:10 am    Post subject: Reply with quote

Note that the NAG library version that you have mentioned, FLDLL234ML, uses the STDCALL convention, and therefore you have to compile and link as described at http://www.nag.com/doc/inun/fl23/dll4ml/un.html#ftn95 .

It would be simpler to call NAG FL from FTN95 if you used the better-matched NAG FL version, FLW3223DC. To build the NAG example for C05ADF, all that one would need to do is:

FTN95 xc05adf.f

slink xc05adf.obj c:\nag23DC\bin\FLW3223DC_nag.dll
Back to top
View user's profile Send private message
Manfred



Joined: 05 Mar 2013
Posts: 10

PostPosted: Mon Mar 11, 2013 1:54 pm    Post subject: Reply with quote

Ok, I have downloaded now the FLW3223DC.

Now I dont know how to use this. I thougth that I have just to do "add references" in the Plato, and link the following FLW3223DC_nag.dll...

But it doesnt work.

So what I have to do, the
FTN95 xc05adf.f

slink xc05adf.obj c:\nag23DC\bin\FLW3223DC_nag.dll

I dont know what you mean
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6092
Location: Salford, UK

PostPosted: Mon Mar 11, 2013 2:48 pm    Post subject: Reply with quote

It should work if you add a reference in Plato.

Take a look at the BuildLog file in the local folder and set if you can work out what has gone wrong.

Is the DLL in the given folder?

What error messages are you getting?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group