Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

New user trying to link with external library (f90SQL)

warwickb
Beginner
1,258 Views
My current version of f90SQL does not run under IVF but it does work with DVF (apparently). If possible I'd like to get it running myself. All I seem to need to do is to get it to be able to link to the f90SQL.lib file in directory, let's call its user environment variable f90SQLLIB.

Thus when I "Batch Build" the project I've called "F90SQL1" I get a log files message containing:
------ Build started: Project: F90SQL1, Configuration: Release|Win32 ------

Linking...
Link /OUT:"Release/F90SQL1.exe" /INCREMENTAL:NO /NOLOGO /SUBSYSTEM:WINDOWS Release/Authors.obj Release/Authors_Count.obj
Link: executing 'link'
Authors.obj : error LNK2019: unresolved external symbol _F90SQLALLOCHANDLE referenced in function _AUTHORS_mp_AUTHORS_OPENCONN
...
Authors.obj : error LNK2019: unresolved external symbol _F90SQLGETDIAGRECSTR referenced in function _AUTHORS_mp_AUTHORS_GETERROR
Release/F90SQL1.exe : fatal error LNK1120: 16 unresolved externals


F90SQL1 build failed.

Is there a simple way of specifying the required library into the linker command? Can I perhaps run the linker command in DOS? Or do I have a lot of reading to do or do I have to wait for a version of f90SQL that works with IVF and Visual Studio?

Note that I'm running IVF under MS Visual Studio .NET 2003 in a Windows 2000 environment.

Hope you can help!
0 Kudos
10 Replies
Jugoslav_Dujic
Valued Contributor II
1,258 Views
The f90SQL library should work with IVF, in my opinion.
However, you have to tell the compiler/linker where to look for the .lib file (and probably also, where to look for modules like F90SQL*.mod). F90SQL setup takes care about it but you have to add F90SQL directories in VS.NET manually:
1) Append F90SQL.lib to Project/Properties/Linker/Input/Additional dependencies
2) Add the directory of the library (C:Program Files...F90SQLLib")either in:
* Project/Properties/Linker/General/Additional library directories, or
* Tools/Options/Intel Fortran/General/Project directories/Libraries
Also, you have to tell the correct function prototypes toIVF. You should add f90sql.f90 to your project and (simplest) ensure that your project's calling convention match the CVF one (Project/Properties/Fortran/External Procedures/Calling convention: CVF; String Length: After Individual String argument)
Or, simplest of all, if you just need F90SQL lite, check out Canaimasoft's web site & install the version which supports IVF (if there's one).
Jugoslav
0 Kudos
warwickb
Beginner
1,258 Views
Thanks, Jugoslav.

It now compiles.

Unfortunately when I try to run it in Debug/Start I get the message that the "dynamic link library DFORRT.dll could not be found in the specified path". I've tried to find this particular .dll but without success. Perhaps the call should be to VFFORRT.dll but I can't find that either. At this stage I also don't know exactly where DFORRT.dll is called from anyway. Note that other Debug diagnostics were as follows:
'f90sql1.exe': Loaded 'C:Documents and Settingswarwickb.CALMMy DocumentsVisual Studio ProjectsF90SQL1ReleaseF90SQL1.exe', No symbols loaded.
'f90sql1.exe': Loaded 'C:WINNTsystem32NTDLL.DLL', Cannot find or open a required DBG file.
'f90sql1.exe': Loaded 'C:WINNTsystem32f90SQLDVF.dll', No symbols loaded.
'f90sql1.exe': Loaded 'C:WINNTsystem32odbc32.dll', No symbols loaded.
'f90sql1.exe': Loaded 'C:WINNTsystem32ADVAPI32.DLL', Cannot find or open a required DBG file.
'f90sql1.exe': Loaded 'C:WINNTsystem32KERNEL32.DLL', Cannot find or open a required DBG file.
'f90sql1.exe': Loaded 'C:WINNTsystem32 pcrt4.dll', Cannot find or open a required DBG file.
'f90sql1.exe': Loaded 'C:WINNTsystem32comctl32.dll', Cannot find or open a required DBG file.
'f90sql1.exe': Loaded 'C:WINNTsystem32GDI32.DLL', Cannot find or open a required DBG file.
'f90sql1.exe': Loaded 'C:WINNTsystem32USER32.DLL', Cannot find or open a required DBG file.
'f90sql1.exe': Loaded 'C:WINNTsystem32COMDLG32.DLL', Cannot find or open a required DBG file.
'f90sql1.exe': Loaded 'C:WINNTsystem32shlwapi.dll', No symbols loaded.
'f90sql1.exe': Loaded 'C:WINNTsystem32msvcrt.dll', No symbols loaded.
'f90sql1.exe': Loaded 'C:WINNTsystem32SHELL32.DLL', Cannot find or open a required DBG file.
Debugger:: An unhandled non-continuable STATUS_DLL_NOT_FOUND exception was thrown during process load
The program '[1948] F90SQL1.exe: Native' has exited with code 128 (0x80).

Warwick
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,258 Views
Ah, you need DFORRT.dll from CVF, because F90SQL is linked to dll version of it. It's available for download within CVF redistributable kit:
Jugoslav
0 Kudos
ronald_g_guenther
1,258 Views
Greetings all,
I have a similar problem. I requested information from CanaimaSoft in February and again this month to no avail thus far. I have recompiled the three .f90 sql modules( f90SQL.f90, f90SQLConstants.f90, and f90SQLStructures.f90 )with IVF and usedan Object Comment in the FORTRAN module I use for odbc work to link to the df90sql.lib, i.e.

USE F90SQLConstants
USE F90SQLStructures
USE F90SQL
!DEC$ OBJCOMMENT LIB:"c:Progra~1CanimaSoftLIBf90sql.lib"
.
.
.

I keep the dffort.dll and f90SQLDVF.dll in my executable directory. Everything isappears to be fineuntil I attempt to run the program. I get stack overflows on attempting to make the ODBC connection. Oddly enough this program runs with CVF 6.6c. I am interested in your results and or any methodology you may have to overcome thisparticular problem.
Ron
0 Kudos
Steven_L_Intel1
Employee
1,258 Views
The f90SQL routines will assume the CVF calling conventions (STDCALL, REFERENCE, string lengths after each string address.)
I too have been trying to get Canaima to respond to inquiries. I did have a couple of e-mails earlier in the year saying that a port was "almost ready to go", but no response to recent emails. Strange.
0 Kudos
warwickb
Beginner
1,258 Views
Hi,
By followings Jugoslav's directions (in the reply list) I have had success in getting the supplied examples and a simple Wizard-created module to work. By adjusting the parameters on Max Query String length and Max ODBC String length of the Wizard-created module and using code from the first example in the documentation (Chapter 5?)I have got the query to "count(*)" to work from a remote Oracle 7.x database Table. However, I can't get it to connect to an Oracle 9i Table yet: my current pre-occupation!

Note that using Jugoslav's directions there was no need for me to recompile the modules f90sqlconstants, f90sqlstructures or anything else. They do not need to be part of the VS IDE "Solution Source Code". I've been very pleased with its performance so far. I've tricked myself at times expecting complications where there weren't any.
0 Kudos
ronald_g_guenther
1,258 Views
Anyone calling CVF libraries from IVF F90 routines?

Greetings Steve,
I am scratching my head after reading the numerous messages in
the archive and elsewhere about directive enhanced compilation
issues, etc. I know deep down that if I can divine the appropriate
settings for call bindings that I can use my "OLD" f90sql library(dll) and DF
library (dll) with an IVF compiled module. Based on your background,
I believe that you probably know that which I need to know. Is there
some piece of documentation that will provide adequate information so
I can set up my odbc FORTRAN module to call the f90sql CVF library?
After reading about the attributes in chapter 14 of the IFLR and
the /ifcase:cvf in vol 1 of the users guide, I know that I do not
have quite enough information to produce the equivalent of
an /iface:cvf for a single module through attributes. Can you fill
that gap?
TIA

0 Kudos
Steven_L_Intel1
Employee
1,258 Views
This is what will get you CVF calling semantics:
!DEC$ ATTRIBUTES STDCALL,REFERENCE,DECORATE,MIXED_STR_LEN_ARG,ALIAS:"FOO" :: FOO
where FOO is the routine name. MIXED_STR_LEN_ARG isn't documented but it works. You need the DECORATE and ALIAS because STDCALL will default to downcasing the name.
0 Kudos
ronald_g_guenther
1,258 Views

Greetings Steve, Gee, this is really easy! ;-) Many thanks to you and also in particular to Edmund Dunlop! If you wish a recipe (checklist) for this, I'll be happy to type it up and post it. Best of the season..

0 Kudos
Steven_L_Intel1
Employee
1,258 Views
Glad to hear it. Sure, please do post a "recipe" when you have it.
On another good news front, I heard from Canaima Software today that they intend to release f90SQL for Intel Visual Fortran "by the end of the year for sure". For those who bought the "Pro" version for CVF, it will be a free upgrade, they tell me.
0 Kudos
Reply