在Anaconda 3 windows64上安装xgboost

2024-10-01 17:27:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我在为水蟒3安装xgboost,在windows1064位上。我遵循了https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_For_Anaconda_on_Windows?lang=enhttps://dnc1994.com/2016/03/installing-xgboost-on-windows/教程的说明,但未能完成编译过程。在

我执行了以下代码(git bash),在这个阶段一切似乎都没问题:

$ git clone --recursive https://github.com/dmlc/xgboost
$ cd xgboost
$ git submodule init
$ git submodule update

然后,我安装了mingw并添加到路径中:

^{pr2}$

以下指令已执行且未返回错误:

$ which mingw32-make
$ alias make='mingw32-make'

接下来,我尝试执行folling命令(也是git bash),在第2步(make-j4)中遇到错误:

$ cd dmlc-core
$ make -j4
$ cd ../rabit
$ make lib/librabit_empty.a -j4
$ cd ..
$ cp make/mingw64.mk config.mk
$ make -j4

我得到了以下错误:

$ make -j4
g++ -c -O3 -Wall -Wno-unknown-pragmas -Iinclude  -std=c++0x -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -msse2 -o line_split.o src/io/line_split.cc
g++ -c -O3 -Wall -Wno-unknown-pragmas -Iinclude  -std=c++0x -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -msse2 -o recordio_split.o src/io/recordio_split.cc
g++ -c -O3 -Wall -Wno-unknown-pragmas -Iinclude  -std=c++0x -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -msse2 -o input_split_base.o src/io/input_split_base.cc
g++ -c -O3 -Wall -Wno-unknown-pragmas -Iinclude  -std=c++0x -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -msse2 -o io.o src/io.cc
src/io/recordio_split.cc:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
src/io/input_split_base.cc:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
src/io.cc:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
src/io/line_split.cc:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
src/io/input_split_base.cc: In member function 'void dmlc::io::InputSplitBase::InitInputFileInfo(const string&)':
src/io/input_split_base.cc:112:12: warning: variable 'exact_match' set but not used [-Wunused-but-set-variable]
In file included from c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/cstdio:44:0,
                 from include/dmlc/io.h:8,
                 from src/io.cc:4:
c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/stdio.h:396:83: error: 'FILE* std::fopen(const char*, const char*)' should have been declared inside 'std'
c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/stdio.h:396:83: error: declaration of 'FILE* std::fopen(const char*, const char*)'
c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/stdio.h:395:17: error: conflicts with previous declaration 'FILE* fopen(const char*, const char*)'
In file included from include/dmlc/./././parameter.h:25:0,
                 from include/dmlc/././registry.h:14,
                 from include/dmlc/./data.h:16,
                 from include/dmlc/threadediter.h:20,
                 from src/io/cached_input_split.h:16,
                 from src/io.cc:13:
include/dmlc/././././optional.h:31:27: error: both 'const' and 'constexpr' cannot be used here
In file included from include/dmlc/././registry.h:14:0,
                 from include/dmlc/./data.h:16,
                 from include/dmlc/threadediter.h:20,
                 from src/io/cached_input_split.h:16,
                 from src/io.cc:13:
include/dmlc/./././parameter.h: In member function 'virtual void dmlc::parameter::FieldEntry<float>::Set(void*, const string&) const':
include/dmlc/./././parameter.h:962:25: error: 'stof' is not a member of 'std'
include/dmlc/./././parameter.h: In member function 'virtual void dmlc::parameter::FieldEntry<double>::Set(void*, const string&) const':
include/dmlc/./././parameter.h:983:25: error: 'stod' is not a member of 'std'
In file included from src/io/cached_input_split.h:16:0,
                 from src/io.cc:13:
include/dmlc/threadediter.h: At global scope:
include/dmlc/threadediter.h:210:3: error: 'thread' in namespace 'std' does not name a type
include/dmlc/threadediter.h:216:3: error: 'mutex' in namespace 'std' does not name a type
include/dmlc/threadediter.h:222:3: error: 'condition_variable' in namespace 'std' does not name a type
include/dmlc/threadediter.h:224:3: error: 'condition_variable' in namespace 'std' does not name a type
include/dmlc/threadediter.h: In constructor 'dmlc::ThreadedIter<DType>::ThreadedIter(size_t)':
include/dmlc/threadediter.h:82:9: error: class 'dmlc::ThreadedIter<DType>' does not have any field named 'producer_thread_'
include/dmlc/threadediter.h: In member function 'virtual void dmlc::ThreadedIter<DType>::BeforeFirst()':
include/dmlc/threadediter.h:168:5: error: 'unique_lock' is not a member of 'std'
include/dmlc/threadediter.h:168:22: error: 'mutex' is not a member of 'std'
include/dmlc/threadediter.h:168:39: error: 'mutex_' was not declared in this scope

。。。。。 dmlc::ThreadedIter::Next()[使用DType=dmlc::data::RowBlockContainer]' src公司/数据。抄送:160:1:从这里实例化 include/dmlc/threadeditor.h:387:5:错误:“lock”未在此作用域中声明 include/dmlc/threadediter.h:在成员函数“bool dmlc::threadediter::Next(DType**)[with DType=dmlc::data::RowBlockContainer]”中: include/dmlc/threadeditor.h:151:5:从“bool dmlc::threadediter::Next()[具有DType=dmlc::data::RowBlockContainer]”实例化 src公司/数据。抄送:160:1:从这里实例化 include/dmlc/threadeditor.h:362:3:错误:“lock”未在此作用域中声明 include/dmlc/threadediter.h:在成员函数“void dmlc::threadediter::Recycle(DType**)[with DType=dmlc::data::RowBlockContainer]”中: include/dmlc/threadediter.h:149:7:从“bool dmlc::threadediter::Next()[具有DType=dmlc::data::RowBlockContainer]”实例化 src公司/数据。抄送:160:1:从这里实例化 include/dmlc/threadeditor.h:387:5:错误:“lock”未在此作用域中声明 include/dmlc/threadediter.h:在成员函数“bool dmlc::threadediter::Next(DType**)[with DType=dmlc::data::RowBlockContainer]”中: include/dmlc/threadeditor.h:151:5:从“bool dmlc::threadediter::Next()[具有DType=dmlc::data::RowBlockContainer]”实例化 src公司/数据。抄送:160:1:从这里实例化 include/dmlc/threadeditor.h:362:3:错误:“lock”未在此作用域中声明 生成文件:83:目标“data.o”的配方失败 mingw32 make:**[data.o]错误1

我在google上搜索了很多东西,似乎在anacoda3windows64上安装一个最新版本的pythonxgboost似乎非常困难。 有人能告诉我怎么处理这个问题吗?在


Tags: fromiosrcincludeusenoterrorcc

热门问题