在 Ubuntu 实例上安装 mpi4py 时出错 [英] Error when installing mpi4py on Ubuntu instance

查看:39
本文介绍了在 Ubuntu 实例上安装 mpi4py 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

<块引用>

正在阅读软件包列表...完成 E:您必须将一些源"URI 放入您的来源列表

然后我尝试使用 pip install mpi4py 简单地安装.我收到一条很长的错误消息,我在下面列出了一些最重要的部分:

正在检查库 '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--------------------------------------------------------------------------Open MPI 包装器编译器无法找到指定的编译器x86_64-conda_cos6-linux-gnu-cc 在您的路径中.请注意,此编译器要么是在配置时指定的,要么是在几个可能的环境变量之一.--------------------------------------------------------------------------失败.

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

 警告:build_clib:命令 '/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc' 失败,退出状态为 1警告:build_clib:构建可选库vt-mpi"失败正在检查库 '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--------------------------------------------------------------------------Open MPI 包装器编译器无法找到指定的编译器x86_64-conda_cos6-linux-gnu-cc 在您的路径中.请注意,此编译器要么是在配置时指定的,要么是在几个可能的环境变量之一.

运行 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 以解决此错误?

解决方案

只需运行:

conda install -c anaconda mpi4py此处所示.>

此外,还有一个有用的评论 由 Lidandro Dalcin 撰写:

<块引用>

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

I'm trying to install mpi4py on my Ubuntu 18.04 instance. I have python3.6.5 installed.

First I try sudo apt-get build-dep python-mpi4py and I get:

Reading package lists... Done E: You must put some 'source' URIs in your sources.list

I then try to install simply with pip install mpi4py. I get a long error message and I include some of the most important parts below:

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.

This failure occurs for most libraries. I include just one of the many, and

  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.

Running which mpcc gives:

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

How can I add the specified compiler x86_64-conda_cos6-linux-gnu-cc to my PATH in order to resolve this error?

解决方案

Simply run:

conda install -c anaconda mpi4py as shown here.

Also, a helpful comment by Lidandro Dalcin:

I guess you are missing the mpich-mpicc package, this one is a metapackage that depends in the right compiler. Why are you installing mpi4py with pip? Maybe all you need is to conda install mpi4py (available in the conda-forge channel) ?

这篇关于在 Ubuntu 实例上安装 mpi4py 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆