24

次の手順に従って、Python 用のXGBoostパッケージをビルドしようとしています。

OpenMP 対応コンパイラを使用して XGBoost をインストールするための完全なソリューションを次に示します。によって openmp をサポートする gcc-5.xx を入手しbrew install gcc --without-multilibます。(brew は OS X の apt-get の事実上の標準です。したがって、HPC を個別にインストールすることはお勧めしませんが、動作するはずです。):

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

このエラーは、コマンドで正確に発生しますmake -j4

前に検索して、すべてを台無しにすることを恐れて別のgccをインストールする部分を除いて、これら2つのソリューション( 1および2 )を試しましたが、役に立ちませんでした。

以下はmake設定ファイルです。疑わしいものは何もありません。

#-----------------------------------------------------
#  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
4

4 に答える 4

34

gccHomebrew でインストールしましたが、エラーはclang. これは単に、デフォルトのコンパイラclangが、新しくインストールされgccた . Makefile のコメントを読むと、次の行が表示されます。

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

あなたの場合、システムのものは必要ありません。
注:gccシステムが指すのは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ください。

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

および他の 2 つの変数についても同様です。たとえば、次のようにCXXなります。MPICXX

$ export CC=/usr/local/bin/gcc;CXX=/usr/local/bin/g++;MPICXX=/usr/local/bin/mpicxx
于 2016-03-24T22:38:01.040 に答える
9

サー、おそらくあなたは使うべきです

cd xgboost; cp make/minimum.mk ./config.mk; -j4 を作る

それ以外の

cd xgboost; cp make/config.mk ./config.mk; -j4 を作る

ビルドドキュメントの「Build On OSX」セクションに従って

于 2017-01-12T23:14:31.850 に答える