Replies: 3 comments 11 replies
-
I assume the attached text file is an example? You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
-
Hmm, when I tried to include this in-line before I got a previewing error. Must have been doing something slightly wrong. ---
author: "Ben Bolker"
title: "R/Julia mixed model comparison"
engine: julia
execute:
env:
- "LD_LIBRARY_PATH=/usr/local/lib/R/lib"
---
'execute:env' was recommended by Claude but maybe that was a hallucination?
```{julia}
readdir("/usr/local/lib/R/lib")
```
```{julia}
using RCall
```
```{julia}
print(1+1)
```
If I try to include an R chunk like this:
```{r}
set.seed(101)
rnorm(10)
```
I get this error:
```
EvaluationError: Encountered 1 error during evaluation
Error 1 of 1
@ /home/bolker/Documents/projects/SMLP2025/rcall.qmd:15
LoadError: could not load library "/usr/local/lib/R/lib/libR.so"
libRblas.so: cannot open shared object file: No such file or directory
in expression starting at /home/bolker/Documents/projects/SMLP2025/rcall.qmd:17
```
```{julia}
ld_library_path = get(ENV, "LD_LIBRARY_PATH", "missing")
println("LD_LIBRARY_PATH = $ld_library_path")
```
|
Beta Was this translation helpful? Give feedback.
-
I've got a solution for now (see below) but have followed up the discussion (i.e., hoping for more documentation) at PumasAI/QuartoNotebookRunner.jl#331 Thanks for the help. The solution as mentioned in PumasAI/QuartoNotebookRunner.jl#217 seems to be to include the environment variables in the YAML front matter as follows:
This works in the (much simpler) test case: ---
author: "Ben Bolker"
title: "julia environment test"
engine: julia
julia:
env: ["LD_LIBRARY_PATH=/usr/local/lib/R/lib"]
---
```{julia}
ld_library_path = get(ENV, "LD_LIBRARY_PATH", "missing")
println("LD_LIBRARY_PATH = $ld_library_path")
``` That thread suggested that variables defined in
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm trying to write (and render) a Quarto document that includes and compares Julia and R computations. I'm using the newer
julia
engine, which (as I understand it) renders the Julia code natively and callsRCall
to execute the R code.Any advice on diagnostics, troubleshooting, etc. (including "take this to forum XXX instead") welcome.
My R installation is in a non-standard place, so I need to set
LD_LIBRARY_PATH
before trying to render/preview. However, despite setting that environment variable in the shell before callingquarto xxx
, I get an error saying thatRCall
/quarto
can't find the appropriate libraries. The full details are in the attached quarto file (which I attached rather than including directly because I was getting rendering errors, and renamed to.txt
so GitHub would accept it), but here's the basic idea.(in shell)
The first chunk checks the load library path and finds it missing:
This returns
LD_LIBRARY_PATH = missing
(sigh).The next chunk checks the contents of the library directory:
I then get errors either when I try to load
RCall
or when I try to evaluate the first R chunk(Julia)
(R)
(I've tried a lot of different permutations. The attached
.qmd
file might have the chunks in a different order. Any chunks that fail prevent me from getting rendered output ...The error is something like this:
Quarto version 1.7.32, Julia 1.11.6, Ubuntu 24.04.3 LTS, R (unstable) (2025-08-10 r88559)
rcall.txt
Beta Was this translation helpful? Give feedback.
All reactions