【问题标题】:execinfo.h missing when installing xgboost in Cygwin在 Cygwin 中安装 xgboost 时缺少 execinfo.h
【发布时间】:2017-10-21 21:35:05
【问题描述】:

我已按照以下教程在 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

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

【问题讨论】:

    标签: python c gcc cygwin xgboost


    【解决方案1】:

    您可以在第 45 行 here 的定义后面加上 #undef DMLC_LOG_STACK_TRACE。请参阅此gist 中的示例。

    execinfo.h 仅在 Linux 上可用,但在此项目中,它仅用于在 Linux 上调试和打印堆栈跟踪。在他们的代码库中有 a check 用于 Mingw,不知道为什么没有定义它(他们已经禁用它,请参见 PR)。

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

    【讨论】:

    • 谢谢!我尝试删除这些行,但知道我收到以下错误:pastebin.com/WSirnMNE
    • 哦,我明白了。您能否将 logging.h 恢复到其原始状态并将#undef DMLC_LOG_STACK_TRACE 放在第 45 行 here 的定义之后?请参阅this gist 中的示例。我很确定它应该这样工作。
    • 我可以自己试试,但我现在没有Windows机器。也许明天我可以尝试构建这些东西..
    • 好的,堆栈跟踪错误消失了。现在尝试在您的src/io/single_file_split.h 中用fopen 替换对fopen64 的引用。另外请将Makefile 中的-std=c++0x 更改为-std=gnu++0x(有一个question 有类似问题)。
    • 我看起来你没有成功编译libxgboost.so。我已经在我的 Ubuntu 上尝试了所有这些步骤,现在我在 [path to project]/xgboost/lib 目录中有这个 so。但是我必须运行最新的make 两次 - 我第一次运行时出现了一些错误。
    猜你喜欢
    • 2020-06-03
    • 1970-01-01
    • 2019-08-09
    • 2014-07-04
    • 1970-01-01
    • 2019-10-21
    • 2012-05-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多