加载包org.renjin.cran时的IOException:rgeos:无法在包'rgeos'中解析本机方法'rgeos_Init'

时间:2018-02-22 07:05:35

标签: java r renjin

嗨,我是R语言和人人新手。在我的项目中,添加了maven依赖项。

<dependency>
        <groupId>org.renjin.cran</groupId>
        <artifactId>rgeos</artifactId>
        <version>0.3-2-b24</version>
    </dependency>

我添加了上面的依赖项。我也尝试了不同的和最新版本的rgeos依赖。

我在代码中将rgeos包作为engine.eval(“library(rgeos)”); 在java中加载此包时,我收到的错误

org.renjin.eval.EvalException: IOException while loading package org.renjin.cran:rgeos: Could not resolve native method 'rgeos_Init' in package 'rgeos'
    at org.renjin.primitives.packaging.NamespaceRegistry.tryLoad(NamespaceRegistry.java:215)
    at org.renjin.primitives.packaging.NamespaceRegistry.tryGetNamespace(NamespaceRegistry.java:168)
    at org.renjin.primitives.packaging.NamespaceRegistry.getNamespace(NamespaceRegistry.java:130)
    at org.renjin.primitives.packaging.NamespaceRegistry.getNamespace(NamespaceRegistry.java:98)
    at org.renjin.primitives.packaging.Packages.library(Packages.java:40)
    at org.renjin.primitives.R$primitive$library.doApply(R$primitive$library.java:73)
    at org.renjin.primitives.R$primitive$library.apply(R$primitive$library.java:34)
    at org.renjin.primitives.special.InternalFunction.apply(InternalFunction.java:45)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:38)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.eval.Context.evaluate(Context.java:198)
    at org.renjin.sexp.Closure.doApply(Closure.java:98)
    at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
    at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
    at org.renjin.sexp.Closure.apply(Closure.java:83)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.eval.Context.evaluateExpressionVector(Context.java:390)
    at org.renjin.eval.Context.evaluate(Context.java:280)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.script.RenjinScriptEngine.eval(RenjinScriptEngine.java:168)
    at org.renjin.script.RenjinScriptEngine.eval(RenjinScriptEngine.java:127)
    at com.nact.Test.main(Test.java:21)
Caused by: org.renjin.eval.EvalException: Could not resolve native method 'rgeos_Init' in package 'rgeos'
    at org.renjin.primitives.Native.findMethodByName(Native.java:572)
    at org.renjin.primitives.Native.findMethod(Native.java:545)
    at org.renjin.primitives.Native.redotCall(Native.java:364)
    at org.renjin.primitives.R$primitive$$Call.apply(R$primitive$$Call.java:62)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:38)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.eval.Context.evaluate(Context.java:198)
    at org.renjin.sexp.Closure.doApply(Closure.java:98)
    at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
    at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
    at org.renjin.sexp.Closure.apply(Closure.java:83)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.sexp.Promise.doEval(Promise.java:92)
    at org.renjin.sexp.Promise.force(Promise.java:86)
    at org.renjin.eval.Context.evaluateSymbol(Context.java:345)
    at org.renjin.eval.Context.evaluate(Context.java:278)
    at org.renjin.sexp.Promise.doEval(Promise.java:92)
    at org.renjin.sexp.Promise.force(Promise.java:86)
    at org.renjin.eval.Context.evaluateSymbol(Context.java:345)
    at org.renjin.eval.Context.evaluate(Context.java:278)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.invoke.codegen.ArgumentIterator.evalNext(ArgumentIterator.java:70)
    at org.renjin.primitives.R$primitive$assign.apply(R$primitive$assign.java:30)
    at org.renjin.primitives.special.InternalFunction.apply(InternalFunction.java:45)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.eval.Context.evaluate(Context.java:198)
    at org.renjin.sexp.Closure.doApply(Closure.java:98)
    at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
    at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
    at org.renjin.sexp.Closure.apply(Closure.java:83)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:38)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.eval.Context.evaluate(Context.java:198)
    at org.renjin.sexp.Closure.doApply(Closure.java:98)
    at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
    at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
    at org.renjin.sexp.Closure.apply(Closure.java:83)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:38)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.eval.Context.evaluate(Context.java:198)
    at org.renjin.sexp.Closure.doApply(Closure.java:98)
    at org.renjin.eval.ClosureDispatcher.apply(ClosureDispatcher.java:80)
    at org.renjin.eval.ClosureDispatcher.applyClosure(ClosureDispatcher.java:51)
    at org.renjin.sexp.Closure.apply(Closure.java:83)
    at org.renjin.eval.Context.evaluateCall(Context.java:407)
    at org.renjin.eval.Context.evaluate(Context.java:282)
    at org.renjin.eval.Context.evaluate(Context.java:264)
    at org.renjin.primitives.packaging.NamespaceRegistry.tryLoad(NamespaceRegistry.java:198)
    ... 28 more

1 个答案:

答案 0 :(得分:0)

您可以在packages.renjin.org上查看软件包的状态。在这里,您可以搜索 rgeos 包,这将使您感到rgeos package page

在包页面上,您可以看到状态显示:

  

这个软件包可以由Renjin加载,但编译C / FORTRAN源时出错,所有测试都失败了。此软件包的旧版本与Renjin更兼容。

如果向下滚动,可以看到所有测试当前都失败了。您可以单击“查看构建日志”或在其中一个失败的测试中查看失败的确切原因。在这种情况下,由于您遇到的原因相同,所有测试都失败了。

从页面顶部的构建日志,我发现构建不顺利,因为./configure步骤不成功:

  

检查/ usr / bin / svnversion ...没有   configure:error:找不到geos-config或不可执行。   configure:svn revision:560   检查geos-config ...没有   没有   [错误] GNU R源代码编译失败。   org.renjin.gcc.InternalCompilerException:无法执行./configure     在org.renjin.packaging.NativeSourceBuilder.configure(NativeSourceBuilder.java:97)

可能是因为我们的构建机器上缺少依赖项。在这种情况下,您可以尝试在本地构建此包。通过单击左下角按钮“ BUILD LOCALLY ”,它将为您提供一个可以在终端上粘贴和运行的链接。在这种情况下:

  

curl http://packages.renjin.org/package/org.renjin.cran/rgeos/0.3-26/build/4/rebuild.sh | SH

您可以在“构建日志”部分下方看到此链接。

如果您可以在本地构建,请告诉我们。我们对处理包中使用的configure和make文件有一定程度的支持。但是我们还没有支持在构建脚本中可以完成的所有操作, rgeos 有一个非常广泛的configure文件。