- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am investigating possibility of converting our Lahey95 source codes to IVF 11.1 and am going through some examples. If I can do an example conversion quick and correct I probabaly can persuade my manager for conversion. Is there any automated way that accelerates such conversion? also (an immediate question!) how can I replace "includes" in LH file for example:
Include 'file.inc'
when I leave it as is I receive below error:
error #5102: Cannot open include file 'file.inc'
I am new in IVF so please take that into account in your answer.
Thanks in advance.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The error you got simply indicates that 'file.inc' does not exist in the folder containing the source file, nor in any of the folders listed under "Additional INCLUDE directories". If you find that file and put it in the right place, it should work.
Let us know if you have further questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I remember, IsNan is not available in Lahey (it's an extension to standard in the others) and I had to supply it in a special module but that doesn't apply if you are coming from Lahey.
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also have some calls to borland C dlls withing my Lahey fortran code; like below lines:
dll_import BCDLLSample
a=BCDLLSample(Carg(x1),Carg(x2))
somewhere in the source code there is BCDLLSample.dll and BCDLLSample.lib files.
1) How can I call such DLL in IVF?
2) Do I need to have the .lib files for all DLL's
3) Having the Borland C source codes for the .dll's will help? can I for example directly integrate it into VS2010 and call them.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1) How can I call such DLL in IVF?
The Intel Visual Fortran command would be: !DEC$ ATTRIBUTES DLLIMPORT
2) Do I need to have the .lib files for all DLL's
Yes, you can add them to your Microsoft Visual Studio project.
3) Having the Borland C source codes for the .dll's will help? can I for example directly integrate it into VS2010 and call them.
Yes you could recompile your dlls (the documentation gives help in how to do this), but I don't think it is necessary. Note you need to take into account mixed language subroutine calls (also documented).
I would suggest looking though the documentation on how to call DLLs in IVF (installed by default on your system at:
C:\Program Files (x86)\Intel\ComposerXE-2011\Documentation\en_US\compiler_f\cl\index.htm
Look under the section: Creating and Using DLLs
In addition we have some sample code showing how to call DLLs in
C:\Program Files (x86)\Intel\ComposerXE-2011\Samples\en_US\Fortran\DLL
Here is the excerpted section from the documentation:
Within your Fortran application, import each DLL subprogram. Add !EC$ ATTRIBUTES DLLIMPORT to declare that a function, subroutine, or data is being imported from outside the current image. For example:
INTERFACE SUBROUTINE ARRAYTEST (rarray) !DEC$ ATTRIBUTES DLLIMPORT :: ARRAYTEST REAL(4) rarray(3, 7) END SUBROUTINE ARRAYTEST END INTERFACE CALL ARRAYTEST (rarray)
Or, not using an INTERFACE block:
PROGRAM TESTA !DEC$ ATTRIBUTES DLLIMPORT:: ARRAYTEST REAL(4) rarray (3,7) CALL ARRAYTEST(rarray) END PROGRAM TESTA
The DLLEXPORT and DLLIMPORT options (for the cDEC$ ATTRIBUTES directive) define a DLL's interface.
The DLLEXPORT property declares that functions or data are being exported to other images or DLLs, usually eliminating the need for a Linker module definition (.DEF) file to export symbols for the functions or subroutines declared with DLLEXPORT. When you declare a function, subroutine, or data with the DLLEXPORT property, it must be defined in the same module of the same program.
A program that uses symbols defined in another image (such as a DLL) must import them. The DLL user needs to link with the import LIB file from the other image and use the DLLIMPORT property inside the application that imports the symbol. The DLLIMPORT option is used in a declaration, not a definition, because you do not define the symbol you are importing.
If you have more specific questions please post them to the thread.------
Wendy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
can you please explain in detail where/how I should add the .lib files associated with the .dll files in VS2010?
when i right click on the Fortran file and click properties I have below options:
General
optimization
Debugging
..
..
.
Command line
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in my migration test from LH95 to IVF Iran into a C++ produced .dll called by LH95, I have also a .lib file for that .dll that made by LH95 with some way. It seems that I can't use same .lib file for IVF. Does anybody have suggestion how to make required .lib file from an existing C++ .dll file so that I can call it from Fortran?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fortran]program Temp03 implicit none character(len=200) c_sect, c_ident, c_value, c_file logical xexist interface logical function write_pps (c_sect, c_ident, c_value, c_arg) !DEC$ ATTRIBUTES DLLIMPORT, ALIAS:"write_pps" :: write_pps character(*) :: c_sect, c_ident, c_value, c_arg !DEC$ ATTRIBUTES REFERENCE :: c_sect, c_ident, c_value, c_arg end function write_pps end interface !Original Calling convension in Lahey95 !dll_import write_pps !xexist = write_pps(carg(c_sect),carg(c_ident),carg(c_value),carg(c_file)) xexist = write_pps (c_sect, c_ident, c_value, c_file) end program Temp03[/fortran]
I know you had "read_cla" as the alias, but I didn't think you really meant that. The key here is the interface declaring the character arguments with the REFERENCE attribute. It might also work to use %REF(arg) where Lahey had carg(arg). There's nothing wrong with the .lib - it is a normal DLL export library.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page