Cannot use IMSL

Cannot use IMSL

Hi 

I use VS2010 and IVF XE 11 with IMSL 6.0

I have a following code:

INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libguide.lib'
program main

USE OWFRQ_INT
USE UMACH_INT
IMPLICIT NONE
INTEGER K, NOBS
PARAMETER (K=10, NOBS=30)
!
INTEGER NOUT
REAL DIV(K), TABLE(K), X(NOBS)
!
DATA X/0.77, 1.74, 0.81, 1.20, 1.95, 1.20, 0.47, 1.43, 3.37, &
2.20, 3.00, 3.09, 1.51, 2.10, 0.52, 1.62, 1.31, 0.32, 0.59, &
0.81, 2.81, 1.87, 1.18, 1.35, 4.75, 2.48, 0.96, 1.89, 0.90, &
2.05/
!
CALL UMACH (2, NOUT)
!
CALL OWFRQ (X, K, TABLE, DIV=DIV)
WRITE (NOUT,99999) DIV, TABLE
99999 FORMAT (' Midpoints: ', 10F5.2, /, ' Counts: ', 10F5.0)
END

------------------------------

But VS2010 gives me this error message(only one)

Error 1 fatal error LNK1104: cannot open file 'libguide.lib' LINK

Anyone knows what happend ?   Does it mean IMSL does not link with IVF ?

Thanks a lot for your help !!

David

7 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de mecej4

Remove the line

!DEC$ OBJCOMMENT LIB:'libguide.lib'

That library is not used with recent versions of the Intel compiler.

Thanks a lot for answering !!

I remove the !DEC$ OBJCOMMENT LIB:'libguide.lib'

New error messages show up

I check them. None of them are from my code. It seems that IMSL does not link to Fortan

But I have set up include and library for IMSL. Fortran or VS2010 should be able to find IMSL

ex: C:\Program Files (x86)\VNI\imsl\fnl600\IA32\lib
C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll
C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\static

The error messages become :

1>Linking...
1>LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __call_reportfault already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj)
1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>msvcrt.lib(MSVCR100.dll) : error LNK2005: __time32 already defined in LIBCMTD.lib(time.obj)
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LIBCMTD.lib(crt0init.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>imsls_err.lib(e1ucs.obj) : error LNK2019: unresolved external symbol ___kmpc_global_thread_num referenced in function _E1UCS
1>imsls_err.lib(e1prt.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(n1rgb.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(flexlm.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1lock.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1init.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e2psh_lmf.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1inpl.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(n1rcd.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1pop.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(umach.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1psh_lmf.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1sti.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1str.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(n1rgb.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1init.obj) : error LNK2019: unresolved external symbol ___kmpc_threadprivate_cached referenced in function _E1INIT
1>imsls_err.lib(e1inpl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1ucs.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1prt.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(n1rcd.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1pop.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(umach.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1psh_lmf.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1sti.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1str.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_critical referenced in function _E1LOCK
1>imsls_err.lib(e2psh_lmf.obj) : error LNK2001: unresolved external symbol ___kmpc_critical
1>imsls_err.lib(flexlm.obj) : error LNK2001: unresolved external symbol ___kmpc_critical
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_flush referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_end_critical referenced in function _E1LOCK
1>imsls_err.lib(e2psh_lmf.obj) : error LNK2001: unresolved external symbol ___kmpc_end_critical
1>imsls_err.lib(flexlm.obj) : error LNK2001: unresolved external symbol ___kmpc_end_critical
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_set_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol _omp_set_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_unset_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol _omp_unset_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_init_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol _omp_init_nest_lock referenced in function _E1LOCK

Thanks a lot for the help !!

Portrait de mecej4

Follow the documentation for using Intel Fortran and IMSL in VS.

Do not specify inconsistent library options in your configuration -- that is probably why the linker attempted to use both LIBCMT.lib, MSVCRT.lib and LIBCMTD.lib, when only one of these three should have been used.

Building your example at the command line is as simple as

ifort /Qimsl ximsl.f90

To build in VS, you need to specify libiomp5md.lib if you are using multiple threads, as that library resolves the OMP and KMPC symbols.

I built your example using VS10. I chose a standard "Release" configuration for a "Console" application for Intel Fortran, and added (i) the IMSL include directory to Properties:Fortran:Preprocessor:Additional Include Directories, (ii) libiomp5md.lib to Properties:Linker:Input:Additional Dependencies and (iii) the IMSL lib directory to Properties:Linker:General:Additional Library Directories.

I appreciate your kindly help !

I try to follow your instructions
1. choose view--->properties page-->configuration: active(release)

(i) the IMSL include directory to Properties:Fortran:Preprocessor:Additional Include Directories--->
C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll
C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\static

(ii) libiomp5md.lib to Properties:Linker:Input:Additional Dependencies---->libiomp5md.lib

(iii) the IMSL lib directory to Properties:Linker:General:Additional Library Directories----->
C:\Program Files (x86)\VNI\imsl\fnl600\IA32\lib

The new error message becomes (much less, I think I almost succeed) :

Warning 2 warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library LIBCMT.lib(crt0init.obj)
Error 1 error LNK2005: __time32 already defined in LIBCMT.lib(time.obj) msvcrt.lib(MSVCR100.dll)

Did I still miss any step you mention above ?

Thanks a lot for your help !!

Portrait de mecej4

The new error message becomes (much less, I think I almost succeed)
Yes, you are almost at that point. Apparently, some objects/libraries were built with /MD and others with /MT.

(i) If you have /MD in the compiler options, change it to /MT and rebuild; OR,
(ii) if you see /DEFAULTLIB:msvcrt.lib in the linker command line, remove it; OR,
(iii) try a variant of the linker's recommendation: add /NODEFAULTLIB:MSVCRT.lib to the linker command line.

Thanks a lot for your help !!! It works !!

Connectez-vous pour laisser un commentaire.