如何将 openMP 安装到 Jenkins 镜像

问题描述 投票:0回答:1

问题:

我已将 OpenMP 添加到 C++ 项目中,该项目是使用 cmake 构建的。我使用 ubuntu 18.04 在本地成功构建了它。 然后我尝试在 Jenkins 上构建它,其 ubuntu 版本也是 18.04 但是,当它构建时,它找不到 OpenMP 库。

那么如何配置 Jenkins 管道以使其包含 omp 库(抱歉我以前从未配置过 Jenkins)? 我已经尝试过运行

sudo apt-get install libomp-dev
作为构建步骤 它失败了

17:56:57 E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
17:56:57 E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

这是我执行 ld -lomp --verbose 时发生的情况

23:25:39 attempt to open //usr/local/lib/x86_64-linux-gnu/libomp.so failed
23:25:39 attempt to open //usr/local/lib/x86_64-linux-gnu/libomp.a failed
23:25:39 attempt to open //lib/x86_64-linux-gnu/libomp.so failed
23:25:39 attempt to open //lib/x86_64-linux-gnu/libomp.a failed
23:25:39 attempt to open //usr/lib/x86_64-linux-gnu/libomp.so failed
23:25:39 attempt to open //usr/lib/x86_64-linux-gnu/libomp.a failed
23:25:39 attempt to open //usr/lib/x86_64-linux-gnu64/libomp.so failed
23:25:39 attempt to open //usr/lib/x86_64-linux-gnu64/libomp.a failed
23:25:39 attempt to open //usr/local/lib64/libomp.so failed
23:25:39 attempt to open //usr/local/lib64/libomp.a failed
23:25:39 attempt to open //lib64/libomp.so failed
23:25:39 attempt to open //lib64/libomp.a failed
23:25:39 attempt to open //usr/lib64/libomp.so failed
23:25:39 attempt to open //usr/lib64/libomp.a failed
23:25:39 attempt to open //usr/local/lib/libomp.so failed
23:25:39 attempt to open //usr/local/lib/libomp.a failed
23:25:39 attempt to open //lib/libomp.so failed
23:25:39 attempt to open //lib/libomp.a failed
23:25:39 attempt to open //usr/lib/libomp.so failed
23:25:39 attempt to open //usr/lib/libomp.a failed
23:25:39 attempt to open //usr/x86_64-linux-gnu/lib64/libomp.so failed
23:25:39 attempt to open //usr/x86_64-linux-gnu/lib64/libomp.a failed
23:25:39 attempt to open //usr/x86_64-linux-gnu/lib/libomp.so failed
23:25:39 attempt to open //usr/x86_64-linux-gnu/lib/libomp.a failed
23:25:39 ld: cannot find -lomp

非常感谢任何帮助。预先感谢。

jenkins cmake openmp
1个回答
0
投票

完成这两件事后,Jenkins 似乎能够使用 OpenMP 标志进行构建。

  1. 在 Jenkins 中的实际构建注释之前添加
    sudo -s apt-get update
    作为构建步骤。
  2. 在cmake文件中添加
    find_package(OpenMP)
© www.soinside.com 2019 - 2024. All rights reserved.