使用 GCC 而不是 Intel 从存储库安装 OpenMPI

使用 GCC 而不是 Intel 从存储库安装 OpenMPI

我想从存储库安装 openmpi 并需要将其与 GCC 一起使用。问题是我也安装了英特尔库,这会导致如下问题:

mpicc.openmpi --version
mpicc.openmpi: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory

我的 GCC 版本是:

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609

我正在尝试使用以下命令安装 openmpi:

sudo aptitude install  openmpi-bin libopenmpi-dev

那么,如何才能从存储库安装 OpenMPI,以忽略英特尔库并仅使用 GCC?


编辑

which mpicc.openmpi
/usr/bin/mpicc.openmpi

ldd $(which mpicc.openmpi)
linux-vdso.so.1 =>  (0x00007fffd6fc0000)
libopen-pal.so.13 => /usr/local/lib/libopen-pal.so.13 (0x00007f9b0c8d0000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9b0c6b3000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9b0c2e9000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9b0bfe0000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9b0bddc000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9b0bbd3000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f9b0b9d0000)
libimf.so => not found
libsvml.so => not found
libirng.so => not found
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9b0b7b9000)
/lib64/ld-linux-x86-64.so.2 (0x000056030ed59000)
libintlc.so.5 => not found

我已经安装了英特尔包英特尔® Parallel Studio XE |英特尔® 软件手动(即,./install_gui.sh)。


编辑2

我尝试使用以下方法重新安装 OpenMPI

sudo apt-get install --reinstall openmpi-bin libopenmpi-dev

sudo apt-get purge openmpi-bin libopenmpi-dev
sudo apt-get install openmpi-bin libopenmpi-dev

但它们都没有达到预期的效果,库仍然链接到英特尔库。

英特尔图书馆位于/opt/intel


编辑3

ls -l /usr/bin/mpicc.openmpi /usr/bin/opal_wrapper; apt-cache policy openmpi-bin libopenmpi-dev

lrwxrwxrwx 1 root root    12 Feb 25  2016 /usr/bin/mpicc.openmpi -> opal_wrapper
-rwxr-xr-x 1 root root 18928 Feb 25  2016 /usr/bin/opal_wrapper


apt-cache policy openmpi-bin libopenmpi-dev
openmpi-bin:
  Installed: 1.10.2-8ubuntu1
  Candidate: 1.10.2-8ubuntu1
  Version table:
 *** 1.10.2-8ubuntu1 500
        500 http://at.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status
libopenmpi-dev:
  Installed: 1.10.2-8ubuntu1
  Candidate: 1.10.2-8ubuntu1
  Version table:
 *** 1.10.2-8ubuntu1 500
        500 http://at.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status

答案1

  • 看起来,英特尔mpicc.openmpi从存储库或其链接库之一覆盖了官方版本。

    这是我从存储库进行官方安装的输出:

      ~$ dpkg -S /usr/bin/mpicc.openmpi
      libopenmpi-dev: /usr/bin/mpicc.openmpi
    
      ~$ ldd /usr/bin/mpicc.openmpi
          linux-vdso.so.1 =>  (0x00007ffd785f4000)
          libopen-pal.so.13 => /usr/lib/libopen-pal.so.13 (0x00007ff1d848d000)
          libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff1d8270000)
          libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff1d7ea6000)
          libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff1d7ca2000)
          librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff1d7a9a000)
          libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007ff1d7896000)
          libhwloc.so.5 => /usr/lib/x86_64-linux-gnu/libhwloc.so.5 (0x00007ff1d765c000)
          /lib64/ld-linux-x86-64.so.2 (0x000056499326f000)
          libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007ff1d7450000)
          libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007ff1d7246000)
    

    它不依赖那些缺失的库。

  • 要修复此问题,您可以重新安装 libopenmpi:

      sudo apt-get install --reinstall openmpi-bin libopenmpi-dev
    
  • 另请注意/usr/local/lib/libopen-pal.so.13。它在/usr/local/lib/文件夹中,因此其优先级高于官方的优先级/usr/lib/,兼容性可能会被破坏。

    使用以下方法检查所有子版本

      ls -l /usr/local/lib/libopen-pal.so.13*
    

    然后重命名它们,例如

      sudo mv /usr/local/lib/libopen-pal.so.13 /usr/local/lib/libopen-pal.so.13.backup
    

相关内容