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

linker error misery

Brian_Murphy
New Contributor II
1,517 Views

I'm trying to build an old console program, and I get about 1000 linker errors like the following:

Error 730  error LNK2019: unresolved external symbol _vsprintf referenced in function _for__io_return libifcoremt.lib(for_diags_intel.obj)

Error 572  error LNK2001: unresolved external symbol _memmove imsl.lib(crgrg.obj) 
 

Can anyone tell me what I'm doing wrong?
 

0 Kudos
28 Replies
Brian_Murphy
New Contributor II
265 Views

I am building with INCLUDE 'link_fnl_static.h' because it is my understanding this is necessary to eliminate dependencies on imsl files.

It's not clear to me how to build the .exe without a dependency on libiomp5md.lib ?  I've tried lots of varioius combos, but it either fails to build, or the build still has the dependency.

 

0 Kudos
Steven_L_Intel1
Employee
265 Views

I have suggested a couple of times that you INCLUDE 'link_fnl_shared.h' instead. Clearly you need one of the FNL include lines since you are using IMSL but since you are using several DLLs already you may as well use the IMSL DLL too and this may resolve some of your other issues.

0 Kudos
Brian_Murphy
New Contributor II
265 Views

I'm aware you have suggested the 'shared'.  But my goal is to build the .exe without any dependencies, so that when I give it to someone, it will run without needing anything else.  I realize there is one DLL named DLLUserTor.DLL that will have to tag along.  It is basically a placeholder the end user can replace with his own.

So, is it possible to build the .exe without imsl or intel dependencies?  If so, how?  I presently have INCLUDE 'link_fnl_static.h' and Runtime Library = Multithreaded, and Process OpenMP Directive = Disable.

Thanks,

Brian

0 Kudos
Steven_L_Intel1
Employee
265 Views

I don't think you can remove the libiomp5md.dll dependency entirely. Try using 'link_fnl_static_imsl.h' instead - this is a variant that doesn't use Intel MKL. But I am pretty sure that IMSL itself depends on OpenMP and there is no static library version of Intel OpenMP.

0 Kudos
Brian_Murphy
New Contributor II
265 Views

My intel fortran/IMSL installation doesn't have a file by that name.  I do have a file named link_fnl_static_hpc.h so I tried that.  It built ok without the INCLUDE MP line, but the .exe is still dependent on the MP library.

So I think what you said about not being able to remove the dependency is accurate.  It certainly seems related to imsl since programs I have built that don't use IMSL don't have this dependency.

I think that closes the book on this.

Thanks bunches for the help.

 

0 Kudos
mecej4
Honored Contributor III
265 Views

Brian Murphy wrote:

this old code doesn't need MPI.  Fortran/Language/Process OpenMP Directives is set to  Generate Parallel Code (/Qopenmp)

I changed this to Disable and rebuilt, but DWalker still says  LIBIOMP5MD.DLL  is in the dependencies.

What is the right way to turn off MPI?

I think that you are confusing MPI and OpenMP. The DLL that you mention is for supporting OpenMP.

0 Kudos
Brian_Murphy
New Contributor II
265 Views

I don't know the difference.  My only experience with MP is using MPI on a unix system some years back.  I imagine OpenMP is about enabling a program to farm out calculations to multiple processors so it will run faster.  I take it the IMSL has some of this built in.

This is really out of my league.  I'm doing relatively light weight finite element analysis.  I'm not calculating weather patterns for hemispheres.

I have turned back on Generate Parallel Code (/Qopenmp) and I will leave it at that.

0 Kudos
Steven_L_Intel1
Employee
265 Views

Yes, IMSL uses OpenMP to parallelize some operations.  MPI is a very different parallelization method that is used more on clusters of interconnected computers, where OpenMP is restricted to shared-memory multiprocessors. (Intel used to have a "Cluster OpenMP" product but discontinued it.)

You must be using an older version of IMSL then. The current version (7) uses MKL by default, whereas version 6 used MKL only if you selected the _HPC variant of the include file.

0 Kudos
Reply