当我使用IVF + IMSL编译和链接我的源代码时,我得到了一个错误分支。它看起来像
val r = new scala.util.Random
r.nextInt(30)
我猜错误的一个可能来源是我的源代码来自其他作者,并且是在几年前(2004年左右)编写的。所以我的IMSL版本(7.0)可能与他的不同。在原始代码中,它使用>main.f90
1>Linking...
1>msvcrt.lib(MSVCR120.dll) : error LNK2005: __time32 has already defined in LIBCMT.lib(time.obj)
1>imsls_err.lib(e1ucs.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(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(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(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1std.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(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(dr1ins.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(n1rty.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>imsl.lib(dr1t64.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(r1in32.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(dr1t32.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(r1inf.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(rnset.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(drnun.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(r1int.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(r1in64.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1inpl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1init.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(n1rgb.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(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1std.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(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(dr1ins.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(n1rty.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1pop.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(dr1t64.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(r1in32.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(dr1t32.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(r1inf.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(rnset.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(drnun.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(r1int.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(r1in64.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
之类的命令调用IMSL,但失败了INCLUDE 'link_f90_static.h'
。或者,我用
Error #5102: cannot open link_f90_static.h
并且错误#5102已解决。但是出现了LNK2019错误的一个分支。我不知道它是否真的是由IMSL版本问题引起的。 intel fortran用户论坛中的类似帖子是https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/298641 但由于我从未安装过CVF,因此可能不是我的问题的根源
有什么建议吗?谢谢。
答案 0 :(得分:0)
正如英特尔提供的IMSL指令所述,如果您要链接到IMSL的静态库形式,您还需要链接到OpenMP库。一种方法是添加以下行:
!DEC $ OBJCOMMENT LIB:“libiomp5md.lib”
遵循INCLUDE行。
但我首选的选择是包含'link_fnl_shared.h'。这可能也会处理__time32引用。