Date: Sat, 7 May 2016 22:44:31 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r414787 - in head/chinese/sunpinyin: . files Message-ID: <201605072244.u47MiVBT079509@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim (src committer) Date: Sat May 7 22:44:31 2016 New Revision: 414787 URL: https://svnweb.freebsd.org/changeset/ports/414787 Log: During the exp-run in bug 208158, it was found that chinese/sunpinyin gives errors with libc++ 3.8.0: gmake[2]: Entering directory '/wrkdirs/usr/ports/chinese/sunpinyin/work' slmpack lm_sc.3gm.arpa dict.utf8 lm_sc.3gm Loading lexicon...done. Loading ARPA slm... Writing out...done! slmthread lm_sc.3gm lm_sc.t3g.orig Loading original slm... first pass... Compressing pr values...65536 float values ==> 65536 values Compressing bow values...16384 float values ==> 16384 values Threading the new model...Assertion failed: (prit != pr_map.end()), function main, file src/slm/thread/slmthread.cpp, line 364. /wrkdirs/usr/ports/chinese/sunpinyin/work/sunpinyin-a8bd811/src/sunpinyin-dictgen.mk:51: recipe for target 'lm_sc.t3g.orig' failed This is because the code mostly uses floats, but in some parts it uses log(), exp(), etc, which return doubles. During the parts where it does lookups in std::map<float, int> constructs, this leads to it not being able to find the expected entries. Fix this by using logf(), expf() and similar, which explicitly return floats. Approved by: lichray@gmail.com (maintainer) PR: 209369 MFH: 2016Q2 Added: head/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp (contents, props changed) Modified: head/chinese/sunpinyin/Makefile Modified: head/chinese/sunpinyin/Makefile ============================================================================== --- head/chinese/sunpinyin/Makefile Sat May 7 21:22:41 2016 (r414786) +++ head/chinese/sunpinyin/Makefile Sat May 7 22:44:31 2016 (r414787) @@ -3,6 +3,7 @@ PORTNAME= sunpinyin DISTVERSION= 2.0.4rc3 +PORTREVISION= 1 CATEGORIES= chinese devel MASTER_SITES= GH:1 SF/open-gram:2 DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:1 \ Added: head/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp Sat May 7 22:44:31 2016 (r414787) @@ -0,0 +1,17 @@ +--- src/slm/thread/slmthread.cpp.orig 2014-11-14 14:17:48 UTC ++++ src/slm/thread/slmthread.cpp +@@ -250,10 +250,10 @@ main(int argc, char* argv[]) + + bool usingLogPr = slm.isUseLogPr(); + +- #define EffectivePr(a) (float((usingLogPr) ? ((a) / log(2.0)) : (-log2((a))))) +- #define OriginalPr(b) (float((usingLogPr) ? ((b) * log(2.0)) : (exp2(-(b))))) +- #define EffectiveBow(a) (float((usingLogPr) ? (exp(-(a))) : ((a)))) +- #define OriginalBow(b) (float((usingLogPr) ? (-log((b))) : ((b)))) ++ #define EffectivePr(a) (float((usingLogPr) ? ((a) / logf(2.0f)) : (-log2f((a))))) ++ #define OriginalPr(b) (float((usingLogPr) ? ((b) * logf(2.0f)) : (exp2f(-(b))))) ++ #define EffectiveBow(a) (float((usingLogPr) ? (expf(-(a))) : ((a)))) ++ #define OriginalBow(b) (float((usingLogPr) ? (-logf((b))) : ((b)))) + + printf("\nfirst pass..."); fflush(stdout); + for (int lvl = 0; lvl <= slm.getN(); ++lvl) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605072244.u47MiVBT079509>