Open Alexander-Barth opened 8 months ago
In fact, on Ubuntu libsuitesparseconfig5
is not a dependency of R. If I remove it, I can use julia 1.10 and R together.
It seems that the issue is that R sets its LD_LIBRARY_PATH
(probably here):
$ echo $LD_LIBRARY_PATH
abarth@work:~
$ R -q
> Sys.getenv("LD_LIBRARY_PATH")
[1] "/usr/lib/R/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/jvm/default-java/lib/server"
>
Probably any library installed in these paths will shadow a julia library of the same name.
The somewhat bizarre work-around is to add the julia library directory to R_LD_LIBRARY_PATH
which works even when there is a libsuitesparseconfig5
installed.
$ export R_LD_LIBRARY_PATH="/mnt/data1/abarth/opt/julia-1.10.0/lib/julia/:/usr/lib/R/lib:/usr/lib/x86_64-linux-gnu"
abarth@work:~
$ R -q
> library(JuliaCall)
> julia_setup()
Julia version 1.10.0 at location /mnt/data1/abarth/opt/julia-1.10.0/bin will be used.
Loading setup script for JuliaCall...
Finish loading setup script for JuliaCall.
Setting alias julia='LD_LIBRARY_PATH=" " julia' seems to have solved the problem. But how can I set this configuration in VSCODE? It would be great if anyone can inform me.
$ export R_LD_LIBRARY_PATH="/mnt/data1/abarth/opt/julia-1.10.0/lib/julia/:/usr/lib/R/lib:/usr/lib/x86_64-linux-gnu"
This idea works but it creates problems when R tries to use the slightly different libraries bundled with julia instead of it's own.
>options(help_type='html')
>?julia_source
starting httpd help server ...Error in startDynamicHelp(TRUE) : internet routines cannot be loaded
In addition: Warning message:
In startDynamicHelp(TRUE) :
unable to load shared object '/usr/lib/R/modules//internet.so':
/home/aavogt/.julia/juliaup/julia-1.10.4+0.x64.linux.gnu/lib/julia/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by /usr/lib/R/modules//internet.so)
I am trying to install JuliaCall with R 4.1.2 and julia 1.10.0. Unfortunately the installation fails due to
SuiteSparse
. R (on Ubuntu 22.04) uses suite sparse config version 5.10 however (/usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so.5
) however julia 1.10 is bundeld with version 7.2.1 (<julia-installation>/lib/julia/libsuitesparseconfig.so.7.2.1
).This produces the following error:
In the past, I could resolve similar issues by setting LD_PRELOAD or LD_LIBRARY_PATH forcing the loading of the newer library, for example:
before starting R. But I get the same error as above (
/usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so.5: undefined symbol: SuiteSparse_config_malloc_func_set
).I don't have these issues with julia 1.6.2 as both use the same version of this library.
Any ideas how this issue can be resolved (besides rebuilding R with the same libraries as Julia)?
Thank you very much for this nice package and your efforts to bridge the R and Julia communities 😀
Session Info
``` > sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 22.04.3 LTS Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 [9] LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8 [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] JuliaCall_0.17.5 loaded via a namespace (and not attached): [1] compiler_4.1.2 tools_4.1.2 Rcpp_1.0.12 knitr_1.45 xfun_0.41 ```