GreatStuff660 / mitlm

Automatically exported from code.google.com/p/mitlm
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

build fails due to ambiguous call #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
$ make
……
libtool: compile:  g++ "-DPACKAGE_NAME=\"MIT Language Modeling Toolkit\"" 
-DPACKAGE_TARNAME=\"mitlm\" -DPACKAGE_VERSION=\"0.4.1\" "-DPACKAGE_STRING=\"MIT 
Language Modeling Toolkit 0.4.1\"" 
-DPACKAGE_BUGREPORT=\"mitlm-dev@googlegroups.com\" -DPACKAGE_URL=\"\" 
-DPACKAGE=\"mitlm\" -DVERSION=\"0.4.1\" "-DF77_FUNC(name,NAME)=name ## _" 
"-DF77_FUNC_(name,NAME)=name ## _" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 
-DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_STRING_H=1 -DHAVE_MATH_H=1 
-DSTDC_HEADERS=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_STDLIB_H=1 
-DHAVE_REALLOC=1 -I. -I./src -g -O2 -MT src/NgramModel.lo -MD -MP -MF 
src/.deps/NgramModel.Tpo -c src/NgramModel.cpp  -fno-common -DPIC -o 
src/.libs/NgramModel.o
src/NgramModel.cpp: In member function 'void 
mitlm::NgramModel::LoadLM(std::vector<mitlm::DenseVector<double>, 
std::allocator<mitlm::DenseVector<double> > >&, 
std::vector<mitlm::DenseVector<double>, 
std::allocator<mitlm::DenseVector<double> > >&, mitlm::ZFile&)':
src/NgramModel.cpp:325: error: call of overloaded 'pow(int, int)' is ambiguous
/usr/include/math.h:436: note: candidates are: double pow(double, double)
/usr/include/c++/4.2.1/cmath:357: note:                 float std::pow(float, 
float)
/usr/include/c++/4.2.1/cmath:361: note:                 long double 
std::pow(long double, long double)
/usr/include/c++/4.2.1/cmath:365: note:                 double std::pow(double, 
int)
/usr/include/c++/4.2.1/cmath:369: note:                 float std::pow(float, 
int)
/usr/include/c++/4.2.1/cmath:373: note:                 long double 
std::pow(long double, int)
make[1]: *** [src/NgramModel.lo] Error 1
make: *** [all-recursive] Error 1
$

I did in this way.
325c325
<                     assert(prob <= std::pow(10, -99));

---
>                     assert(prob <= std::pow(10.0, -99));

Original issue reported on code.google.com by mamadontgodaddycomehome on 21 Nov 2013 at 10:52

GoogleCodeExporter commented 9 years ago
Thank you very much for this report.
I was not able to reproduce this issue, however the fix seems obvious, so the 
issue is now fixed in revision r120.

Original comment by giuliop...@gmail.com on 21 Nov 2013 at 1:28

GoogleCodeExporter commented 9 years ago

Original comment by giuliop...@gmail.com on 21 Nov 2013 at 1:29

GoogleCodeExporter commented 9 years ago
I had this same issue (using a Mac with OS X 10.9 Mavericks). Following what 
@mamadontgodaddycomehome suggested fixed the issue for me too.

Thanks.

Original comment by andy...@gmail.com on 19 Mar 2014 at 8:07