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

IMSL (Windows) troubles - is this the right forum?

chris-sn
Beginner
762 Views
Is this the right place to seek help on linking in IMSL functions, if not can someone point me in the right direction?

Thanks!
0 Kudos
1 Solution
Steven_L_Intel1
Employee
762 Views
Ok. You have (perhaps understandably) missed the section of our documentation on using IMSL - this is under Building Applications > Using Libraries > Using the IMSL libraries.

Instead of naming individual libraries in the link line, the recommended method is to add a line as follows to one of your sources:

INCLUDE 'link_fnl_static.h'

If you have not also enabled OpenMP (which the IMSL documentation recommends), then add the following line as well:

!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

It is this latter that will resolve the __kmpc symbols.

Since you are using LINEAR_OPERATORS, I will also comment that if you decide to build a 64-bit application, please read this article to get replacement modules. 32-bit doesn't need this.

View solution in original post

0 Kudos
5 Replies
Steven_L_Intel1
Employee
762 Views
Yes, it is, if you are using the IMSL from Intel Visual Fortran. I suggest you read this first to see if it helps.
0 Kudos
chris-sn
Beginner
762 Views
OK, thanks, I did indeed the article suggested and have (I hope) followed its instructions.

In case it's relevant, we are dealing here with a recently-converted CVF project pair in which a FORTRAN computational engine using IMSL is linked as a static library and used by a thin C++ wrapper linked as a dll.

It turns out that in this project the only use of IMSL is in a couple of FORTRAN lines of the form
ABCD=QA.ix.F
Which could easily be rewritten, but we want to use IMSL in a different project so we persevered...

Based on an article we found we replaced the old USE IMSL with USE LINEAR_OPERATORS

We then got through compilation but the dll link failed with

error LNK2019: unresolved external symbol _OPERATION_IX_mp_DIMDVP

We eventually discovered the libs in Program Files\VNI\imsl\fnl600\IA32\lib and by trial and error chucked imsl.lib and imsl_dll.lib in as additional dependencies to the Linker input. This moved us on and now we get

1>imsl.lib(operation_ix.obj) : error LNK2019: unresolved external symbol ___kmpc_global_thread_num referenced in function _OPERATION_IX_mp_ZIBZBP

1>imsl.lib(operation_ix.obj) : error LNK2019: unresolved external symbol ___kmpc_threadprivate_cached referenced in function _OPERATION_IX_mp_ZIBZBP

At this point I start to run out ofideas, plus I get a growing feeling that it shouldn't be this hard and I am going about it the wrong way... :-(

0 Kudos
Steven_L_Intel1
Employee
763 Views
Ok. You have (perhaps understandably) missed the section of our documentation on using IMSL - this is under Building Applications > Using Libraries > Using the IMSL libraries.

Instead of naming individual libraries in the link line, the recommended method is to add a line as follows to one of your sources:

INCLUDE 'link_fnl_static.h'

If you have not also enabled OpenMP (which the IMSL documentation recommends), then add the following line as well:

!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

It is this latter that will resolve the __kmpc symbols.

Since you are using LINEAR_OPERATORS, I will also comment that if you decide to build a 64-bit application, please read this article to get replacement modules. 32-bit doesn't need this.
0 Kudos
chris-sn
Beginner
762 Views
Thanks again Steve - that has sorted it.

I meant to add, I am also getting these warning messages :

2>tm_calc_lib.lib(INGPLC.obj) : warning LNK4049: locally defined symbol _MPIPRIV1 imported

2>tm_calc_lib.lib(INGPLC.obj) : warning LNK4049: locally defined symbol _MPIPRIV2 imported

2>tm_calc_lib.lib(INGPLC.obj) : warning LNK4049: locally defined symbol _MPIPRIVC imported


where INGPLC.OBJ is the compiled version of the fortran file which calls IMSL.

Do you recognise these - I don't have any matches for MPIPRIV in my source code. Don't know yet if it is going to cause trouble...
0 Kudos
Steven_L_Intel1
Employee
762 Views
You can ignore those warnings - they won't cause any problems. The symbols come from IMSL.
0 Kudos
Reply