You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@joshua.apache.org by "Kellen Sunderland (JIRA)" <ji...@apache.org> on 2016/07/28 15:43:20 UTC

[jira] [Comment Edited] (JOSHUA-287) KenLM.java catches UnsatisfiedLinkError when attempting to load libken.so (libken.dylib on OSX)

    [ https://issues.apache.org/jira/browse/JOSHUA-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15397701#comment-15397701 ] 

Kellen Sunderland edited comment on JOSHUA-287 at 7/28/16 3:42 PM:
-------------------------------------------------------------------

I should have addressed this in my latest PR.  https://github.com/apache/incubator-joshua/pull/33

I think the correct behaviour is to throw a RuntimeException here.  There are two environments to consider, testing, and the general case. At test time my feeling is that if a user doesn't have libkenlm we should simply skip any tests that rely on KenLM.  We shouldn't force users to download/compile KenLM just to run unit tests.  In general if we make a call into the KenLM class and the library is not on our java.library.path it's a serious error.  We should throw a descriptive exception (now a KenLMLoadException which extends Runtime) and let the caller deal with it.  

Can you provide some details on how this breaks Sonar?  Is it still broken after the PR?


was (Author: kellen.sunderland):
I should have addressed this in my latest PR.  https://github.com/apache/incubator-joshua/pull/33

I think the correct behaviour is to throw a RuntimeException here.  There are two environments to consider, testing, and the general case. At test time my feeling is that we should simply skip any tests that rely on KenLM.  We shouldn't force users to download/compile KenLM just to run unit tests.  In general if we make a call into the KenLM class and the library is not on our java.library.path it's a serious error.  We should throw a descriptive exception (now a KenLMLoadException which extends Runtime) and let the caller deal with it.  

Can you provide some details on how this breaks Sonar?  Is it still broken after the PR?

> KenLM.java catches UnsatisfiedLinkError when attempting to load libken.so (libken.dylib on OSX)
> -----------------------------------------------------------------------------------------------
>
>                 Key: JOSHUA-287
>                 URL: https://issues.apache.org/jira/browse/JOSHUA-287
>             Project: Joshua
>          Issue Type: Bug
>          Components: core, kenlm
>    Affects Versions: 6.0.5
>            Reporter: Lewis John McGibbney
>             Fix For: 6.1
>
>
> As explained in http://www.mail-archive.com/dev%40joshua.incubator.apache.org/msg01189.html currently we have an issue, where, when checked out from master the following RuntimeException is thrown.
> {code}
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running TestSuite
> WARN - sentence 0 too long 401, truncating to length 200
> WARN - sentence 0 too long 401, truncating to length 200
> WARN - sentence 0 too long 401, truncating to length 200
> WARN - sentence 0 too long 401, truncating to length 200
> tm_pt_0=-2.000 tm_glue_0=3.000 lm_0=-206.718 lm_0_oov=2.000 OOVPenalty=-200.000 | -198.000
> ERROR - * FATAL: Can't find libken.so (libken.dylib on OS X) in $JOSHUA/lib
> ERROR - *        This probably means that the KenLM library didn't compile.
> ERROR - *        Make sure that BOOST_ROOT is set to the root of your boost
> ERROR - *        installation (it's not /opt/local/, the default), change to
> ERROR - *        $JOSHUA, and type 'ant kenlm'. If problems persist, see the
> ERROR - *        website (joshua-decoder.org).
> WARN - no grammars supplied!  Supplying dummy glue grammar.
> WARN - no grammars supplied!  Supplying dummy glue grammar.
> WARN - no grammars supplied!  Supplying dummy glue grammar.
> WARN - no grammars supplied!  Supplying dummy glue grammar.
> WARN - no grammars supplied!  Supplying dummy glue grammar.
> WARN - no grammars supplied!  Supplying dummy glue grammar.
> WARN - no grammars supplied!  Supplying dummy glue grammar.
> WARN - no grammars supplied!  Supplying dummy glue grammar.
> {code}
> We need to fix this such that we can run static source code analysis via sonar and have our results available on analysis.apache.org.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)