View previous topic :: View next topic |
Author |
Message |
mali28
Joined: 09 Feb 2017 Posts: 11
|
Posted: Wed May 03, 2017 4:50 pm Post subject: how to link nag library with a fortran code |
|
|
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 |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Wed May 03, 2017 5:44 pm Post subject: FLW6I25DCL |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu May 04, 2017 11:32 am Post subject: |
|
|
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 |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Thu May 04, 2017 11:55 am Post subject: |
|
|
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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Fri May 05, 2017 1:54 am Post subject: |
|
|
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 |
|
|
|