execinfo.h 在 Cygwin 中安装 xgboost 时丢失

execinfo.h missing when installing xgboost in Cygwin

我按照以下教程在 Cygwin64 中安装 xgboost python 包:

https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_For_Anaconda_on_Windows

但是在 dmlc-core 目录中执行 make 时出现以下错误:

harrison4@mypc ~/xgboost/dmlc-core
$ mingw32-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/line_split.cc:1:0: aviso: se descarta -fPIC para el objetivo (todo el código es independiente de posición)
 // Copyright by Contributors
 ^
src/io.cc:1:0: aviso: se descarta -fPIC para el objetivo (todo el código es independiente de posición)
 // Copyright by Contributors
 ^
src/io/input_split_base.cc:1:0: aviso: se descarta -fPIC para el objetivo (todo el código es independiente de posición)
 // Copyright by Contributors
 ^
src/io/recordio_split.cc:1:0: aviso: se descarta -fPIC para el objetivo (todo el código es independiente de posición)
 // Copyright by Contributors
 ^
In file included from include/dmlc/io.h:14:0,
                 from src/io/line_split.cc:2:
include/dmlc/./logging.h:18:22: error fatal: execinfo.h: No such file or directory
compilación terminada.
Makefile:83: recipe for target 'line_split.o' failed
mingw32-make: *** [line_split.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....
In file included from src/io/input_split_base.cc:2:0:
include/dmlc/logging.h:18:22: error fatal: execinfo.h: No such file or directory
compilación terminada.
In file included from include/dmlc/io.h:14:0,
                 from src/io.cc:4:
include/dmlc/./logging.h:18:22: error fatal: execinfo.h: No such file or directory
compilación terminada.
Makefile:83: recipe for target 'input_split_base.o' failed
mingw32-make: *** [input_split_base.o] Error 1
Makefile:83: recipe for target 'io.o' failed
mingw32-make: *** [io.o] Error 1
In file included from include/dmlc/./io.h:14:0,
                 from include/dmlc/recordio.h:12,
                 from src/io/recordio_split.cc:2:
include/dmlc/././logging.h:18:22: error fatal: execinfo.h: No such file or directory
compilación terminada.
Makefile:83: recipe for target 'recordio_split.o' failed
mingw32-make: *** [recordio_split.o] Error 1

为什么会出现此错误?如果您需要更多信息,请告诉我。

您可以将 #undef DMLC_LOG_STACK_TRACE 放在第 45 行 here. See example in this gist 的定义之后。

execinfo.h 仅在 Linux 上可用,但在本项目中它仅用于 Linux 上的调试和打印堆栈跟踪。有a check for Mingw in their codebase, don't know why it is not defined (they've disabled it, see this PR).

您应该尝试更改这些行并再次 运行 make