From owner-svn-ports-head@freebsd.org Sat May 7 22:44:32 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5181B31AC2; Sat, 7 May 2016 22:44:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6474D1E8F; Sat, 7 May 2016 22:44:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u47MiVqt079511; Sat, 7 May 2016 22:44:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u47MiVBT079509; Sat, 7 May 2016 22:44:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605072244.u47MiVBT079509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 7 May 2016 22:44:31 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r414787 - in head/chinese/sunpinyin: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 22:44:32 -0000 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 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) {