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

Linking IMSL Libraries in IDE

ursorg
Beginner
1,041 Views
I wrote a simple program calling one of the IMSL routines, "DLINRG", with the Intel FORTRAN compiler 8.0 within the Visual Studio environment. The program contains USE NUMERICAL_LIBRARIES (but I'm not sure that's correct for using IMSL). I keep getting an LNK2019, unresolved external for DLINRG. What do I need to do???? The correct VNI directory has been added to the link path, but the linker never searches that directory. Below is the build output text... "------ Build started: Project: testMe, Configuration: Debug|Win32 ------ Deleting intermediate files and output files for project 'testMe', configuration 'Debug|Win32'. Compiling... ifort /nologo /Zi /Od /module:"Debug/" /object:"Debug/" /traceback /check:bounds /c D:Dataursorg estMe estMe.f90 Linking... Link /OUT:"Debug/testMe.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:Program FilesVNICTT5.0libintel32" /DEBUG /PDB:"Debug/testMe.pdb" /SUBSYSTEM:CONSOLE /VERBOSE:LIB Debug/testMe.obj Link: executing 'link' Searching libraries Searching C:program filesIntelFortranCompiler80Ia32Libifconsol.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibifcore.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibifport.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibm.lib: Searching C:program filesMicrosoft Visual Studio .NET 2003Vc7libLIBC.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibirc.lib: Searching C:program filesMicrosoft Visual Studio .NET 2003Vc7libOLDNAMES.lib: Searching C:program filesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuuid.lib: Searching C:program filesMicrosoft Visual Studio .NET 2003Vc7libkernel32.lib: Searching C:program filesIntelFortranCompiler80Ia32Libifconsol.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibifcore.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibifport.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibm.lib: Searching C:program filesMicrosoft Visual Studio .NET 2003Vc7libLIBC.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibirc.lib: Searching C:program filesMicrosoft Visual Studio .NET 2003Vc7libOLDNAMES.lib: Searching C:program filesMicrosoft Visual Studio .NET 2003Vc7PlatformSDKlibuuid.lib: Searching C:program filesMicrosoft Visual Studio .NET 2003Vc7libkernel32.lib: Searching C:program filesIntelFortranCompiler80Ia32Libifconsol.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibifcore.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibifport.lib: Searching C:program filesIntelFortranCompiler80Ia32Liblibm.lib: Finished searching libraries testMe.obj : error LNK2019: unresolved external symbol _DLINRG referenced in function _MAIN__ Debug/testMe.exe : fatal error LNK1120: 1 unresolved externals testMe build failed." -Robert
0 Kudos
10 Replies
Steven_L_Intel1
Employee
1,041 Views
It would seem that, unlike in CVF, Visual Numerics did not add the OBJCOMMENT directives to NUMERICAL_LIBRARIES to cause the libraries to be searched. You can add the library names under the Link properties tab of your project.
0 Kudos
ursorg
Beginner
1,041 Views

Hi Steve,

Thanks for wading through that mess (it was nicely formatted on my screen). I attempted to add all the library files using the "Properties>Linker>General>AdditionalLibraryDirectories". And,it shows up at the link command line,

Link /OUT:"Debug/testMe.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:Program FilesVNICTT5.0libintel32" /DEBUG /PDB:"Debug/testMe.pdb" /SUBSYSTEM:CONSOLE /VERBOSE:LIB Debug/testMe.obj

However, if I use the /VERBOSE:LIB command, the linker never searches that path for the appropriate library. Is there something I'm missing here?

Thanks,

-Robert

0 Kudos
Steven_L_Intel1
Employee
1,041 Views
You have to aadd the actual library names under Link..Input..Additional Dependencies. imsl.lib imsls_err.lib imslscalar.lib
0 Kudos
ursorg
Beginner
1,041 Views

Thanks - that worked like a charm. I was under the impression adding the library path was enough. Live and learn!

-Robert

0 Kudos
ursorg
Beginner
1,041 Views
Additional Information,
When I was converting a large CVF workspace to an IVF solution, the "Properties>Fortran>ExternalProcedures>CallingConvention" was automatically set to "CVF". This would have worked fine, except the new IVF IMSL library calling convention is different (ie. the @xx is not appended to the end of the funtion name). In order to solve this problem, set the calling convention to "Default".
If working with IMSL libraries, and receiving unresolved external link errors, check to see if the "@xx" is appended to the end of the function. If so, what I said above could be the culprit.
-Robert
0 Kudos
williamrrichmond
Beginner
1,041 Views
May I offer another comment about this thread.
I had considerable difficulty getting the IMSL library linked to a simple example supplied by IMSL in their example directory (C:Program FilesVNICTT5.0examplesintel32f90validate).
What I eventually discovered was that under the property tabbed sheet - Linker, General, Additional Library Directories - is that you don't need to include the /LIBPATH: when putting the text in the box. The IDE will automatically add it for you. As well, the LIBPATH should appear as "C:Program FilesVNICTT5.0libintel32" in the box. I believe there's a "" missing between the "5.0" and the "lib" in the line under Steve's reply above.
Another note is that the verbose output for the linker is turned on by selecting, under Linker, General, Show Progress and then selecting either Display All or Display Some Progress Messages.
I hope this helps someone else that may be struggling with linking to the IMSL libraries.
0 Kudos
Steven_L_Intel1
Employee
1,041 Views
The next release will include a new section of the User Guide that covers all of this in detail. I don't recommend doing this with "Additional Library Directories.
I have attached the new manual pages to this message.
0 Kudos
g_f_thomas
Beginner
1,041 Views
This is an excellent addition to the IVF docs. I find no fault with it.

Thanks,
Gerry T.
0 Kudos
craig_h
Beginner
1,041 Views
Steve
I don't see the attachment.
Thanks
0 Kudos
Steven_L_Intel1
Employee
1,041 Views
The attachment is gone - it is from 2004 and is obsolete anyway. The information is in the on-disk documentation under Building Applications > Using Libraries > Using IMSL. You should also read this article.
0 Kudos
Reply