16

I've follow the following tutorial in order to install xgboost python package within Cygwin64:

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

But when executing the make in dmlc-core directory I get the following errors:

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

Why am I getting this error? Let me know if you need more information, please.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
mllamazares
  • 7,876
  • 17
  • 61
  • 89

1 Answers1

6

You can put #undef DMLC_LOG_STACK_TRACE right after it's definition on line 45 here. See example in this gist.

execinfo.h is only available on Linux, but in this project it is used only for debugging and printing stack trace on Linux. There is a check for Mingw in their codebase, don't know why it is not defined (they've disabled it, see this PR).

You should try to change those lines and run make again.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • Thanks! I tried removing those lines, but know I get the following error: https://pastebin.com/WSirnMNE – mllamazares May 26 '17 at 07:16
  • Oh, I see. Could you please return logging.h to it's original state and put `#undef DMLC_LOG_STACK_TRACE` right after it's definition on line 45 [here](https://github.com/dmlc/dmlc-core/blob/29b0cbdeaa8ce5ed843bcdaf1edf42cb8952bba7/include/dmlc/base.h#L45)? See example in [this gist](https://gist.github.com/vkotovv/0eb1e50d7e9dfef05e528bbafce8173a). I'm pretty sure it should work this way. – Vadim Kotov May 26 '17 at 08:33
  • 1
    I could try it by myself, but I don't have a Windows machine right now. Maybe tomorrow I could try to build this stuff.. – Vadim Kotov May 26 '17 at 08:40
  • 1
    Ok, stack trace errors are gone. Now try to replace references to `fopen64` with `fopen` in your `src/io/single_file_split.h`. Also please change the `-std=c++0x` in your [Makefile](https://github.com/dmlc/dmlc-core/blob/master/Makefile) to `-std=gnu++0x` (there is a [question](https://stackoverflow.com/questions/29692136/error-fileno-was-not-declared-in-this-scope) with similar problem). – Vadim Kotov May 26 '17 at 09:07
  • Perfect! Now I was able to compile it, but I get the following error when installing the setup.py: https://pastebin.com/4n8KpgXV I've searched for this .so by this way: `find / -name "*libxgboost*"` but it doesn't retrieve nothing. (we're near!) – mllamazares May 26 '17 at 11:21
  • I will try to compile the whole thing tomorrow on Windows and get back to you – Vadim Kotov May 26 '17 at 12:41
  • 1
    I looks like you did not successfully compile `libxgboost.so`. I've tried all these steps on my Ubuntu, and now I have this `so` in `[path to project]/xgboost/lib` dir. But I had to run the latest `make` **twice** - it had some errors on my 1st run. – Vadim Kotov May 26 '17 at 12:55
  • Thanks again! I tried the following steps: https://pastebin.com/XAijBFU5 – mllamazares May 26 '17 at 14:20
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/145212/discussion-between-vadim-kotov-and-harrison4). – Vadim Kotov May 26 '17 at 14:24