[英]Problem using MPI in a python program when testing it with a gitlab-ci.yml pipeline
I have a python code hosted in gitlab.我有一个 python 代码托管在 gitlab 中。 Recently, I have added the use of to handle parallel runs with MPI.
最近,我添加了使用 MPI 来处理并行运行。 I have a testsuite that is launched by the gitlab CI system.
我有一个由 gitlab CI 系统启动的测试套件。 However, it fails as soon as it tries to install the mpi4py package.
但是,一旦尝试安装 mpi4py package,它就会失败。
I am using the python 3.7 image.我正在使用 python 3.7 映像。 The.gitlab-ci.yml file is:
.gitlab-ci.yml 文件是:
image: python:3.7
test:
stage: test
script:
- pip install -r requirements.txt
- python setup.py build
- python setup.py install
- pytest --junitxml=report.xml -v tests/short.py
artifacts:
when: always
paths:
- report.xml
reports:
junit: report.xml
The failure happens when, upon installing the mpi4py package as requested in the requirements.txt file, the build process fails with the message:当按照 requirements.txt 文件中的要求安装 mpi4py package 时,会发生故障,构建过程失败并显示以下消息:
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.7m -c _configtest.c -o _configtest.o
_configtest.c:2:10: fatal error: mpi.h: No such file or directory
2 | #include <mpi.h>
| ^~~~~~~
compilation terminated.
failure.
removing: _configtest.c _configtest.o
error: Cannot compile MPI programs. Check your configuration!!!
[end of output]
I suppose that the mpi C library is missing?我想缺少 mpi C 库? How should I install it?
我应该如何安装它?
Maybe you want to have a look at how to install libmpich-dev
in general ( https://mpi4py.readthedocs.io/en/latest/install.html#linux ).也许你想看看如何安装
libmpich-dev
( https://mpi4py.readthedocs.io/en/latest/install.html#linux )。
gcc should be present in your container already. gcc 应该已经存在于您的容器中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.