简体   繁体   English

使用 gitlab-ci.yml 管道测试 python 程序时出现问题

[英]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-devhttps://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.

相关问题 使用 PWD 在.gitlab-ci.yml 中定义变量时出错 - Error using the PWD to define variables in .gitlab-ci.yml 使用 gitlab-ci.yml 中的 awk 命令杀死 docker 容器 - Kill a docker container using awk command in gitlab-ci.yml 如何在 windows 上使用 gitlab-ci-multi-runner 访问 gitlab-ci.yml 中的变量 - How to access variables in gitlab-ci.yml using gitlab-ci-multi-runner on windows 尝试更新 my.gitlab-ci.yml 文件以运行 SAST 并且管道失败(无法提取图像) - Trying to update my .gitlab-ci.yml file to run SAST and the pipeline fails (Failed to pull image) 是否可以在.gitlab-ci.yml 中使用动态变量? - Is it possible to use dynamic variables in .gitlab-ci.yml? 条件 after_script in.gitlab-ci.yml - conditional after_script in .gitlab-ci.yml 用于编译 Go 二进制文件的 Simple.gitlab-ci.yml 文件 - Simple .gitlab-ci.yml file for compiling a Go binary 如何制作一个简单的 GitLab Ci/CD gitlab-ci.yml 文件来构建 Angular 项目? - How to make a simple GitLab Ci/CD gitlab-ci.yml file to build an Angular project? 如何在没有 GitLab Runner 的远程服务器上使用 gitlab-ci.yml 自动部署? - How can i auto deploy with gitlab-ci.yml on a remote server without GitLab Runner? gitlab-ci.yml 和 shell 执行器无法获取用户变量 $env:*** - cannot get user variable $env:*** by gitlab-ci.yml and shell executor
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM