ifort 链接器未定义参考

发布于 2024-09-08 01:40:37 字数 684 浏览 4 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

李白 2024-09-15 01:40:37

求助于 Google,我在 Mac 上找到了一个文件:

/Developer/opt/intel/Compiler/11.1/080/include/ia32intrin.h

其中包含符号的声明,

_mm_idivrem_epi32

因此看起来确实缺少链接或包含。

Recourse to Google points me to a file, on my Mac:

/Developer/opt/intel/Compiler/11.1/080/include/ia32intrin.h

which contains a declaration of a symbol

_mm_idivrem_epi32

So it does look as if you are missing a linkage or include.

小苏打饼 2024-09-15 01:40:37

我的猜测是,有问题的源文件(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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文