【问题标题】:Error when installing mpi4py on Ubuntu instance在 Ubuntu 实例上安装 mpi4py 时出错
【发布时间】:2019-10-12 23:06:28
【问题描述】:

我正在尝试在我的 Ubuntu 18.04 实例上安装 mpi4py。我已经安装了 python3.6.5。

首先我尝试sudo apt-get build-dep python-mpi4py,我得到:

正在阅读包列表...完成 E:您必须在其中放入一些“源”URI 你的sources.list

然后我尝试简单地使用pip install mpi4py 进行安装。我收到一条很长的错误消息,其中包含以下一些最重要的部分:

checking for library 'lmpe' ...
  /home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
  --------------------------------------------------------------------------
  The Open MPI wrapper compiler was unable to find the specified compiler
  x86_64-conda_cos6-linux-gnu-cc in your PATH.

  Note that this compiler was either specified at configure time or in
  one of several possible environment variables.
  --------------------------------------------------------------------------
  failure.

大多数库都会发生此故障。我只包括其中之一,并且

  warning: build_clib: command '/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc' failed with exit status 1

  warning: build_clib: building optional library "vt-mpi" failed


  checking for library 'vt-hyb' ...
  /home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
  --------------------------------------------------------------------------
  The Open MPI wrapper compiler was unable to find the specified compiler
  x86_64-conda_cos6-linux-gnu-cc in your PATH.

  Note that this compiler was either specified at configure time or in
  one of several possible environment variables.

运行which mpcc 给出:

(tensorflow_p36) ubuntu@ip-172-31-35-200:~$ which mpicc
/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc

如何将指定的编译器 x86_64-conda_cos6-linux-gnu-cc 添加到我的 PATH 以解决此错误?

【问题讨论】:

    标签: python ubuntu


    【解决方案1】:

    简单运行:

    conda install -c anaconda mpi4py 如图here

    另外,helpful comment Lidandro Dalcin:

    我猜你缺少 mpich-mpicc 包,这是一个 依赖于正确编译器的元包。你为什么要安装 mpi4py 与 pip?也许您只需要 conda install mpi4py (在 conda-forge 频道中可用)?

    【讨论】:

      猜你喜欢
      • 2015-04-11
      • 2018-09-07
      • 1970-01-01
      • 2014-03-06
      • 2014-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多