铿锵声:error::errorunsupported选项'-fopenmp'在Mac OSX上El Capitan建筑XGBoost [英] clang: error: : errorunsupported option '-fopenmp' on Mac OSX El Capitan building XGBoost

查看:300
本文介绍了铿锵声:error::errorunsupported选项'-fopenmp'在Mac OSX上El Capitan建筑XGBoost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为为Python构建 XGBoost 软件包.readthedocs.org / en / latest / build.html#building-on-osxrel =noreferrer>这些说明:

I'm trying to build XGBoost package for Python following these instructions:


以下是使用支持OpenMP的编译器安装XGBoost的完整解决方案。通过 brew install gcc --without-multilib 获得gcc-5.x.x。 (brew是OS X上apt-get的事实标准。因此不建议单独安装HPC,但它应该可以工作。):

Here is the complete solution to use OpenMP-enabled compilers to install XGBoost. Obtain gcc-5.x.x with openmp support by brew install gcc --without-multilib. (brew is the de facto standard of apt-get on OS X. So installing HPC separately is not recommended, but it should work.):



git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/config.mk ./config.mk; make -j4

这个错误发生在 make -j4 命令。

搜索beforenad,我试过了这两个解决方案( 1 2 ),除了部分安装另一个gcc,因为害怕搞乱所有东西而无济于事。

Searching beforenad, I've tried these two solutions (1 and 2), to no avail, except for the part to installing another gcc by fear of messing up everything.

以下是 make 配置文件。它没有任何怀疑。

Below is the make configuration file. It has none suspicious about.

#-----------------------------------------------------
#  xgboost: the configuration compile script
#
#  If you want to change the configuration, please use the following
#  steps. Assume you are on the root directory of xgboost.
#  First copy the this file so that any local changes will be ignored by git
#
#  $ cp make/config.mk .
#
#  Next modify the according entries, and then compile by
#
#  $ make
#
#  or build in parallel with 8 threads
#
#  $ make -j8
#----------------------------------------------------

# choice of compiler, by default use system preference.
# export CC = gcc
# export CXX = g++
# export MPICXX = mpicxx

# the additional link flags you want to add
ADD_LDFLAGS =

# the additional compile flags you want to add
ADD_CFLAGS =

# Whether enable openmp support, needed for multi-threading.
USE_OPENMP = 1

# whether use HDFS support during compile
USE_HDFS = 0

# whether use AWS S3 support during compile
USE_S3 = 0

# whether use Azure blob support during compile
USE_AZURE = 0

# Rabit library version,
# - librabit.a Normal distributed version.
# - librabit_empty.a Non distributed mock version,
LIB_RABIT = librabit.a

# path to libjvm.so
LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server

# List of additional plugins, checkout plugin folder.
# uncomment the following lines to include these plugins
# you can also add your own plugin like this
#
# XGB_PLUGINS += plugin/example/plugin.mk


推荐答案

您安装了 gcc 与Homebrew,但错误来自 clang 。这应该只是表示你的默认编译器仍然指向 clang ,而不是新安装的 gcc 。如果您阅读Makefile中的注释,您会看到以下几行:

You installed gcc with Homebrew, yet the error is from clang. That should simply mean that your default compiler still points to clang instead of the newly installed gcc. If you read the comments in the Makefile, you'll see the following lines:

# choice of compiler, by default use system preference.
# export CC = gcc
# export CXX = g++
# export MPICXX = mpicxx

,在你的情况下,你不希望系统是一个。

注意:系统的 gcc 指向 clang

and in your case, you don't want the system one.
Note: gcc for the system points to clang:

$ which gcc
/usr/bin/gcc
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

/ usr / local / bin 中的内容,例如:

Instead, point those variables to something in /usr/local/bin, e.g.:

$ export CC=/usr/local/bin/gcc

c $ c> CXX 和 MPICXX ,例如:

and similar for the other two variables, CXX and MPICXX, e.g.:

$ export CC=/usr/local/bin/gcc;CXX=/usr/local/bin/g++;MPICXX=/usr/local/bin/mpicxx

这篇关于铿锵声:error::errorunsupported选项'-fopenmp'在Mac OSX上El Capitan建筑XGBoost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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