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 

how to link nag library with a fortran code

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
mali28



Joined: 09 Feb 2017
Posts: 11

PostPosted: Wed May 03, 2017 4:50 pm    Post subject: how to link nag library with a fortran code Reply with quote

My FORTRAN code uses nag library functions. I am not sure how to link the nag library with the FORTRAN code. I have the nag library installed on my PC. Do I have to set the path to nag library in the code?

Currently I have tried using

opts = /FREE_FORMAT /WIDE_SOURCE /debug /check /mod_path "C:\Program Files\NAG\FL25\flw6i25dcl\mkl_intel64_11.2.1\bin"

in the makefile.mak but it does not work.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Wed May 03, 2017 5:44 pm    Post subject: FLW6I25DCL Reply with quote

That list of options is for the Intel Fortran compiler. This is the Silverfrost FTN95 forum.

The modules and libraries provided by NAG in the FLW6I25DCL package are for the Intel 64 bit Fortran compilers. They will not work with FTN95/64. NAG does not release a version of the Fortran library for FTN95.

If you have FLW6I25DCL installed, you may have Intel Fortran also installed. If so, use that compiler in order to build programs that need NAG FL routines.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu May 04, 2017 11:32 am    Post subject: Reply with quote

The NAG library can be used with FTN95 for either 32 bit or 64 bit code.

You may need to contact NAG in order to find out which particular set of NAG DLLs are needed for FTN95.

The FTN95 /mod_path option is not relevant because it specifies a path for MOD files.

What you need is:
a) in the code, interface information for the NAG routines that you are using and
b) a link to the relevant DLLs when linking.

FTN95 has a LIBRARY directive that may be used to provide information to the linker when using /LINK as an FTN95 command line option.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Thu May 04, 2017 11:55 am    Post subject: Reply with quote

NAG do provide the source codes for interface modules, which can be compiled with FTN95 to generate module files which can then be USEd in user programs, but there is one exception: a large number of routines in the four E chapters have interfaces in file nag_e_ib.f90, which contains many instances of the line

Use, Intrinsic :: iso_c_binding, Only: c_ptr

which is not yet supported by FTN95.

The user can write custom interface blocks which do not use ISO_C_BINDING, but some equivalent for C_PTR will be needed, or only NAG E01, E02, E04, E05 routines that are available with an F77 interface should be used.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 558

PostPosted: Thu May 04, 2017 8:53 pm    Post subject: Reply with quote

might this also help...
http://forums.silverfrost.com/viewtopic.php?t=2487&postdays=0&postorder=asc&start=0
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 558

PostPosted: Thu May 04, 2017 10:04 pm    Post subject: Reply with quote

further, NAG themwelves offer some detailed guidelines here (see section 4.1.4) ....
http://www.nag.com/doc/inun/fl23/dll4ml/un.html#ftn95
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Fri May 05, 2017 1:54 am    Post subject: Reply with quote

John-Silver: The link that you gave is for a different version of the NAG Fortran library. The version that the OP reports is FLW6I25DCL, for which the link is http://nag.co.uk/doc/inun/fl25/w6idcl/in.html#applicability , and there is no mention of FTN95. That library is for 64-bit targets, and I believe that when it was released the 64-bit FTN95 compiler did not yet exist.
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
Page 1 of 1

 
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