运行python脚本时接收clang:error:不支持的选项'-fopenmp'

时间:2019-07-04 02:21:28

标签: clang

我正在尝试安装人口遗传学程序PCAngsd(文档:https://github.com/Rosemeis/pcangsd)。从git clone开始,安装说明非常简单。 但是,当我进入build_ext命令时,我遇到了麻烦:

git clone https://github.com/Rosemeis/pcangsd.git
cd pcangsd/
python setup.py build_ext --inplace

这会产生错误:

running build_ext
building 'shared' extension
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/Library/Python/2.7/site-packages/numpy-1.14.2-py2.7-macosx-10.13-intel.egg/numpy/core/include -I/Library/Python/2.7/site-packages/numpy-1.14.2-py2.7-macosx-10.13-intel.egg/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c shared.c -o build/temp.macosx-10.14-intel-2.7/shared.o -fopenmp
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
error: command 'cc' failed with exit status 1

我认为这可能与没有所有必需的软件包有关。但是幸运的是,PCAngsd页面提供了一个简单的命令:

pip install --user -r requirements.txt

但是,这会产生错误:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: numpy in /Library/Python/2.7/site-packages/numpy-1.14.2-py2.7-macosx-10.13-intel.egg (from -r requirements.txt (line 1)) (1.14.2)
Requirement already satisfied: scipy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from -r requirements.txt (line 2)) (0.13.0b1)
Requirement already satisfied: cython in /Users/danielazarate/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 3)) (0.29.11)
Requirement already satisfied: pandas in /Library/Python/2.7/site-packages/pandas-0.22.0-py2.7-macosx-10.13-intel.egg (from -r requirements.txt (line 4)) (0.22.0)
Collecting pandas-plink (from -r requirements.txt (line 5))
Requirement already satisfied: python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pandas->-r requirements.txt (line 4)) (1.5)
Requirement already satisfied: pytz>=2011k in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pandas->-r requirements.txt (line 4)) (2013.7)
Installing collected packages: pandas-plink
ERROR: Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/_internal/cli/base_command.py", line 178, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/_internal/commands/install.py", line 414, in run
    use_user_site=options.use_user_site,
  File "/Library/Python/2.7/site-packages/pip/_internal/req/__init__.py", line 58, in install_given_reqs
    **kwargs
  File "/Library/Python/2.7/site-packages/pip/_internal/req/req_install.py", line 920, in install
    use_user_site=use_user_site, pycompile=pycompile,
  File "/Library/Python/2.7/site-packages/pip/_internal/req/req_install.py", line 448, in move_wheel_files
    warn_script_location=warn_script_location,
  File "/Library/Python/2.7/site-packages/pip/_internal/wheel.py", line 428, in move_wheel_files
    assert info_dir, "%s .dist-info directory not found" % req
AssertionError: pandas-plink .dist-info directory not found

我对python的了解非常有限,我也不知道该怎么做。

似乎是:

  1. c声有误

我尝试过更新clang并安装gcc编译器,我见过的所有建议都提供给遇到类似问题的人,但是到目前为止,没有任何帮助。

  1. 这会导致构建共享扩展名时出错。

  2. 在安装pandas-plink软件包时出现错误。而且我不知道该如何解决!

任何建议将不胜感激!谢谢!

0 个答案:

没有答案