Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XGBoost build error #12

Open
mchonofsky opened this issue Jan 19, 2023 · 0 comments
Open

XGBoost build error #12

mchonofsky opened this issue Jan 19, 2023 · 0 comments

Comments

@mchonofsky
Copy link

Description

I'm having issues installing xgboost-node

Platform, Node.js version and C++ compiler version

$ sudo hostnamectl | tail -n 3
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 5.10.142-19743-gd301e86c39f7
      Architecture: x86-64
$ node --version
v18.12.1
$ g++ --version
g++ (Debian 8.3.0-6) 8.3.0

Steps to reproduce this issue

CXXFLAGS="--std=c++14" npm install --user xgboost gives a bunch of errors that begin

npm ERR! done building library
npm ERR! make: Entering directory '/home/mchonofsky/traintracker/heroku/amtrak-lol/node_modules/xgboost/build'
npm ERR!   CXX(target) Release/obj.target/xgboost/src/index.o
npm ERR!   CXX(target) Release/obj.target/xgboost/src/xgmodel.o
npm ERR! make: Leaving directory '/home/mchonofsky/traintracker/heroku/amtrak-lol/node_modules/xgboost/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@18.12.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/mchonofsky/traintracker/heroku/amtrak-lol/node_modules/xgboost/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/mchonofsky/.cache/node-gyp/18.12.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/mchonofsky/.cache/node-gyp/18.12.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/mchonofsky/.cache/node-gyp/18.12.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/mchonofsky/traintracker/heroku/amtrak-lol/node_modules/xgboost',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/base.h:4,
npm ERR!                  from ../src/xgmatrix.h:4,
npm ERR!                  from ../src/index.cc:1:
npm ERR! /home/mchonofsky/.cache/node-gyp/18.12.1/include/node/node.h:976:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
npm ERR!        (node::addon_register_func) (regfunc),                          \
npm ERR!                                            ^
npm ERR! /home/mchonofsky/.cache/node-gyp/18.12.1/include/node/node.h:1010:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR!    NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!    ^~~~~~~~~~~~~
npm ERR! ../src/index.cc:10:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR!  NODE_MODULE(xgboost, InitAll)
npm ERR!  ^~~~~~~~~~~
npm ERR! ../src/xgmodel.cc: In static member function ‘static void XGModel::Init(v8::Local<v8::Object>)’:
npm ERR! ../src/xgmodel.cc:31:38: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
npm ERR!    constructor.Reset(tpl->GetFunction());

Any ideas on how to fix the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant