Skip to content

Commit e66daaf

Browse files
committed
[GR-22740] Print user friendly message when loading of a package via LLVM fails
(cherry picked from commit 1c78e2b)
1 parent 72868a7 commit e66daaf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_DLL.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.oracle.truffle.api.nodes.Node;
3737
import com.oracle.truffle.api.source.Source;
3838
import com.oracle.truffle.r.runtime.DSLConfig;
39+
import com.oracle.truffle.r.runtime.REnvVars;
3940
import com.oracle.truffle.r.runtime.RError;
4041
import com.oracle.truffle.r.runtime.RError.Message;
4142
import com.oracle.truffle.r.runtime.RInternalError;
@@ -96,6 +97,13 @@ static LibHandle dlOpen(RContext context, String path) {
9697
} catch (UnknownIdentifierException e) {
9798
CompilerDirectives.transferToInterpreter();
9899
throw RError.error(RError.NO_CALLER, Message.GENERIC, "Could not find function 'Rdynload_setSymbol' in libR on path: " + path);
100+
} catch (Throwable e) {
101+
RError.warning(RError.NO_CALLER, Message.GENERIC, String.format(
102+
"Loading of '%s' in LLVM mode failed. " +
103+
"You may load this package via the native mode by adding it to %s/etc/native-packages " +
104+
"or by running FastR with option --R.BackEndNative=packageName.",
105+
path, REnvVars.rHome(RContext.getInstance())));
106+
throw e;
99107
} finally {
100108
if (!isInitialization) {
101109
stateRFFI.afterDowncall(before, Type.LLVM);

0 commit comments

Comments
 (0)