Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

Migration of CVF project to IVF solution issues

dannycat
New Contributor I
3,662 Views

I've just downloaded and installed the evaluation copies of IVF and Visual Studio 2008 and attempted to compile a large application originally developed in CVF. I eventaully hope the purchase both products as soon as I am confident that I can successfully build and link the program as 32-bit in vew to creating a 64-bit version later.

The migration process itself, firstly doneon a 32-bit Vista machine, was really quite painless and after getting used to the new environment it was quite easy to use.However I encountered a couple of possible problems when rebuilding the subprojects within the "Solution".

1) the compiler picked up that the RGB and MAKEINTRESOURCE macro arguments are incompatable. I assume they should be unsigned integers. How do we get round this in FORTRAN as INT1 values range between -128 & 128? As these are warnings rather than errors, will these functions still work as they did in CVF? I have not had chance to check yet.

2) the compiler also produced a severe error when attempting to compile a module which contains internal recursive procedures. (I confirmed this by removing the internal procedure code and recompiling).

3) the compiler sometimes doesn't like the use of NULL as a parameter (I think it is defined in dfwin). It says that it is defined by more than one use statement, although this was never an issue in CVF. When a routine includes a 2 modules that both use dfwin could this cause the problem. It would help if the warning named the offending modules.

4) on one occasionthe compilercomplained about "type(DIALOG) :: dlg" statement by pointing to DIALOG saying it was defined by more than one use statement. A similar message appeared for "type(T_RECT)" declaration statement.

5) Is there a similar switch to force the linker to "Force file output" on the CVF Project Settings/Link/Customise Tab?. In CVF I utilised this to enable an old third party library to be linked.

6) I triedto repeat the process on our 64-bit (running XP)machine but had problems when trying to search for strings in the Visual Studio. The program crashed every time. I will send this as a bug report to Microsoft.

On a positive note there were several occurences where I'd mistakenly used "call function" instead of "ret = function" in my CVF project. These errors were not picked up by the CVF compiler although the code seemed to work OK.

Any help on these issues would be much appreciated.

Finally something which may be of interest to forum users is that the one major stumbling block in fully recompiling my project is that several routines were built utilising the F90SQL libraries originallyobtained fromLahey. These are not currently available for Intel compilers and Laheyno longer support the code. But having contacted the original vendor, CanaimaSoft, the F90SQL libraries and modules are hopefully going to be available as soon as they can sort out a new distributor.

Thanks

0 Kudos
26 Replies
dannycat
New Contributor I
902 Views

Steve,

I've tried to attach a buildlog file using the Options tab but I get an "error on page" message when I click the Add File button. See below for extract.

However I noticed in one of your earlier posts, on this thread, you said that I was able the call the SQL functions using IVF" with a bit of work". So far I have only moved the mod files and lib files. Do I need to edit the sources and modify the $DEC attributes for IVF to work. If this is the case then I will probalyhave to do the same for the COM interface module files also. Is there a COM Wizardfor IVF? (I only have an evaluation version of IVF and there does not appear to be one in there.)With regards to the C libraries un resolved externals, I've not been able to find anywhere where CVF conventions are set. The top level function defined in fortran by the interface is resolved by the lower levels routines are not.

I've put an extract from the buildlog FYI.

Compiling manifest to resources...
rc.exe /fo "C:Win64WinFEM2000debugfem2000_dbg.exe.embed.manifest.res" "C:Win64WinFEM2000debugfem2000_dbg.exe.embed.manifest.rc"
Microsoft Windows Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
Creating temporary file "RSP1.rsp" with contents
[
/OUT:"Debug/FEM2000_dbg.exe" /VERSION:2.4 /INCREMENTAL /NOLOGO /LIBPATH:"C:Program FilesMicrosoft Visual Studio 9.0VClib" /NODEFAULTLIB:"libc.lib" /MANIFEST /MANIFESTFILE:"C:Win64WinFEM2000debugfem2000_dbg.exe.intermediate.manifest" /DEBUG /PDB:"Debug/FEM2000_dbg.pdb" /SUBSYSTEM:WINDOWS /STACK:8000000 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 /FORCE "Debug/MainWinProc.obj" "Debug/FEMWIN.obj" "Debug/ViewWindowSize.obj" "Debug/SelectPopupMenu.obj" "Debug/menustrings.obj" "Debug/ViewWinProc.obj" "Debug/statusbar.obj" "Debug/menuupdate.obj" "Debug/HandlePopupMenu.obj" "Debug/console.obj" "Debugw32_commands.obj" "Debug/Syscommands.obj" "Debug/FemWin.res" "C:WinFEM2000NASTRANlibdbio_vc.lib" "C:Program FilesMicrosoft Visual Studio 9.0VClibf90SQL.lib" "C:Program FilesMicrosoft Visual Studio 9.0VClibf90GL.lib" "C:Win64WinMgnLibDebugMgnLib.lib" "C:Win64WinGeomConvDebugGeomConv.lib" "C:Program FilesMicrosoft Visual Studio 9.0VClibf90GLU.lib" "C:Program FilesMicrosoft Visual Studio 9.0VClibglut32.lib" "C:Program FilesMicrosoft Visual Studio 9.0VClibf90GLUT.lib" "C:Win64WinFEM2000Groupsdebuggroups.lib" "C:Win64WinFEM2000FEMdebugfem.lib" "C:Win64WinFEM2000Initialisedebuginitialise.lib" "C:Win64WinFEM2000Utilitydebugutility.lib" "C:Win64WinFEM2000XSectiondebugxsection.lib" "C:Win64WinFEM2000Graphicsdebuggraphics.lib" "C:Win64WinFEM2000TAURUSdebug aurus.lib" "c:Win64WinCTRLibDebugCTRLib.lib" "C:Win64WinFEM2000CivilEngdebugcivileng.lib" "C:Win64WinFEM2000DYNA3Ddebugdyna3d.lib" "C:Win64WinFEM2000NASTRANdebug astran.lib" "C:Win64WinFEM2000OpenGLdebugopengl.lib" "C:Win64WinFEM2000Analysisdebuganalysis.lib" "C:Win64WinFEM2000Loadingdebugloading.lib" "C:Win64WinFEM2000Geometrydebuggeometry.lib" "C:Win64WinFEM2000Displaydebugdisplay.lib" "c:Win64WinFEM2000OpenGLDebugOpenGL.lib" "c:Win64WinFEM2000JPegDebugJPeg.lib" "C:Win64WinFEM2000 Modulesdebugmodules.lib" "C:Win64WinFEM2000Generaldebuggeneral.lib" "C:Win64WinFEM2000HPGLdebughpgl.lib" "C:Win64WinFEM2000JPegdebugjpeg.lib" "C:Win64WinFEM2000Windowsdebugwindows.lib" "C:Win64WinFEM2000Postdebugpost.lib" "C:Win64WinFEM2000Dialogsdebugdialogs.lib" "c:Win64WinFEM2000WindowsDebugWindows.lib" "C:Win64WinFEM2000Designdebugdesign.lib" "C:Win64WinFEM2000Resultsdebug esults.lib" "C:Win64WinFEM2000XYPlotsdebugxyplots.lib" "C:Win64WinFEM2000Third Partydebug hird party.lib" "c:Win64WinFEM2000Third PartyDebugThird Party.lib" "C:Win64WinFEM2000Reportsdebug eports.lib" "C:Win64WinFEM2000debugfem2000_dbg.exe.embed.manifest.res"
]
Creating command line "Link @"C:Win64WinFEM2000DebugRSP1.rsp""
Link: executing 'link'
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
Creating library Debug/FEM2000_dbg.lib and object Debug/FEM2000_dbg.exp
LIBCMTD.lib(crt0init.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
CTRLib.lib(ctr_mesh3d.obj) : error LNK2019: unresolved external symbol _e_PutDecompData referenced in function _ctr_Mesh3D
CTRLib.lib(ctr_mesh3d.obj) : error LNK2019: unresolved external symbol _e_PutMeshData referenced in function _ctr_Mesh3D
MgnLib.lib(mgn_generate.obj) : error LNK2001: unresolved external symbol _e_PutMeshData
CTRLib.lib(ctr_mesh3d.obj) : error LNK2019: unresolved external symbol _e_GetMeshParams referenced in function _ctr_Mesh3D
MgnLib.lib(mgni.obj) : error LNK2001: unresolved external symbol _e_GetMeshParams
"some removed here
display.lib(WordLib.obj) : error LNK2019: unresolved external symbol __imp__WORD2000A_mp_SELECTION_TYPEPARAGRAPH referenced in function _WORDLIB_mp_WRD_PICTURESIZE
display.lib(WordLib.obj) : error LNK2019: unresolved external symbol __imp__WORD2000A_mp_INLINESHAPES_ADDPICTURE referenced in function _WORDLIB_mp_WRD_PICTURESIZE
display.lib(WordLib.obj) : error LNK2019: unresolved external symbol __imp__WORD2000A_mp_SELECTION_GETINLINESHAPES referenced in function _WORDLIB_mp_WRD_PICTURESIZE
display.lib(WordLib.obj) : error LNK2019: unresolved external symbol __imp__WORD2000A_mp_RANGE_INSERTBREAK referenced in function _WORDLIB_mp_WRD_PAGEBREAK
display.lib(WordLib.obj) : error LNK2019: unresolved external symbol __imp__WORD2000A_mp_$APPLICATION_QUIT referenced in function _WORDLIB_mp_WRD_UNINIT
display.lib(sql_dsn.obj) : error LNK2019: unresolved external symbol _F90SQLDRIVERCONNECT referenced in function _SQL_DSN_mp_SQL_GETDSN
display.lib(sql_TableData.obj) : error LNK2001: unresolved external symbol _F90SQLDRIVERCONNECT
third party.lib(fsp_convert.obj) : error LNK2001: unresolved external symbol _F90SQLDRIVERCONNECT
display.lib(SQL_Tables.obj) : error LNK2019: unresolved external symbol _F90SQLBINDPARAMETER referenced in function _SQL_TABLES_mp_SQLSAS_CHK
display.lib(sql_TableData.obj) : error LNK2019: unresolved external symbol _F90SQLPREPARE referenced in function _SQL_TABLEDATA_mp_SQLSAS_EXECQUERY
display.lib(sql_TableData.obj) : error LNK2019: unresolved external symbol _F90SQLEXECUTE referenced in function _SQL_TABLEDATA_mp_SQLSAS_EXECQUERY
display.lib(sql_TableData.obj) : error LNK2019: unresolved external symbol _F90SQLSETPOS referenced in function _SQL_TABLEDATA_mp_SQLSAS_SETPOS
MgnLib.lib(mgn_gene rate.obj) : error LNK2019: unresolved external symbol _p_Timer referenced in function _mgn_generate
" several lines removed"
Debug/FEM2000_dbg.exe : warning LNK4088: image being generated due to /FORCE option; image may not run
Embedding manifest...
mt.exe /nologo /out:"C:Win64WinFEM2000debugfem2000_dbg.exe.embed.manifest" /notify_update /manifest "C:Win64WinFEM2000debugfem2000_dbg.exe.intermediate.manifest"
FEM2000 - 277 error(s), 3 warning(s)

The executable wascreated in spite of the errors. When I tried to run it it crashed with an "access violation error" at the first call to a function which had a CHARACTER*(*) argument definition followed by an integer. None of the unreferened routines are called during the program initialisation. The debugger showed the integer to have an invalid address.and the length of the string to be huge. Is this syntax still OK with the non CVF settings or will I have to modify arguments by adding the string length?

0 Kudos
Steven_L_Intel1
Employee
902 Views
If you use the modules I provided, it should work, as long as you're using F90SQL-Lite. The module and library I provided does not support the "Pro" version.

You have some unresolved references in your own code (_p_timer, etc.) that may require some additional work, such as adding directives to change calling conventions. You should also try turning off the "Use Debug Libraries" option in the Fortran project.
0 Kudos
dannycat
New Contributor I
902 Views

Steve,

Some progress!

The SQL routines are now fully referenced. I had to add $DEC ATTRIBUTES to all functions in the Pro version of F90SQL.f90. These attribute statements were based on those that were added to the Lite version obtained from your previous post.

I suspect this is the reason the COM objects references were not being found. The interefaces were generated using the CVF COM Module Wizard and each subroutine/function had the following attributes:

!DEC$ ATTRIBUTES DLLEXPORT ::

I don't have a Module Wizard for IVF, if one exists, but looking at the Excel.f90 file in the Intel COM samples directory it looks as if the DLLEXPORT statements need to be removed. By doing this edit all function references now appear to be resolved in both Word and Excel modules.

Istill need to resolve the C function issues now. The currert C library consists of several projects and is created in a separate solution to my main program. All routines are given a calling convention _cdecl(/Gd) and code is compiled as C code. The two entry routines (called by FORTRAN) are resolved but the references to routines within the library itself remain unresolved. I couldn't find where set turn off the "Use Debug Libraries" option so have not tried this yet.

One other issue has arisen regarding a library supplied by a third party. There are references to the following libraries dformd.lib, dfconsol.lib and dfport.lib. These look like CVF libraries. Is there are workround to this or will I have to try and obtain an IVF compatible library?

Steve, thanks again for your time on this, it is really appreciated.

0 Kudos
Steven_L_Intel1
Employee
902 Views
IVF 10 and later includes the COM Server Wizard.

Your libraries that reference dformd.lib, etc., must be rebuilt in order to be used with Intel Fortran.
0 Kudos
dannycat
New Contributor I
902 Views
I can't find any reference to the COM Server Wizard in my IVF installation 10.1. Is it not included in the evaluation copy?
0 Kudos
Steven_L_Intel1
Employee
902 Views
Yes, it is. As with CVF, you create a project of type Fortran COM Server.
0 Kudos
Reply