1

嗨,我是 R 语言和 renjin 的新手。在我的项目中,以下是添加的 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
4

1 回答 1

0

您可以在 packages.renjin.org 上查看包的状态。在这里你可以搜索你的包rgeos,它会告诉你rgeos 包页面

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

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

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

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

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

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

卷曲http://packages.renjin.org/package/org.renjin.cran/rgeos/0.3-26/build/4/rebuild.sh | 嘘

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

请让我们知道您是否可以在本地构建它。我们对处理包中使用的配置和制作文件有一定程度的支持。但是我们还不支持所有可以在构建脚本中完成的操作,并且rgeos有一个相当广泛的配置文件。

于 2018-02-23T09:57:47.410 回答