Error: libtool - while compiling an MPI program

Error: libtool - while compiling an MPI program

我正在使用 OpenSuse Leap 并安装了 openMPI 以为 YaST。 运行 一个 which mpirun 命令我得到 /usr/lib64/mpi/gcc/openmpi/bin/mpirun 和 运行 which mpicc 我得到 /usr/bin/mpicc.

如何首先确保 OpenMPI 已正确安装?

其次,我有一个简单的 hello world 我是进程 X 程序 运行 mpicc hello.c 我得到了这个输出

gcc: error: libtool:: No such file or directory

gcc: error: link:: No

such file or directory mpicc: No such file or directory

此外,我安装了 Eclipse for Parallel Application 并使用了一个内置示例,它在构建

时给了我这个输出

make all

Building target: hello

Invoking: GCC C Linker

mpicc -o "hello" ./src/hello.o

gcc: error: libtool:: No such file or directory

gcc: error: link:: No such file or directory

makefile:30: recipe for target 'hello' failed

mpicc: No such file or directory

make: *** [hello] Error 1

我检查了 YaST 并安装了 libtool。

这个答案来得太晚了。我最近遇到了同样的问题。因此,任何来这里寻求答案的人,这就是我让它工作的方式。

请注意:这是一个孤立的情况,会出现类似的错误

gcc: error: libtool:: No such file or directory

gcc: error: link:: No such file or directory

mpicc: No such file or directory

首先尝试查看LP建议的解决方案。它将尝试更新您的 libtool autoconf 和 automake。如果你无事可做:

sudo zypper in automake autoconf libtool
root's password:
Loading repository data...
Reading installed packages...
'libtool' is already installed.
No update candidate for 'libtool-2.4.2-15.2.2.x86_64'. The highest available version is already installed.
'autoconf' is already installed.
No update candidate for 'autoconf-2.69-10.1.2.noarch'. The highest available version is already installed.
'automake' is already installed.
No update candidate for 'automake-1.13.4-5.1.2.noarch'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.

然后显式添加您的 OpemMPI 路径变量。

export PATH=/usr/lib64/mpi/gcc/openmpi/bin:$PATH

这对我有用。祝你好运!