如何处理"c:错误:不支持的选项'-fopenmp'";在特拉维斯? [英] How to deal with "clang: error: unsupported option '-fopenmp'" on travis?

查看:75
本文介绍了如何处理"c:错误:不支持的选项'-fopenmp'";在特拉维斯?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试使用 openmp 部署项目.我在Travis上有标志'-fopenmp'.

I am currently trying to deploy a project using openmp. I have the flag '-fopenmp' on Travis.

我该如何解决?

在本地,我只需 brew安装libopenmp 即可解决此问题.但是在Travis上没有,有什么选择?

In local I just brew install libopenmp which solved the issue. But not on Travis, what are the options ?

使用cython,我得到了以下".travis.yml"

Using cython I got the following ".travis.yml"

os: linux

dist: xenial

language: python

python:
  - "3.7"

cache: pip

addons:
  apt:
    packages:
      - patchelf

matrix:
  include:
  - os: osx
    # No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312
    language: generic
    env: TOXENV=py37

  fast_finish: true

before_install:
  brew install libomp

install:
  - pip install --upgrade "pip < 19.1" -r CI/requirements.txt
  - python setup.py develop

script:
  - pytest

Travis在执行时失败:

Travis fails while executing :

clang -fno-strict-aliasing -fno-common -dynamic -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3-Wall -Wstrict原型-I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@ 2/2.7.17/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cpt/alphabet.c -o build/temp.macosx-10.13-x86_64-2.7/cpt/alphabet.o -fopenmp

clang -fno-strict-aliasing -fno-common -dynamic -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cpt/alphabet.c -o build/temp.macosx-10.13-x86_64-2.7/cpt/alphabet.o -fopenmp

在本地使用 python 3.7 进行编译时,该如何解决呢?

While in local it compiles with python 3.7, how could I fix that aswell ?

推荐答案

在苹果的 llvm 上,不支持 -fopenmp .一个人应该使用brew的 llvm .

On apple's llvm, -fopenmp is not supported. One should use brew's llvm.

以下能够链接 openmp

 - brew install llvm libomp
 - export CPP=/usr/local/opt/llvm/bin/clang;

作为参考,这里有所有命令: https://github.com/bluesheeptoken/CPT/issues/68#issuecomment-563342866

For reference, the issue where there are all the commands: https://github.com/bluesheeptoken/CPT/issues/68#issuecomment-563342866

这篇关于如何处理"c:错误:不支持的选项'-fopenmp'";在特拉维斯?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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