Xgboost: Error al instalar xgboost

Creado en 10 jun. 2016  ·  19Comentarios  ·  Fuente: dmlc/xgboost

Oye, tengo un error al intentar utilizar el cmd "make". Probé tanto mingw-64 como los compiladores TDM-GCC, pero no tuve suerte. Aquí está el registro de errores:

$ cp make / mingw64.mk config.mk; hacer -j4
g ++ -m64 -std = c ++ 0x -Wall -O3 -msse2 -Wno-pragmas-desconocidos -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD = 0 -Idmlc-core / include -Irabit / include -fopenmp -MM -MT build / c_api / c_api.o src / c_api / c_api.cc> build / c_api / c_api.d
g ++ -m64 -std = c ++ 0x -Wall -O3 -msse2 -Wno-pragmas-desconocidos -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD = 0 -Idmlc-core / include -Irabit / include -fopenmp -MM -MT build / c_api / c_api_error.o src / c_api / c_api_error.cc> build / c_api / c_api_error.d
g ++ -m64 -std = c ++ 0x -Wall -O3 -msse2 -Wno-pragmas-desconocidos -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD = 0 -Idmlc-core / include -Irabit / include -fopenmp -MM -MT build / data / sparse_page_raw_format.o src / data / sparse_page_raw_format.cc> build / data / sparse_page_raw_format.d
g ++ -m64 -std = c ++ 0x -Wall -O3 -msse2 -Wno-pragmas-desconocidos -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD = 0 -Idmlc-core / include -Irabit / include -fopenmp -MM -MT build / data / simple_dmatrix.o src / data / simple_dmatrix.cc> build / data / simple_dmatrix.d
g ++ -m64 -c -std = c ++ 0x -Wall -O3 -msse2 -Wno-pragmas-desconocidos -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD = 0 -Idmlc-core / include -Irabit / include -fopenmp -c src / c_api / c_api.cc -o build / c_api / c_api.o
g ++ -m64 -c -std = c ++ 0x -Wall -O3 -msse2 -Wno-pragmas-desconocidos -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD = 0 -Idmlc-core / include -Irabit / include -fopenmp -c src / data / sparse_page_raw_format.cc -o build / data / sparse_page_raw_format.o
g ++ -m64 -c -std = c ++ 0x -Wall -O3 -msse2 -Wno-pragmas-desconocidos -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD = 0 -Idmlc-core / include -Irabit / include -fopenmp -c src / c_api / c_api_error.cc -o build / c_api / c_api_error.o
g ++ -m64 -c -std = c ++ 0x -Wall -O3 -msse2 -Wno-pragmas-desconocidos -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD = 0 -Idmlc-core / include -Irabit / include -fopenmp -c src / data / simple_dmatrix.cc -o build / data / simple_dmatrix.o
En archivo incluido de C: /TDM-GCC-64/x86_64-w64-mingw32/include/locale.h: 12: 0,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / clocale: 42 ,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / x86_64-w64-mingw32 / bits / c ++ locale.h: 41,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / bits / localefwd.h: 40,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / string: 43 ,
de dmlc-core / include / dmlc / base.h: 154,
de include / xgboost / data.h: 10,
de src / data / simple_dmatrix.cc: 7:
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 450: 83: error: 'FILE * std :: fopen (const char_, const char_)' debería haberse declarado dentro de 'std'
ARCHIVO _fopen64 (const char * restringir nombre de archivo, const char * restringir modo);
^
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 450: 83: error: 'FILE_ std :: fopen (const char_, const char_)' entra en conflicto con una declaración anterior
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 449: 17: nota: declaración anterior 'FILE * fopen (const char_, const char_)'
ARCHIVO _ cdecl fopen (const char * __restrict _Filename, const char * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
^
En archivo incluido de C: /TDM-GCC-64/x86_64-w64-mingw32/include/locale.h: 12: 0,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / clocale: 42 ,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / x86_64-w64-mingw32 / bits / c ++ locale.h: 41,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / bits / localefwd.h: 40,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / string: 43 ,
de dmlc-core / include / dmlc / base.h: 154,
de include / xgboost / data.h: 10,
de src / data / sparse_page_raw_format.cc: 6:
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 450: 83: error: 'FILE_ std :: fopen (const char_, const char_)' debería haberse declarado dentro de 'std'
ARCHIVO _fopen64 (const char * restringir nombre de archivo, const char * restringir modo);
^
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 450: 83: error: 'FILE_ std :: fopen (const char_, const char_)' entra en conflicto con una declaración anterior
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 449: 17: nota: declaración anterior 'FILE * fopen (const char_, const char_)'
ARCHIVO _ cdecl fopen (const char * __restrict _Filename, const char * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
^
En archivo incluido de C: /TDM-GCC-64/x86_64-w64-mingw32/include/locale.h: 12: 0,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / clocale: 42 ,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / x86_64-w64-mingw32 / bits / c ++ locale.h: 41,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / bits / localefwd.h: 40,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / string: 43 ,
de dmlc-core / include / dmlc / base.h: 154,
de src / c_api /./ c_api_error.h: 9,
de src / c_api / c_api_error.cc: 6:
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 450: 83: error: 'FILE_ std :: fopen (const char_, const char_)' debería haberse declarado dentro de 'std'
ARCHIVO _fopen64 (const char * restringir nombre de archivo, const char * restringir modo);
^
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 450: 83: error: 'FILE_ std :: fopen (const char_, const char_)' entra en conflicto con una declaración anterior
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 449: 17: nota: declaración anterior 'FILE * fopen (const char_, const char_)'
ARCHIVO _ cdecl fopen (const char * __restrict _Filename, const char * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
^
En archivo incluido de C: /TDM-GCC-64/x86_64-w64-mingw32/include/locale.h: 12: 0,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / clocale: 42 ,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / x86_64-w64-mingw32 / bits / c ++ locale.h: 41,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / bits / localefwd.h: 40,
desde C: /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c ++ / string: 43 ,
de dmlc-core / include / dmlc / base.h: 154,
de include / xgboost / data.h: 10,
de src / c_api / c_api.cc: 3:
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 450: 83: error: 'FILE_ std :: fopen (const char_, const char_)' debería haberse declarado dentro de 'std'
ARCHIVO _fopen64 (const char * restringir nombre de archivo, const char * restringir modo);
^
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 450: 83: error: 'FILE_ std :: fopen (const char_, const char_)' entra en conflicto con una declaración anterior
C: /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h: 449: 17: nota: declaración anterior 'FILE * fopen (const char_, const char_)'
ARCHIVO _ cdecl fopen (const char * __restrict _Filename, const char * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
^
Makefile: 97 : la receta para el objetivo 'build / c_api / c_api_error.o' falló
mingw32-make: _ * [build / c_api / c_api_error.o] Error 1mingw32-make: * Esperando trabajos sin terminar ....Makefile: 97 : la receta para el objetivo 'build / data / simple_dmatrix.o' fallómingw32-make: * * [build / data / simple_dmatrix.o] Error 1
En el archivo incluido en dmlc-core / include / dmlc / data.h: 16: 0,
de include / xgboost / data.h: 11,
de src / data / sparse_page_raw_format.cc: 6:
dmlc-core / include / dmlc /./ registry.h: 218: 22: advertencia: 'xgboost :: data :: make_SparsePageFormat_raw *' definido pero no utilizado [-Wunused-variable]static EntryType & __make_ ## EntryTypeName ## _ ## Name ## __ =^src / data /./ sparse_batch_page.h: 250: 3: nota: en la expansión de la macro 'DMLC_REGISTRY_REGISTER'DMLC_REGISTRY_REGISTER (:: xgboost :: data :: SparsePageFormatReg, SparsePageFormat, Nombre)^src / data / sparse_page_raw_format.cc: 93: 1: nota: en expansión de macro 'XGBOOST_REGISTER_SPARSE_PAGE_FORMAT'XGBOOST_REGISTER_SPARSE_PAGE_FORMAT (sin procesar)^Makefile: 97 : la receta para el objetivo 'build / data / sparse_page_raw_format.o' fallómingw32-make: * * [build / data / sparse_page_raw_format.o] Error 1
src / c_api / c_api.cc: 739: 12: advertencia: 'XGBOOST_LINK_RABIT_C_API_' definido pero no utilizado [-Wunused-variable]
static int XGBOOST_LINK_RABIT_C_API_ = RabitLinkTag ();
^
Makefile: 97 : la receta para el objetivo 'build / c_api / c_api.o' falló
mingw32-make: *** [build / c_api / c_api.o] Error 1

Comentario más útil

@ziqilau @tqchen @JasonTianCHD @yanqingmen
Solucionado, solo clona el repositorio y luego realiza el pago en 9a48a40 hasta que lo arreglen, algo en las últimas confirmaciones debe haber arruinado la compilación:

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

¡Salud!

Todos 19 comentarios

¡¡Tengo el mismo problema!!

Tengo el mismo problema.

¡aquí igual!

mismo.......

Windows realmente no es una buena opción para hacer ml.

@ziqilau @tqchen @JasonTianCHD @yanqingmen
Solucionado, solo clona el repositorio y luego realiza el pago en 9a48a40 hasta que lo arreglen, algo en las últimas confirmaciones debe haber arruinado la compilación:

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

¡Salud!

Puedo confirmar que esto funciona por el momento. ¡Muchas gracias!

Sí, después de 2 días de jugar, ¡la solución de Cortajarena funcionó! ¡¡Muchas gracias!!

Gracias !! @Cortajarena

¡Gracias @Cortajarena !

Gracias @Cortajarena - ¡me salvaste el día! :-)

¡Gracias @Cortajarena!

_Sin embargo, cuando importé xgboost en jupyter nootbook, _

importar sistema operativo
mingw_path = "C: TDM-GCC-64bin"
os.environ ['RUTA'] = mingw_path + ';' + os.environ ['RUTA']
importar xgboost como xgb

_ Recibí un mensaje de error: _

OSError Traceback (última llamada más reciente)
en()
----> 1 importación xgboost como xgb

C: UsersLAnaconda3libsite-packagesxgboost-0.4-py3.5.eggxgboost__init __. Py en()
9 import os
10
---> 11 desde .core import DMatrix, Booster
12 de .training import train, cv
13 desde. importar rabit # noqa

C: UsersLAnaconda3libsite-packagesxgboost-0.4-py3.5.eggxgboostcore.py en()
110
111 # cargar la biblioteca XGBoost globalmente
-> 112 _LIB = _load_lib ()
113
114

C: UsersLAnaconda3libsite-packagesxgboost-0.4-py3.5.eggxgboostcore.py en _load_lib ()
104 si len (lib_path) == 0:
105 volver Ninguno
-> 106 lib = ctypes.cdll.LoadLibrary (lib_path [0])
107 lib.XGBGetLastError.restype = ctypes.c_char_p
108 volver lib

C: UsersLAnaconda3libctypes__init __. Py en LoadLibrary (self, name)
423
424 def LoadLibrary (yo, nombre):
-> 425 return self._dlltype (nombre)
426
427 cdll = Cargador de biblioteca (CDLL)

C: UsersLAnaconda3libctypes__init __. Py en init (self, name, mode, handle, use_errno, use_last_error)
345
346 si el identificador es Ninguno:
-> 347 self._handle = _dlopen (self._name, modo)
348 más:
349 self._handle = manejar

OSError: [WinError 1114] Error en la rutina de inicialización de una biblioteca de vínculos dinámicos (DLL).

¿Alguien tuvo el mismo problema? ¿Como arreglarlo?

¡Gracias @Cortajarena por el
¿Alguien más está recibiendo un error posterior de que la "Biblioteca XGBoost no se puede encontrar en la ruta del candidato"?
Estoy usando Anaconda 4.0.0 con Python 3.5.1 en Windows7.
Los siguientes comandos funcionaron bien:

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

Cuando volví a Anaconda Prompt, me redirigí a la carpeta python-packages e intenté:

python setup.py install

Recibí el error de que no se pudo encontrar la biblioteca y proporciona una lista de candidatos.
¿Ideas sobre cómo solucionarlo?

@lrvenable

Después de seguir los pasos que nombró, escriba:

cd python-package

Luego estará dentro del directorio del paquete de Python (dentro de la carpeta xgboost del repositorio que ya ha clonado).
Luego escribe esto en la consola:

python setup.py install

¡Asegúrese de usar el bit bash en lugar del símbolo del sistema de Windows!
¡Salud!

@Cortajarena eres un salvador absoluto. ¡muchas muchas gracias!

que solucionó el problema para mí (Win7 64Bit, mingw-w64):

... dmlc-coreincludedmlcbase.h línea 110 ++ (confirme https://github.com/dmlc/xgboost/commit/75d9be55de7e13a0075b4422c37a74f7b39600b1)

si! definido ( GNUC )

definir fopen64 std :: fopen NOTA: eliminar "std ::"

terminara si

si (definido MINGW32 ) || (definido MINGW64 )

definir fopen64 std :: fopen NOTA: eliminar "std ::"

terminara si

=>

si! definido ( GNUC )

definir fopen64 fopen

terminara si

si (definido MINGW32 ) || (definido MINGW64 )

definir fopen64 fopen

terminara si

Se solucionó el problema ascendente y se actualizó la referencia a dmlc-core # 1408. Sugeriría que alguien cierre este problema, para que la gente no siga instalando la versión del código del 5 de junio.

Estaba construyendo el paquete R en Windows 7. El último paquete xgboost de CRAN no se compiló.

La solución de @ Far0n funcionó para mí.

@Cortajarena @lrvenable

lo entiendo

 $ python setup.py install
 Traceback (most recent call last):
   File "setup.py", line 19, in <module>
     LIB_PATH = libpath['find_lib_path']()
   File "xgboost/libpath.py", line 45, in find_lib_path
     'List of candidates:\n' + ('\n'.join(dll_path)))
 XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
 List of candidates:
 ~/xgboost/xgboost/python-package/xgboost/libxgboost.so
 ~/xgboost/xgboost/python-package/xgboost/../../lib/libxgboost.so
 ~/xgboost/xgboost/python-package/xgboost/./lib/libxgboost.so
¿Fue útil esta página
0 / 5 - 0 calificaciones

Temas relacionados

frankzhangrui picture frankzhangrui  ·  3Comentarios

nnorton24 picture nnorton24  ·  3Comentarios

choushishi picture choushishi  ·  3Comentarios

vkuznet picture vkuznet  ·  3Comentarios

wenbo5565 picture wenbo5565  ·  3Comentarios