ifort 链接器未定义参考
我正在使用 Intel 编译器 (ifort) 编译一个用 Fortran 编写的大型 HPC 系统。大约有数百个单独的模块,它们都可以正常编译,但链接器会抛出此错误:
phys_grid.o(.text+0x91b2): In function `phys_grid_mp_assign_chunks_':
: undefined reference to `_mm_idivrem_epi32'
_mm_idivrem_epi32
似乎是编译器自动矢量化的结果,但如果编译器生成了它,为什么我我收到此错误?我需要链接一些额外的库吗?
更新:
使用nm
,我能够将函数跟踪到libsvml
,但与之链接并没有帮助。现在这里似乎存在问题:ia32intrin.h
声明该函数如下:
__m128i __cdecl _mm_idivrem_epi32(__m128i * r, __m128i v1, __m128i v2); //__svml_idivrem4
但是从nm
的输出来看,库中的符号是__svml_idivrem4
代码>.根据头文件,这些是相同的函数,但是我可以将其告诉链接器吗?
I'm compiling a large HPC system written in Fortran using the Intel compiler (ifort). There are about several hundred individual modules and they all compile fine, but the linker throws up this error:
phys_grid.o(.text+0x91b2): In function `phys_grid_mp_assign_chunks_':
: undefined reference to `_mm_idivrem_epi32'
The _mm_idivrem_epi32
seems to be a result of the compiler's automatic vectorization, but if the compiler generated it, why am I getting this error? Do I need to link in some additional library?
Update:
Using nm
, I was able to trace the function to libsvml
but linking with that didn't help. Now herein seems to lie the problem: ia32intrin.h
declares the function as follows:
__m128i __cdecl _mm_idivrem_epi32(__m128i * r, __m128i v1, __m128i v2); //__svml_idivrem4
But from nm
's output, the symbol in the library is __svml_idivrem4
. According to the header file, these are the same functions, but can I tell this to the linker?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
求助于 Google,我在 Mac 上找到了一个文件:
其中包含符号的声明,
因此看起来确实缺少链接或包含。
Recourse to Google points me to a file, on my Mac:
which contains a declaration of a symbol
So it does look as if you are missing a linkage or include.
我的猜测是,有问题的源文件(phys_grid.f90?)没有
implicit none
语句。如果没有这个,ifort 就会假设某个地方一定有一个例程与该配置文件匹配,然后愉快地编译它并将其交给链接器进行解析。当然,您的下一个工作将是找到缺少的例程的代码,或者找出它的用途,以便您可以重写它。
My guess is that the source file in question (phys_grid.f90?) doesn't have an
implicit none
statement. Without that, ifort will just assume there must be a routine somewhere matching that profile, and merrily compile it up and hand it to the linker for resolution.Of course your next job is going to be to go find the code for that missing routine, or to figure out WTH it does so you can rewrite it.