在 64 位 Linux 上链接到 IPP 库时出现问题

发布于 2024-11-05 13:51:46 字数 4740 浏览 0 评论 0原文

我静态链接到 ipp、umc 和uic图书馆。我正在使用 IPP 6.1.6.063 并已下载 6.1 示例代码。我正在使用 g++。

我可以构建自己的静态链接到 ipp 和 umc 的共享对象,但是当我尝试构建链接到我的共享对象的应用程序时,出现以下链接错误:

/opt/intel/ipp/6.1.6.063/emt64/ sharedlib/libiomp5.so:对“pthread_atfork”的未定义引用

我确实在本文中看到了以下注释: http://software.intel.com/ intel.com/en-us/articles/how-to-build-ipp-application-in-linux-environment/

错误消息: /opt/intel/ipp/6.1.6.063/em64t/sharedlib/libiomp5.so: 对 `pthread_atfork' 的未定义引用

* Please make sure to link "-lpthread" library in your command line.

我确实指定了 -lpthread,但错误仍然发生。

我最初在32位linux下遇到这个问题,但是在链接器文件列表中的-libiomp5后面指定-lpthread后解决了这个问题。但使用相同的构建命令在 64 位 Linux 下不起作用。我仍然遇到同样的错误。

解决此问题的一种方法是在构建应用程序时指定 -lpthread。但这需要使用我的共享对象的任何人都执行相同的操作,但这不是必需的,因为正如我提到的,它可以在 32 位 Linux 下正常工作。

是否有一些特定于 64 位的东西我没有考虑?

这是 ldd 的输出:

linux-vdso.so.1 =>  (0x00007fffbad20000)
libraw1394.so.11 => /usr/lib/libraw1394.so.11 (0x00007ff3b6fdd000)
librt.so.1 => /lib/librt.so.1 (0x00007ff3b6dd5000)
libiomp5.so => not found
libpthread.so.0 => /lib/libpthread.so.0 (0x00007ff3b6bb7000)
libusb-1.0.so.0 => /lib/libusb-1.0.so.0 (0x00007ff3b69a9000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ff3b6694000)
libm.so.6 => /lib/libm.so.6 (0x00007ff3b6411000)
libc.so.6 => /lib/libc.so.6 (0x00007ff3b608e000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007ff3b5e76000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff3b8475000)

以及 objdump -private-headers 的输出:

libfrenet.so:     file format elf64-x86-64

Program Header:
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**21
         filesz 0x000000000102ec8e memsz 0x000000000102ec8e flags r-x
    LOAD off    0x000000000102f3a8 vaddr 0x000000000122f3a8 paddr 0x000000000122f3a8 align 2**21
         filesz 0x00000000000433f8 memsz 0x0000000000048700 flags rw-
 DYNAMIC off    0x000000000103c9d8 vaddr 0x000000000123c9d8 paddr 0x000000000123c9d8 align 2**3
         filesz 0x0000000000000220 memsz 0x0000000000000220 flags rw-
    NOTE off    0x00000000000001c8 vaddr 0x00000000000001c8 paddr 0x00000000000001c8 align 2**2
         filesz 0x0000000000000024 memsz 0x0000000000000024 flags r--
EH_FRAME off    0x0000000000eb8c10 vaddr 0x0000000000eb8c10 paddr 0x0000000000eb8c10 align 2**2
         filesz 0x000000000001f974 memsz 0x000000000001f974 flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rwx
   RELRO off    0x000000000102f3a8 vaddr 0x000000000122f3a8 paddr 0x000000000122f3a8 align 2**0
         filesz 0x000000000000fc58 memsz 0x000000000000fc58 flags r--

Dynamic Section:
  NEEDED               libraw1394.so.11
  NEEDED               librt.so.1
  NEEDED               libiomp5.so
  NEEDED               libpthread.so.0
  NEEDED               libusb-1.0.so.0
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libc.so.6
  NEEDED               libgcc_s.so.1
  SONAME               libfrenet.so.2
  INIT                 0x0000000000199850
  FINI                 0x0000000000db7018
  HASH                 0x00000000000001f0
  GNU_HASH             0x0000000000015308
  STRTAB               0x000000000007c2d8
  SYMTAB               0x000000000002de10
  STRSZ                0x00000000000a95ec
  SYMENT               0x0000000000000018
  PLTGOT               0x000000000123efe8
  PLTRELSZ             0x000000000002f370
  PLTREL               0x0000000000000007
  JMPREL               0x000000000016a4e0
  RELA                 0x000000000012c260
  RELASZ               0x000000000003e280
  RELAENT              0x0000000000000018
  VERNEED              0x000000000012c130
  VERNEEDNUM           0x0000000000000005
  VERSYM               0x00000000001258c4
  RELACOUNT            0x0000000000001428

Version References:
  required from libgcc_s.so.1:
    0x0b792650 0x00 15 GCC_3.0
  required from libm.so.6:
    0x09691a75 0x00 07 GLIBC_2.2.5
  required from libstdc++.so.6:
    0x0bafd171 0x00 13 CXXABI_1.3.1
    0x02297f89 0x00 10 GLIBCXX_3.4.9
    0x056bafd3 0x00 05 CXXABI_1.3
    0x08922974 0x00 04 GLIBCXX_3.4
  required from libpthread.so.0:
    0x09691a75 0x00 06 GLIBC_2.2.5
    0x09691972 0x00 03 GLIBC_2.3.2
  required from libc.so.6:
    0x0d696913 0x00 14 GLIBC_2.3
    0x0d696917 0x00 12 GLIBC_2.7
    0x0d696914 0x00 11 GLIBC_2.4
    0x09691972 0x00 09 GLIBC_2.3.2
    0x09691974 0x00 08 GLIBC_2.3.4
    0x09691a75 0x00 02 GLIBC_2.2.5

谢谢。

I am statically linking to the ipp, umc & uic libraries. I am using IPP 6.1.6.063 and have downloaded the 6.1 sample code. I am using g++.

I can build my own shared object that statically links to ipp and umc, but when I try to build an application that links to my shared object, I get the following link error:

/opt/intel/ipp/6.1.6.063/emt64/sharedlib/libiomp5.so: undefined reference to `pthread_atfork'

I did see the following note in this article:
http://software.intel.com/en-us/articles/how-to-build-ipp-application-in-linux-environment/

Error message: /opt/intel/ipp/6.1.6.063/em64t/sharedlib/libiomp5.so: undefined reference to `pthread_atfork'

* Please make sure to link "-lpthread" library in your command line.

I do have -lpthread specified, but the error still occurs.

I originally had this problem under 32-bit linux, but this was resolved after specifying -lpthread after -libiomp5 in the linker file list. Using the same build command does not work under 64-bit linux though. I still get the same error.

One way to resolve this problem is to specify -lpthread when building the application. But this would require anyone using my shared object to do the same which shouldn't be necessary because as I mentioned it works properly under 32-bit linux.

Is there something specific to 64-bit that I am not considering?

Here is the output from ldd :

linux-vdso.so.1 =>  (0x00007fffbad20000)
libraw1394.so.11 => /usr/lib/libraw1394.so.11 (0x00007ff3b6fdd000)
librt.so.1 => /lib/librt.so.1 (0x00007ff3b6dd5000)
libiomp5.so => not found
libpthread.so.0 => /lib/libpthread.so.0 (0x00007ff3b6bb7000)
libusb-1.0.so.0 => /lib/libusb-1.0.so.0 (0x00007ff3b69a9000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ff3b6694000)
libm.so.6 => /lib/libm.so.6 (0x00007ff3b6411000)
libc.so.6 => /lib/libc.so.6 (0x00007ff3b608e000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007ff3b5e76000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff3b8475000)

And the output from objdump -private-headers :

libfrenet.so:     file format elf64-x86-64

Program Header:
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**21
         filesz 0x000000000102ec8e memsz 0x000000000102ec8e flags r-x
    LOAD off    0x000000000102f3a8 vaddr 0x000000000122f3a8 paddr 0x000000000122f3a8 align 2**21
         filesz 0x00000000000433f8 memsz 0x0000000000048700 flags rw-
 DYNAMIC off    0x000000000103c9d8 vaddr 0x000000000123c9d8 paddr 0x000000000123c9d8 align 2**3
         filesz 0x0000000000000220 memsz 0x0000000000000220 flags rw-
    NOTE off    0x00000000000001c8 vaddr 0x00000000000001c8 paddr 0x00000000000001c8 align 2**2
         filesz 0x0000000000000024 memsz 0x0000000000000024 flags r--
EH_FRAME off    0x0000000000eb8c10 vaddr 0x0000000000eb8c10 paddr 0x0000000000eb8c10 align 2**2
         filesz 0x000000000001f974 memsz 0x000000000001f974 flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rwx
   RELRO off    0x000000000102f3a8 vaddr 0x000000000122f3a8 paddr 0x000000000122f3a8 align 2**0
         filesz 0x000000000000fc58 memsz 0x000000000000fc58 flags r--

Dynamic Section:
  NEEDED               libraw1394.so.11
  NEEDED               librt.so.1
  NEEDED               libiomp5.so
  NEEDED               libpthread.so.0
  NEEDED               libusb-1.0.so.0
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libc.so.6
  NEEDED               libgcc_s.so.1
  SONAME               libfrenet.so.2
  INIT                 0x0000000000199850
  FINI                 0x0000000000db7018
  HASH                 0x00000000000001f0
  GNU_HASH             0x0000000000015308
  STRTAB               0x000000000007c2d8
  SYMTAB               0x000000000002de10
  STRSZ                0x00000000000a95ec
  SYMENT               0x0000000000000018
  PLTGOT               0x000000000123efe8
  PLTRELSZ             0x000000000002f370
  PLTREL               0x0000000000000007
  JMPREL               0x000000000016a4e0
  RELA                 0x000000000012c260
  RELASZ               0x000000000003e280
  RELAENT              0x0000000000000018
  VERNEED              0x000000000012c130
  VERNEEDNUM           0x0000000000000005
  VERSYM               0x00000000001258c4
  RELACOUNT            0x0000000000001428

Version References:
  required from libgcc_s.so.1:
    0x0b792650 0x00 15 GCC_3.0
  required from libm.so.6:
    0x09691a75 0x00 07 GLIBC_2.2.5
  required from libstdc++.so.6:
    0x0bafd171 0x00 13 CXXABI_1.3.1
    0x02297f89 0x00 10 GLIBCXX_3.4.9
    0x056bafd3 0x00 05 CXXABI_1.3
    0x08922974 0x00 04 GLIBCXX_3.4
  required from libpthread.so.0:
    0x09691a75 0x00 06 GLIBC_2.2.5
    0x09691972 0x00 03 GLIBC_2.3.2
  required from libc.so.6:
    0x0d696913 0x00 14 GLIBC_2.3
    0x0d696917 0x00 12 GLIBC_2.7
    0x0d696914 0x00 11 GLIBC_2.4
    0x09691972 0x00 09 GLIBC_2.3.2
    0x09691974 0x00 08 GLIBC_2.3.4
    0x09691a75 0x00 02 GLIBC_2.2.5

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文