redpony / cdec

Decoder, aligner, and model optimizer for statistical machine translation and other structured prediction models based on (mostly) context-free formalisms
http://cdec-decoder.org/
Apache License 2.0
183 stars 77 forks source link

Building pycdec fails #85

Open jonsafari opened 8 years ago

jonsafari commented 8 years ago

$ python setup.py.in build running build running build_py running build_ext building 'cdec._cdec' extension x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I.. -Icdec/ -I../decoder -I../utils -I../mteval -I/usr/include/python2.7 -c cdec/_cdec.cpp -o build/temp.linux-x86_64-2.7/cdec/_cdec.o -std=c++11 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cdec/_cdec.cpp: In function ‘PyObject* pyx_pf_4cdec_5_cdec_11DenseVector_6getitem(**pyx_obj_4cdec_5_cdecDenseVector, char_)’: cdec/_cdec.cpp:3092:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pyx_t_1 = (pyx_v_fid < pyx_v_self->vector->size()); ^ cdec/_cdec.cpp: In function ‘int pyx_pf_4cdec_5_cdec_11DenseVector_8setitem(pyx_obj_4cdec_5_cdecDenseVector, char_, float)’: cdec/_cdec.cpp:3243:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pyx_t_1 = ((pyx_v_self->vector->size() <= pyx_v_fid) != 0); ^ cdec/_cdec.cpp: In function ‘PyObject* pyx_gb_4cdec_5_cdec_7Grammar_4generator3(pyxGeneratorObject, PyObject_)’: cdec/_cdec.cpp:9501:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (pyx_t_2 = 0; pyx_t_2 < pyx_t_1; pyx_t_2+=1) { ^ cdec/_cdec.cpp: In function ‘PyObject* pyx_pf_4cdec_5_cdec_7Lattice_6getitem(pyx_obj_4cdec_5_cdec_Lattice*, int)’: cdec/_cdec.cpp:16403:49: error: ‘struct LatticeArc’ has no member named ‘cost’ pyx_t_4 = PyFloat_FromDouble(pyx_v_arc->cost); if (unlikely(!pyx_t_4)) {pyx_filename = __pyx_f[4]; pyx_lineno = 34; pyx_clineno = __LINE; goto pyx_L1_error;} ^ cdec/_cdec.cpp: In function ‘int pyx_pf_4cdec_5_cdec_7Lattice_8setitem(pyx_obj_4cdec_5_cdecLattice, int, PyObject_)’: cdec/_cdec.cpp:16658:81: error: no matching function for call to ‘LatticeArc::LatticeArc(WordID, double&, int&)’ pyx_v_arc = new LatticeArc(TD::Convert(pyx_t_11), pyx_t_12, __pyx_t_13); ^ cdec/_cdec.cpp:16658:81: note: candidates are: In file included from ../decoder/grammar.h:13:0, from cdec/_cdec.cpp:251: ../decoder/lattice.h:22:3: note: LatticeArc::LatticeArc(WordID, const FastSparseVector&, int) LatticeArc(WordID w, const SparseVector& f, int i) : label(w), features(f), dist2next(i) {} ^ ../decoder/lattice.h:22:3: note: no known conversion for argument 2 from ‘double’ to ‘const FastSparseVector&’ ../decoder/lattice.h:21:3: note: LatticeArc::LatticeArc() LatticeArc() : label(), features(), dist2next() {} ^ ../decoder/lattice.h:21:3: note: candidate expects 0 arguments, 3 provided ../decoder/lattice.h:17:8: note: LatticeArc::LatticeArc(const LatticeArc&) struct LatticeArc { ^ ../decoder/lattice.h:17:8: note: candidate expects 1 argument, 3 provided ../decoder/lattice.h:17:8: note: LatticeArc::LatticeArc(LatticeArc&&) ../decoder/lattice.h:17:8: note: candidate expects 1 argument, 3 provided cdec/_cdec.cpp: In function ‘PyObject* pyx_pf_4cdec_5_cdec_12CandidateSet_6getitem*(__pyx_obj_4cdec_5_cdec_CandidateSet, int)’: cdec/_cdec.cpp:19128:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pyx_t_1 = (pyx_v_k < __pyx_v_self->cs->size()); ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

$ gcc --version gcc (Debian 4.9.2-10) 4.9.2 $ cat /etc/debian_version 8.2

FWIW, I manually added -std=c++11 to CPPFLAGS

jonsafari commented 8 years ago

It appears to involve commit c7b2a39958912d7b85a384a871609e6db73042c7 .