Hi
I'm trying to install the latest version using pip install git+https://github.com/mwydmuch/napkinXC.git
, which gives the following compilation error:
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp: In function ‘void solve_l2r_lr_dual(const problem*, float*, float, float, float, int)’:
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:1335:29: error: no matching function for call to ‘max(float&, double)’
Gmax = max(Gmax, fabs(gp));
Thanks for your time.
PS:
The full error message is:
ERROR: Command errored out with exit status 1:
command: /home/cloud-user/code/diverse-xml/.venv/bin/python3.8 /home/cloud-user/code/diverse-xml/.venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmphqbldjxt
cwd: /tmp/pip-req-build-hszug3a8
Complete output (149 lines):
running bdist_wheel
running build
running build_py
-- downloading/updating pybind11
-- pybind11 directory found, pulling...
From https://github.com/pybind/pybind11
* branch master -> FETCH_HEAD
--
fatal: A branch named 'tag_v2.6.2' already exists.
CMake Warning at GitUtils.cmake:251 (message):
pybind11 some error happens.
Call Stack (most recent call first):
CMakeLists.txt:92 (git_clone)
-- pybind11 v2.9.0 dev1
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-req-build-hszug3a8/build
[ 3%] Building C object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/liblinear/blas/axpy.c.o
[ 7%] Building CXX object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/args.cpp.o
[ 10%] Building CXX object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/base.cpp.o
[ 14%] Building C object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/liblinear/blas/dot.c.o
[ 17%] Building C object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/liblinear/blas/nrm2.c.o
[ 21%] Building C object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/liblinear/blas/scal.c.o
[ 25%] Building CXX object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/liblinear/linear.cpp.o
[ 28%] Building CXX object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/liblinear/tron.cpp.o
[ 32%] Building CXX object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/log.cpp.o
[ 35%] Building CXX object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/main.cpp.o
[ 39%] Building CXX object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/measure.cpp.o
[ 42%] Building CXX object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/misc.cpp.o
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp: In function ‘void solve_l2r_lr_dual(const problem*, float*, float, float, float, int)’:
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:1335:29: error: no matching function for call to ‘max(float&, double)’
Gmax = max(Gmax, fabs(gp));
^
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:16:36: note: candidate: template<class T> T max(T, T)
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
^
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:16:36: note: template argument deduction/substitution failed:
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:1335:29: note: deduced conflicting types for parameter ‘T’ (‘float’ and ‘double’)
Gmax = max(Gmax, fabs(gp));
^
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp: In function ‘float calc_max_p(const problem*, const parameter*)’:
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:2363:38: error: no matching function for call to ‘max(float&, double)’
max_p = max(max_p, fabs(prob->y[i]));
^
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:16:36: note: candidate: template<class T> T max(T, T)
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
^
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:16:36: note: template argument deduction/substitution failed:
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:2363:38: note: deduced conflicting types for parameter ‘T’ (‘float’ and ‘double’)
max_p = max(max_p, fabs(prob->y[i]));
^
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp: In function ‘model* load_model(const char*)’:
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:3022:35: warning: format ‘%lf’ expects argument of type ‘double*’, but argument 3 has type ‘float*’ [-Wformat=]
if (fscanf(_stream, _format, _var) != 1)\
^
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:3098:4: note: in expansion of macro ‘FSCANF’
FSCANF(fp,"%lf",&bias);
^
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:3022:35: warning: format ‘%lf’ expects argument of type ‘double*’, but argument 3 has type ‘float*’ [-Wformat=]
if (fscanf(_stream, _format, _var) != 1)\
^
/tmp/pip-req-build-hszug3a8/src/liblinear/linear.cpp:3136:4: note: in expansion of macro ‘FSCANF’
FSCANF(fp, "%lf ", &model_->w[i*nr_w+j]);
^
[ 46%] Building CXX object python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/model.cpp.o
python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/build.make:159: recipe for target 'python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/liblinear/linear.cpp.o' failed
make[2]: *** [python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/liblinear/linear.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /tmp/pip-req-build-hszug3a8/src/base.h:34:0,
from /tmp/pip-req-build-hszug3a8/src/base.cpp:27:
/tmp/pip-req-build-hszug3a8/src/vector.h:216:25: warning: inline function ‘virtual Real AbstractVector::at(int) const’ used but never defined
virtual inline Real at(int index) const = 0;
^
/tmp/pip-req-build-hszug3a8/src/vector.h:217:26: warning: inline function ‘virtual Real& AbstractVector::operator[](int)’ used but never defined
virtual inline Real& operator[](int index) = 0;
^
In file included from /tmp/pip-req-build-hszug3a8/src/misc.h:35:0,
from /tmp/pip-req-build-hszug3a8/src/misc.cpp:30:
/tmp/pip-req-build-hszug3a8/src/matrix.h: In instantiation of ‘void RMatrix<T>::appendRow(const U&, bool) [with U = std::vector<IVPair<float> >; T = SparseVector]’:
/tmp/pip-req-build-hszug3a8/src/misc.cpp:96:35: required from here
/tmp/pip-req-build-hszug3a8/src/matrix.h:38:44: error: invalid initialization of non-const reference of type ‘SparseVector&’ from an rvalue of type ‘void’
T& row = r.emplace_back(vec, sorted);
^
python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/build.make:229: recipe for target 'python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/misc.cpp.o' failed
make[2]: *** [python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/__/__/__/src/misc.cpp.o] Error 1
CMakeFiles/Makefile2:145: recipe for target 'python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/all' failed
make[1]: *** [python/napkinxc/_napkinxc/CMakeFiles/pynxc.dir/all] Error 2
Makefile:135: recipe for target 'all' failed