Fortran Module Wizard

Fortran Module Wizard

I have a VB6 project that is written to interact with Fortran and get the data back to the user. We opened up Fortran and through the wizard created the module containing the Automation interface of the objects. This process created a whole bunch of code in a .F90 file. This works fine and we get the desired results that we are looking for. However when i upgraded the code to VB.Net and tried to replicate the steps through Wizard we don't get the similar code that was generated for VB6. Infact a .F90 file is created with just about 6 lines of code and at the end of the code we see a line that says " ! No interfaces of the type requested were found". On the first screen of the wizard i check the box "Generate code that uses automation interface" and then i can choose any options on the second screen and get the same results all the time. Am i not following some steps or missing some steps? I am using Windows 7, VS 2008 and Studio XE 2013. Please let me know what i need to do as i have spent quite a bit of time trying to make this work.

SW

publicaciones de 36 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

SW,

In your VB.NET project, have you made sure to do the following?

1)  Register it for COM Interop?  Remeber the Fortran module wizard allows Fortran to interact with COM applications, hence the .NET application must include interoperability with COM.

2)  Follow the .NET requirements for COM interop?  i.e., include interfaces for all the exported classes and their properties and methods.  If not, you can refer to Microsoft Help in Visual Studio for details on the interfaces.  If your .NET code will see future revisions and updates, it may be useful to specify explicit GUIDs (using the Guid attribute in your .NET code) for every item that is to be made visible to COM.

 

Yes i have done that, but for some reason the code that gets generated states "No interfaces of the type requested were found" and is recognising the .Net file as .TLB file. Is this normal. And the code that gets generated is very small compared to the one that is generated for VB file.

It appears something is amiss in your .NET assembly and/or the type library.  I would suggest you first make sure everything is proper in your .NET project.  You can use ILDASM and Object Browser tools provided by Microsoft to check things - refer to Microsoft documentation e.g., http://msdn.microsoft.com/en-us/library/98w057c3(v=vs.80).aspx.

I've successfully used the Intel module wizard, most recently with Intel Composer XE 2013, latest update.

I am browsing to the .net application from fortran module wizard that i want to use. Once i select it the wizard shows me the correct path but once the wizard builds the interface in the code i see as comment "This module contains the COM interfaces of the objects defined in" and the path that it shows is absolute different from where i had pointed to in the wizard's browse for assembly box. Any ideas?

Hi

This is where i am pointing the wizard to pick my .exe from "C:\Users\SWILL10\Desktop\ForTran\Pro2_9.1 - v5\P2CCServer DLL - vb\P2CompassServer.NET1\bin\P2Spiral.exe"

And this is what the path is in the generated Fortran module

! This module contains the COM interfaces of the objects defined in

! C:\Users\SWILL10\AppData\Local\Temp\P2SpiralServer.TLB

! Generated by the Fortran Module Wizard on 05/14/13

SW

SW,

From what I have gathered, the module wizard generally wants to work off of the type library (TLB file); if you point directly to a .NET DLL or EXE file instead, my understanding is that it creates a type library behind the scenes using some utility in Visual Studio - I could be wrong, but that's what I see on my PC (someone from Intel may be able to shed more light on this).  So, based on my understanding, what you see with paths is not really an issue.  The path inside the Fortran module seems to just a temporary folder where the TLB got created.

Now what you may want to do is check for a TLB file in your project folder and its sub-folders: C:\Users\SWILL10\Desktop\ForTran\Pro2_9.1 - v5\P2CCServer DLL - vb\P2CompassServer.NET1".  If you did all the COM interoperability things correctly in your .NET project as you say, then Visual Studio should have created a TLB file for you in one of your subfolders in this project.  I got the TLB file automatically once I added all the COM interop stuff.

If you find TLB, use the Visual Studio "View Object Browser" tool (refer to Microsoft documentation as I indicated above) to look at the "exposed" content for COM interop i.e., the classes, their methods and properties, etc that you want to invoke in any COM application (including Fortran).  If what you need in Fortran in missing here, then you need to modify your .NET code until everything is visible and the attributes are correct.

Only after you are satisfied with you see in the TLB should you try to run the Intel module wizard.

 

OK Now i am getting a new error "fatal error LNK1104: cannot open file 'ifconsol.lib'". when trying to build the solution. I am using VS 2008 and fortran 11. We have a VB 6.0 code that we linked in this project through Visual fortran wizard. Can you please help me resolve this issue. Thanks

Please set the linker project property General > Show Progress to "Show some progress messages" , do a rebuild, and then attach a ZIP of the buildlog.htm to a reply here.

Steve - Intel Developer Support

Steve i am very new to frtran so you will have to really spell it out for me how to set "Show some progress messages". This program was built by someone else and i am just trying to maintain it. Below is the the buildlog.htm to this message of whatever got built. Maybe i can do it again if this is not full compile log that you were expecting.

    Build started: Project: Testmain, Configuration: Debug|Win32 Output     Linking... Link /OUT:"Debug/Testmain.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"C:\Users\SWILL10\Desktop\LatestWorkingCopies\ASIDLL - Fortran\Debug\Testmain.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"Debug/Testmain.pdb" /SUBSYSTEM:CONSOLE kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MACHINE:I386 "Debug/TestMain.obj" "Debug/P2SpiralServer.obj" "Debug/P2CCServer.obj" "Debug/CRDIDL.obj" "Debug/XMCrudeListSize.obj" "Debug/CRDCMP.obj" "Debug/XMCrudeIDs.obj" "c:\Users\SWILL10\Desktop\LatestWorkingCopies\ASIDLL - Fortran\Debug\Testmain_lib.lib" Link: executing 'link' Testmain_lib.lib(XMCrudeList.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification LINK : fatal error LNK1104: cannot open file 'ifconsol.lib' Testmain - 1 error(s), 1 warning(s)

Right click on the Fortran project (not the solution - the icon with the F) and select Properties. In the left column, under Configuration Properties, select Linker > General. Change the entry for "Show Progress" to "Display All Progress Messages", click OK.

Now do a full rebuild (not just a build like you did above) of the solution.

In the Debug subfolder of the project is a file buildlog.htm. Zip that and attach it to a reply here.

Also, please do this. In Visual Studio, select Tools > Options > Intel Fortran Composer XE > Visual Fortran > Compilers. You will see an entry that says Libraries. Click the ... button to the right of that, copy all the text in the window that appears and paste it into your reply.

Steve - Intel Developer Support

Steve When i click for propperties nothing happens and i don't see any configuration properties. Also in VS under tools>options I don't see  Intel Fortran Composer XE. Am i missing some settings, is the compiler not installed. I see Intel Advisor XE 2013, Intel Inspector 2013 and Intel VTune Amplifier 2013. Please advise.

Steve here's what appeared under Compillers in VS

$(IFortInstallDir)Lib
$(VCInstallDir)atlmfc\lib
$(VCInstallDir)lib
$(WindowsSdkDir)lib

 

Attached is the buildlog.zip file.

Adjuntos: 

AdjuntoTamaño
Descargar buildlog.zip2.53 KB

You didn't change the Show Progress property. Please do that, relink and show me the new buildlog.htm

Steve - Intel Developer Support

Sorry abou that Steve, here's the latest build as attachmeny.

Adjuntos: 

AdjuntoTamaño
Descargar buildlog.zip2.95 KB

Interesting - it doesn't seem to be looking in the compiler's library folder at all.

Try this for now - in the project properties under Linker > General, put this in "Additional Library Directories":

C:\Program Files (x86)\Intel\Composer XE 2013\compiler\lib\ia32

Now try again. This is just a workaround - we still need to figure out why it isn't finding the library folder by default.

Steve - Intel Developer Support

Did it and attached is the logfile, still same error.Does this have to be in quotes?

Adjuntos: 

AdjuntoTamaño
Descargar buildlog.zip3 KB

Any new recomendations Steve?

 

Are you on a 32-bit or 64-bit version of Windows? If 32-bit, then remove the (x86) from the path I gave you. Please also open that folder and check to see if ifconsol.lib is there.

Steve - Intel Developer Support

Thanks Steve, I did what you advised and removed (x86) as i am on a 32 bit version. Compile succeeded but got a bunch of warnings, attached is a newer version of logfile, Let me know if warnings are of any concern or not.

Adjuntos: 

AdjuntoTamaño
Descargar buildlog.zip17.11 KB

The warnings aren't new - they were there before. The program now links - my guess is that the registry entries pointing to the installation directory got corrupted. If you want you can add the path under Tools > Options > Intel Composer XE > Visual Fortran > Compilers > Library Files so it will work for all projects.

Steve - Intel Developer Support

Steve, You mean add this path "C:\Program Files\Intel\Composer XE 2013\compiler\lib\ia32" under library files?

Yes. Add it to the end of the list.

Steve - Intel Developer Support

Steve, I have a VB.Net project that gets called by a ForTran project. When i try to use the fortran compiler to generate the code off of my VB.Net project it does not create all the necessary code that it usually creates from a VB 6 project. Any ideas what am i doing wrong?

Thanks.

Satwant, we'd need to see your VB project and detail of the steps you followed. This might be better handled through Intel Premier Support. If I recall correctly, there is likely to be some difference between the COM DLL with type library that VB6 creates and the .NET assembly that later VBs create, but this is not an area I am very familiar with.

Steve - Intel Developer Support

Steve, Why do I get this error when using the Fortran wizard to generate VB.Net interface routines "! No interfaces of the type requested were found" Any idea what could be causing this.

Again, I'd need to see what you were trying to use it on - if your VB.NET thing is a .NET assembly, you'll need to use the .NET option in the wizard.

Steve - Intel Developer Support

Steve, I spoke with my manager and he advised against sending the code over as it is against company policy (hope you understand), but he advised on sharing the code with you through live meet that he can set up through WebEx. Is this something that you might be able to do. We definitely need your help on this as we are stuck and can't move forward. we will work with the time slot that is convenient for you. Please advise.

Steve, I am not sure if you got my last post but i am posting this again.

I spoke with my manager and he advised against sending the code over as it is against company policy (hope you understand), but he advised me that he can set up a live meeting through WebEx where I can share my screen with you and you can have control over the application. Of course we will work on your time schedule whenever you are free. Please advise if this would be something that would work with you. We desperately need your help on this as we are stuck and can’t move forward with our project.

I'll send you an email.

Steve - Intel Developer Support

Steve attached is the zip file that contains the bin folder of the .net files as well as the Fortran generated code for our vb6 exe file. Let me know if you require any thing more from me in order to get us the solution to the problem that we talked about.

Satwant

Adjuntos: 

AdjuntoTamaño
Descargar filesforintel.zip237.08 KB

Quote:

FortranFan wrote:

SW,

In your VB.NET project, have you made sure to do the following?

1)  Register it for COM Interop?  Remeber the Fortran module wizard allows Fortran to interact with COM applications, hence the .NET application must include interoperability with COM.

2)  Follow the .NET requirements for COM interop?  i.e., include interfaces for all the exported classes and their properties and methods.  If not, you can refer to Microsoft Help in Visual Studio for details on the interfaces.  If your .NET code will see future revisions and updates, it may be useful to specify explicit GUIDs (using the Guid attribute in your .NET code) for every item that is to be made visible to COM.

 

Satwant, Steve:

Looking at the DLL and the F90 file created by the Intel module wizard, it is clear the VB application is NOT setup adequately for COM Interop e.g., no methods are present in the type library (TLB file).  See my earlier post quoted above.

As of this point, I feel the issues are all on the VB side.  I would suggest first testing and validating VB application for COM interop independent of Fortran, say using a test application written in C++ or Visual Basic 6.0 or even Microsoft Excel VBA.  Only after confirmation that everything works as intended in COM do you even need get into Fortran.

My two cents,

Please, Assign this case to Steve Lionel.

We have tested this application before trying to interact with Fortran and we get the results that we expected. Only when we try to generate interfaces through Fortran wizard that we fail to get anything. When we do the same thing in VB6 we get the expected results but having problems with .Net version of the same application.

Quote:

Satwant W. wrote:

We have tested this application before trying to interact with Fortran and we get the results that we expected. Only when we try to generate interfaces through Fortran wizard that we fail to get anything. When we do the same thing in VB6 we get the expected results but having problems with .Net version of the same application.

But have you tried to interact your .NET version of the application with VB6?  Does this work ok?  If yes, what interaction is taking place i.e., are there methods or properties in the .NET app that are getting called by VB6?  Your type library doesn't seem to have anything useful in it.

Only if VB6 interacts successfully with the .NET version can you consider interacting Fortran with your .NET application.

 

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya