Issues with rgeneric model

281 views
Skip to first unread message

Olivier Supplisson

unread,
Nov 20, 2023, 3:21:03 PM11/20/23
to R-inla discussion group
Hi, 

I was giving a try to the INLAMSM package (https://doi.org/10.48550/arXiv.1909.10804) on an HPC and went across the following issue: the rgeneric model crashes the inla call and then the R session. 

The issue does not seem to be related to the INLAMSM package per se because the example from https://inla.r-inla-download.org/r-inla.org/doc/latent/rgeneric-example.R also crashes the inla() call.

The issue replicates on three different HPCs (all with different OS). On all three HPCs, the R-INLA package is (I believe) correctly installed (i.e., when needed I used inla.binary.install(), basic examples from the website and from the doc are working without issues). 

On my Windows laptop (R4.3.2, R-INLA working well usually) the example from https://inla.r-inla-download.org/r-inla.org/doc/latent/rgeneric-example.R works well with verbose = T but with verbose = F I got the following error:
Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts,  : The inla result collection failed.


I assume this is related to a module I don't load? In the meantime, the rgeneric model seems to have a strange behavior on my windows so I am probably missing something else? Does anyone have any hint about what's going on?

Thanks a lot for your time!
Cheers,
Olivier

Please, find below the whole error message from one of the HPC (see the .txt for the error message on my Windows): 
###Loading R and gccmodules
[osupplisson@genobioinfo1 ~]$ module load statistics/R/4.3.1
[osupplisson@genobioinfo1 ~]$ module load compilers/gcc/12.2.0

#Launching R
[osupplisson@genobioinfo1 ~]$ R

R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(INLA)
Loading required package: Matrix
Loading required package: sp
This is INLA_23.11.15 built 2023-11-15 19:10:15 UTC.
 - See www.r-inla.org/contact-us for how to get help.
 - List available models/likelihoods/etc with inla.list.models()
 - Use inla.doc(<NAME>) to access documentation
Warning message:
package ‘INLA’ was built under R version 4.3.2

> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.6 (Ootpa)

Matrix products: default
BLAS:   /tools/statistics/R/R-4.3.1/lib64/R/lib/libRblas.so
LAPACK: /tools/statistics/R/R-4.3.1/lib64/R/lib/libRlapack.so;  LAPACK version 3.11.0

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=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.utf-8 LC_IDENTIFICATION=C

time zone: Europe/Paris
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] INLA_23.11.15 sp_2.1-1      Matrix_1.6-2

loaded via a namespace (and not attached):
 [1] vctrs_0.6.4        cli_3.6.1          rlang_1.1.2        DBI_1.1.3
 [5] KernSmooth_2.23-21 generics_0.1.3     sf_1.0-14          glue_1.6.2
 [9] e1071_1.7-13       fansi_1.0.5        grid_4.3.1         classInt_0.4-10
[13] tibble_3.2.1       lifecycle_1.0.3    compiler_4.3.1     fmesher_0.1.4
[17] dplyr_1.1.3        Rcpp_1.0.11        pkgconfig_2.0.3    lattice_0.21-8
[21] R6_2.5.1           tidyselect_1.2.0   class_7.3-22       utf8_1.2.4
[25] pillar_1.9.0       splines_4.3.1      magrittr_2.0.3     withr_2.5.2
[29] tools_4.3.1        proxy_0.4-27       units_0.8-4


##Basic example from R-INLA website: work as expected
> n = 100; a = 1; b = 1; tau = 100
> z = rnorm(n)
ta = a +> eta = a + b*z
>
> scale = exp(rnorm(n))
> prec = scale*tau
> y = rnorm(n, mean = eta, sd = 1/sqrt(prec))
>
> data = list(y=y, z=z)
> formula = y ~ 1+z
> result = inla(formula, family = "gaussian", data = data)
>
> summary(result)

Call:
   c("inla.core(formula = formula, family = family, contrasts = contrasts,
   ", " data = data, quantiles = quantiles, E = E, offset = offset, ", "
   scale = scale, weights = weights, Ntrials = Ntrials, strata = strata,
   ", " lp.scale = lp.scale, link.covariates = link.covariates, verbose =
   verbose, ", " lincomb = lincomb, selection = selection, control.compute
   = control.compute, ", " control.predictor = control.predictor,
   control.family = control.family, ", " control.inla = control.inla,
   control.fixed = control.fixed, ", " control.mode = control.mode,
   control.expert = control.expert, ", " control.hazard = control.hazard,
   control.lincomb = control.lincomb, ", " control.update =
   control.update, control.lp.scale = control.lp.scale, ", "
   control.pardiso = control.pardiso, only.hyperparam = only.hyperparam,
   ", " inla.call = inla.call, inla.arg = inla.arg, num.threads =
   num.threads, ", " keep = keep, working.directory = working.directory,
   silent = silent, ", " inla.mode = inla.mode, safe = FALSE, debug =
   debug, .parent.frame = .parent.frame)" )
Time used:
    Pre = 0.641, Running = 0.728, Post = 0.0149, Total = 1.38
Fixed effects:
             mean    sd 0.025quant 0.5quant 0.975quant  mode kld
(Intercept) 0.990 0.012      0.966    0.990      1.013 0.990   0
z           0.986 0.011      0.964    0.986      1.008 0.986   0

Model hyperparameters:
                                         mean   sd 0.025quant 0.5quant
Precision for the Gaussian observations 69.41 9.81      51.53    68.95
                                        0.975quant  mode
Precision for the Gaussian observations      89.94 68.02

Marginal log-Likelihood:  51.95
 is computed
Posterior summaries for the linear predictor and the fitted values are computed
(Posterior marginals needs also 'control.compute=list(return.marginals.predictor=TRUE)')


##Trying the example for rgeneric from the inla doc: https://inla.r-inla-download.org/r-inla.org/doc/latent/rgeneric-example.R
> n = 100
> rho=0.9
> x = arima.sim(n, model = list(ar = rho)) * sqrt(1-rho^2)
+ rnorm(n, sd = 0.1)
model = inla.rgeneric.define(inla.rgeneric.ar1.model, n=n)
formula = y ~ -1 + f(idx, model=model)
r = inla(formula, data = data.frame(y, idx = 1:n), family = "gaussian", verbose=T)> y = x + rnorm(n, sd = 0.1)
> model = inla.rgeneric.define(inla.rgeneric.ar1.model, n=n)
> formula = y ~ -1 + f(idx, model=model)
> r = inla(formula, data = data.frame(y, idx = 1:n), family = "gaussian", verbose=T)


***************************************************************************
CONTAINS Runtime Modules of Parallel Sparse Linear Solver PARDISO Vers. 7.2
CUSTOMIZED FOR THE R-INLA PACKAGE WHICH SOLVES A LARGE CLASS OF STATISTICAL
MODELS USING THE INLA APPROACH.
Copyright Universita della Svizzera italiana 2000-2020 All Rights Reserved.

No PARDISO license file found.  Please see `http://www.pardiso-project.org/r-inla
where to place the license file pardiso.lic
***************************************************************************
        Read ntt 128 1 with max.threads 128
        Found num.threads = 128:1 max_threads = 128

        152fa37212f19070579d6100b2abd798de69cb49 - Wed Nov 15 21:42:33 2023 +0300
Report bugs to <he...@r-inla.org>
Set reordering to id=[0] and name=[default]
Process file[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/Model.ini] threads[128] max.threads[128] blas_threads[1] nested[128:1]
inla_build...
        number of sections=[9]
        parse section=[0] name=[INLA.libR] type=[LIBR]
        inla_parse_libR...
                section[INLA.libR]
                        R_HOME=[/tools/statistics/R/R-4.3.1/lib64/R]
        parse section=[6] name=[INLA.Expert] type=[EXPERT]
        inla_parse_expert...
                section[INLA.Expert]
                        disable.gaussian.check=[0]
                        Measure dot.product.gain=[No]
                        cpo.manual=[0]
                        jp.file=[(null)]
                        jp.model=[(null)]
        parse section=[1] name=[INLA.Model] type=[PROBLEM]
        inla_parse_problem...
                name=[INLA.Model]
                R-INLA version = [23.11.15]
                R-INLA build date = [19676]
                Build tag = [devel]
                System memory = [503.3Gb]
                Cores = (Physical= 128, Logical= 128)
                'char' is signed
                openmp.strategy=[default]
                pardiso-library installed and working? = [no]
                smtp = [taucs]
                strategy = [default]
                store results in directory=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/results.files]
                output:
                        gcpo=[0]
                                num.level.sets=[-1]
                                size.max=[32]
                                strategy=[Posterior]
                                correct.hyperpar=[1]
                                epsilon=[0.005]
                                prior.diagonal=[0.0001]
                                keep=[]
                                remove.fixed=[1]
                                remove=[]
                        cpo=[0]
                        po=[0]
                        dic=[0]
                        kld=[1]
                        mlik=[1]
                        q=[0]
                        graph=[0]
                        hyperparameters=[1]
                        config=[0]
                        config.lite=[0]
                        likelihood.info=[0]
                        internal.opt=[1]
                        save.memory=[0]
                        summary=[1]
                        return.marginals=[1]
                        return.marginals.predictor=[0]
                        nquantiles=[3]  [ 0.025 0.5 0.975 ]
                        ncdf=[0]  [ ]
        parse section=[3] name=[Predictor] type=[PREDICTOR]
        inla_parse_predictor ...
                section=[Predictor]
                dir=[predictor]
                PRIOR->name=[loggamma]
                hyperid=[53001|Predictor]
                PRIOR->from_theta=[function (x) <<NEWLINE>>exp(x)]
                PRIOR->to_theta = [function (x) <<NEWLINE>>log(x)]
                PRIOR->PARAMETERS=[1, 1e-05]
                initialise log_precision[13.8155]
                fixed=[1]
                user.scale=[1]
                n=[100]
                m=[0]
                ndata=[100]
                compute=[1]
                read offsets from file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a]
                read n=[200] entries from file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a]
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 0/100  (idx,y) = (0, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 1/100  (idx,y) = (1, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 2/100  (idx,y) = (2, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 3/100  (idx,y) = (3, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 4/100  (idx,y) = (4, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 5/100  (idx,y) = (5, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 6/100  (idx,y) = (6, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 7/100  (idx,y) = (7, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 8/100  (idx,y) = (8, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3667efa41a] 9/100  (idx,y) = (9, 0)
                A=[(null)]
                Aext=[(null)]
                AextPrecision=[1e+08]
                output:
                        summary=[1]
                        return.marginals=[1]
                        return.marginals.predictor=[0]
                        nquantiles=[3]  [ 0.025 0.5 0.975 ]
                        ncdf=[0]  [ ]
        parse section=[2] name=[INLA.Data1] type=[DATA]
        inla_parse_data [section 1]...
                tag=[INLA.Data1]
                family=[GAUSSIAN]
                likelihood=[GAUSSIAN]
                file->name=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c36652e441c]
                file->name=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c36433cba12]
                file->name=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c3645c313b8]
                file->name=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c363dbb2144]
                read n=[300] entries from file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c36652e441c]
                mdata.nattributes = 0
                        0/100  (idx,a,y,d) = (0, 1, -0.654565, 1)
                        1/100  (idx,a,y,d) = (1, 1, -0.275464, 1)
                        2/100  (idx,a,y,d) = (2, 1, 0.449318, 1)
                        3/100  (idx,a,y,d) = (3, 1, 0.664148, 1)
                        4/100  (idx,a,y,d) = (4, 1, -0.00646731, 1)
                        5/100  (idx,a,y,d) = (5, 1, 1.08942, 1)
                        6/100  (idx,a,y,d) = (6, 1, 1.14408, 1)
                        7/100  (idx,a,y,d) = (7, 1, 0.843554, 1)
                        8/100  (idx,a,y,d) = (8, 1, 0.710192, 1)
                        9/100  (idx,a,y,d) = (9, 1, 0.99212, 1)
                likelihood.variant=[0]
                initialise log_precision[4]
                fixed0=[0]
                PRIOR0->name=[loggamma]
                hyperid=[65001|INLA.Data1]
                PRIOR0->from_theta=[function (x) <<NEWLINE>>exp(x)]
                PRIOR0->to_theta = [function (x) <<NEWLINE>>log(x)]
                PRIOR0->PARAMETERS0=[1, 5e-05]
                initialise log_precision offset[72.0873]
                fixed1=[1]
                PRIOR1->name=[none]
                hyperid=[65002|INLA.Data1]
                PRIOR1->from_theta=[function (x) <<NEWLINE>>exp(x)]
                PRIOR1->to_theta = [function (x) <<NEWLINE>>log(x)]
                PRIOR1->PARAMETERS1=[]
                Link model   [IDENTITY]
                Link order   [-1]
                Link variant [-1]
                Link a       [1]
                Link ntheta  [0]
                mix.use[0]
        parse section=[4] name=[idx] type=[FFIELD]
        inla_parse_ffield...
                section=[idx]
                dir=[random.effect00000001]
                model=[rgeneric]
                vb.correct n[1]  -1
                correct=[-1]
                constr=[0]
                diagonal=[0]
                id.names=<not present>
                compute=[1]
                nrep=[1]
                ngroup=[1]
                read covariates from file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e]
                read n=[200] entries from file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e]
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 0/100  (idx,y) = (0, 0)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 1/100  (idx,y) = (1, 1)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 2/100  (idx,y) = (2, 2)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 3/100  (idx,y) = (3, 3)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 4/100  (idx,y) = (4, 4)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 5/100  (idx,y) = (5, 5)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 6/100  (idx,y) = (6, 6)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 7/100  (idx,y) = (7, 7)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 8/100  (idx,y) = (8, 8)
                file=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c362271524e] 9/100  (idx,y) = (9, 9)
                file for locations=[/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c361f06f47e]
                        nlocations=[100]
                        locations[0]=[1]
                        locations[1]=[2]
                        locations[2]=[3]
                        locations[3]=[4]
                        locations[4]=[5]
                        locations[5]=[6]
                        locations[6]=[7]
                        locations[7]=[8]
                        locations[8]=[9]
                        locations[9]=[10]
                cyclic=[0]
                rgeneric.file   [/tmp/RtmpFflSUJ/file1e6c364c65c5cb/data.files/file1e6c363ae336ba]
                rgeneric.model  [.inla.rgeneric.model.idx]

At this stage, R-INLA just collapsed and the HPC re-launched R after unloading the modules (see the R version loaded, which is the base version of this HPC)

R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

During startup - Warning messages:
1: package ‘methods’ was built under R version 4.3.1
2: package ‘datasets’ was built under R version 4.3.1
3: package ‘utils’ was built under R version 4.3.1
4: package ‘grDevices’ was built under R version 4.3.1
5: package ‘graphics’ was built under R version 4.3.1
6: package ‘stats’ was built under R version 4.3.1
Loading required package: Matrix
Loading required package: sp
Error: package or namespace load failed for ‘INLA’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/libs/Rcpp.so':
  /home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/INLA/bin/linux/64bit/first/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/libs/Rcpp.so)
In addition: Warning messages:
1: package ‘INLA’ was built under R version 4.3.2
2: package ‘Matrix’ was built under R version 4.3.1
3: package ‘sp’ was built under R version 4.3.1

 *** ERROR ***: load library [INLA] failed.
Error in inla.inlaprogram.has.crashed() :
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does not help, please contact the developers at <he...@r-inla.org>.
>
error_message_on_windows.txt

Håvard Rue

unread,
Nov 20, 2023, 3:24:05 PM11/20/23
to Olivier Supplisson, R-inla discussion group

can you try to do

inla.binary.install()

and chose the Rocky8 one?

maybe you also need to reinstall 'Rcpp'
> --
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/CAOpNrNs0JtOebp5dpLWKky5jpQ_bSj-AN011sEP%3DR2p%3DuvpEkg%40mail.gmail.com
> .

--
Håvard Rue
hr...@r-inla.org

Olivier Supplisson

unread,
Nov 20, 2023, 3:49:02 PM11/20/23
to Håvard Rue, R-inla discussion group
Thanks a lot for the heads-up and the quick reply! 

I already tried it but did it another time, just in case. 

Unfortunately, it still does not solve the issue (see below for details).

Best,
Olivier


##Installing Rocky8 binary:
[osupplisson@genobioinfo1 ~]$ R

> library(INLA)
Loading required package: Matrix
Loading required package: sp
This is INLA_23.11.15 built 2023-11-15 19:10:15 UTC.
 - See www.r-inla.org/contact-us for how to get help.
 - List available models/likelihoods/etc with inla.list.models()
 - Use inla.doc(<NAME>) to access documentation
Warning message:
package ‘INLA’ was built under R version 4.3.2
> inla.binary.install()
* Looking for Version_23.11.15 and os='<choose interactively>'
  Available alternatives:
         Alternative 1  is  ./CentOS Linux-7 (Core)/Version_23.11.15/64bit.tgz
         Alternative 2  is  ./Fedora Linux-39 (Workstation Edition)/Version_23.11.15/64bit.tgz
         Alternative 3  is  ./Rocky Linux-8.8 (Green Obsidian)/Version_23.11.15/64bit.tgz
         Alternative 4  is  ./Rocky Linux-9.2 (Blue Onyx)/Version_23.11.15/64bit.tgz
         Alternative 5  is  ./Ubuntu-22.04.3 LTS (Jammy Jellyfish)/Version_23.11.15/64bit.tgz
  Chose alternative [1:5]
        1: 3
* Install file [https://inla.r-inla-download.org/Linux-builds/./Rocky Linux-8.8 (Green Obsidian)/Version_23.11.15/64bit.tgz]
* INLA is installed in [/home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/INLA]
* Checking for write access...
* Download file, please wait...
* md5-checksum [b0b024116b8410fa3c14516d4bf44106] OK.
* Rename old 64bit directory...
* Unpack file...
* Remove temporary file...
* Remove old 64bit directory...
* Done!

#Reinstalling Rcpp

[11]+  Stopped                 R

[osupplisson@genobioinfo1 ~]$ R

R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> options(repos = list(CRAN = "http://cran.rstudio.com/"))
ays compile from> #Always compile from source
> options(install.packages.compile.from.source = "always")
>
> install.packages("Rcpp", sources = T, character.only = TRUE, ask = F, INSTALL_opts = '--no-lock')
Installing package into ‘/home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_1.0.11.tar.gz'
Content type 'application/x-gzip' length 2994004 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
staged installation is only possible with locking
** using non-staged installation
** libs
using C++ compiler: ‘g++ (GCC) 12.2.0’
g++ -std=gnu++17 -I"/tools/statistics/R/R-4.3.1/lib64/R/include" -DNDEBUG -I../inst/include/  -I/usr/local/include    -fpic  -g -O2  -c api.cpp -o api.o
g++ -std=gnu++17 -I"/tools/statistics/R/R-4.3.1/lib64/R/include" -DNDEBUG -I../inst/include/  -I/usr/local/include    -fpic  -g -O2  -c attributes.cpp -o attributes.o
g++ -std=gnu++17 -I"/tools/statistics/R/R-4.3.1/lib64/R/include" -DNDEBUG -I../inst/include/  -I/usr/local/include    -fpic  -g -O2  -c barrier.cpp -o barrier.o
g++ -std=gnu++17 -I"/tools/statistics/R/R-4.3.1/lib64/R/include" -DNDEBUG -I../inst/include/  -I/usr/local/include    -fpic  -g -O2  -c date.cpp -o date.o
g++ -std=gnu++17 -I"/tools/statistics/R/R-4.3.1/lib64/R/include" -DNDEBUG -I../inst/include/  -I/usr/local/include    -fpic  -g -O2  -c module.cpp -o module.o
g++ -std=gnu++17 -I"/tools/statistics/R/R-4.3.1/lib64/R/include" -DNDEBUG -I../inst/include/  -I/usr/local/include    -fpic  -g -O2  -c rcpp_init.cpp -o rcpp_init.o
g++ -std=gnu++17 -shared -L/tools/statistics/R/R-4.3.1/lib64/R/lib -L/usr/local/lib64 -o Rcpp.so api.o attributes.o barrier.o date.o module.o rcpp_init.o -L/tools/statistics/R/R-4.3.1/lib64/R/lib -lR
installing to /home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (Rcpp)

The downloaded source packages are in
        ‘/tmp/RtmpZRJF1M/downloaded_packages’
> Testing R-INLA 
[12]+  Stopped                 R

[osupplisson@genobioinfo1 ~]$ R

R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

#Checking the basic example from the website: OK !
> library(INLA)
Loading required package: Matrix
Loading required package: sp
This is INLA_23.11.15 built 2023-11-15 19:10:15 UTC.
 - See www.r-inla.org/contact-us for how to get help.
 - List available models/likelihoods/etc with inla.list.models()
 - Use inla.doc(<NAME>) to access documentation
Warning message:
package ‘INLA’ was built under R version 4.3.2
>
> n = 100; a = 1; b = 1; tau = 100
> z = rnorm(n)
ta = a + b*z

scale = exp(rnorm(n))
pre> eta = a + b*z

>
> scale = exp(rnorm(n))
> prec = scale*tau
> y = rnorm(n, mean = eta, sd = 1/sqrt(prec))
>
> data = list(y=y, z=z)
> formula = y ~ 1+z
> result = inla(formula, family = "gaussian", data = data)

>
> result

Call:
   c("inla.core(formula = formula, family = family, contrasts = contrasts,
   ", " data = data, quantiles = quantiles, E = E, offset = offset, ", "
   scale = scale, weights = weights, Ntrials = Ntrials, strata = strata,
   ", " lp.scale = lp.scale, link.covariates = link.covariates, verbose =
   verbose, ", " lincomb = lincomb, selection = selection, control.compute
   = control.compute, ", " control.predictor = control.predictor,
   control.family = control.family, ", " control.inla = control.inla,
   control.fixed = control.fixed, ", " control.mode = control.mode,
   control.expert = control.expert, ", " control.hazard = control.hazard,
   control.lincomb = control.lincomb, ", " control.update =
   control.update, control.lp.scale = control.lp.scale, ", "
   control.pardiso = control.pardiso, only.hyperparam = only.hyperparam,
   ", " inla.call = inla.call, inla.arg = inla.arg, num.threads =
   num.threads, ", " keep = keep, working.directory = working.directory,
   silent = silent, ", " inla.mode = inla.mode, safe = FALSE, debug =
   debug, .parent.frame = .parent.frame)" )
Time used:
  Pre = 0.845, Running = 0.462, Post = 0.0239, Total = 1.33

#Trying the rgeneric example: not working
> n = 100
sim(n, model = list(ar = rho)) * sqrt(1> rho=0.9

> x = arima.sim(n, model = list(ar = rho)) * sqrt(1-rho^2)
(n, sd = 0.1)
model = inla.rgeneric.define(> y = x + rnorm(n, sd = 0.1)
> model = inla.rgeneric.define(inla.rgeneric.ar1.model, n=n)
 -1 + f(idx, model=model)
r = inla(formula, data = data.frame(y, idx = 1:n), family = "gaussian")> formula = y ~ -1 + f(idx, model=model)
> r = inla(formula, data = data.frame(y, idx = 1:n), family = "gaussian")

Loading required package: Matrix
Loading required package: sp
Error: package or namespace load failed for ‘INLA’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/libs/Rcpp.so':
  /home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/INLA/bin/linux/64bit/first/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/libs/Rcpp.so)


 *** ERROR ***: load library [INLA] failed.
Error in inla.inlaprogram.has.crashed() :
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does not help, please contact the developers at <he...@r-inla.org>.

>Running again with verbose: same issue

> r = inla(formula, data = data.frame(y, idx = 1:n), family = "gaussian", verbose = T)


***************************************************************************

CONTAINS Runtime Modules of Parallel Sparse Linear Solver PARDISO Vers. 7.2
CUSTOMIZED FOR THE R-INLA PACKAGE WHICH SOLVES A LARGE CLASS OF STATISTICAL
MODELS USING THE INLA APPROACH.
Copyright Universita della Svizzera italiana 2000-2020 All Rights Reserved.

No PARDISO license file found.  Please see `http://www.pardiso-project.org/r-inla
where to place the license file pardiso.lic
***************************************************************************
        Read ntt 128 1 with max.threads 128
        Found num.threads = 128:1 max_threads = 128

        152fa37212f19070579d6100b2abd798de69cb49 - Wed Nov 15 21:42:33 2023 +0300
Report bugs to <he...@r-inla.org>
Set reordering to id=[0] and name=[default]
Process file[/tmp/RtmppGEh7p/file1f67d354055866/Model.ini] threads[128] max.threads[128] blas_threads[1] nested[128:1]
                store results in directory=[/tmp/RtmppGEh7p/file1f67d354055866/results.files]
                read offsets from file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b]
                read n=[200] entries from file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b]
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 0/100  (idx,y) = (0, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 1/100  (idx,y) = (1, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 2/100  (idx,y) = (2, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 3/100  (idx,y) = (3, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 4/100  (idx,y) = (4, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 5/100  (idx,y) = (5, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 6/100  (idx,y) = (6, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 7/100  (idx,y) = (7, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 8/100  (idx,y) = (8, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d31d8edc1b] 9/100  (idx,y) = (9, 0)

                A=[(null)]
                Aext=[(null)]
                AextPrecision=[1e+08]
                output:
                        summary=[1]
                        return.marginals=[1]
                        return.marginals.predictor=[0]
                        nquantiles=[3]  [ 0.025 0.5 0.975 ]
                        ncdf=[0]  [ ]
        parse section=[2] name=[INLA.Data1] type=[DATA]
        inla_parse_data [section 1]...
                tag=[INLA.Data1]
                family=[GAUSSIAN]
                likelihood=[GAUSSIAN]
                file->name=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d35c8b13f3]
                file->name=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d3d0a519f]
                file->name=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d360bbbeeb]
                file->name=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d335ca4f76]
                read n=[300] entries from file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d35c8b13f3]
                mdata.nattributes = 0
                        0/100  (idx,a,y,d) = (0, 1, 0.616165, 1)
                        1/100  (idx,a,y,d) = (1, 1, 0.366663, 1)
                        2/100  (idx,a,y,d) = (2, 1, 0.717289, 1)
                        3/100  (idx,a,y,d) = (3, 1, 0.737938, 1)
                        4/100  (idx,a,y,d) = (4, 1, 0.515185, 1)
                        5/100  (idx,a,y,d) = (5, 1, 1.05498, 1)
                        6/100  (idx,a,y,d) = (6, 1, 0.554484, 1)
                        7/100  (idx,a,y,d) = (7, 1, -0.222213, 1)
                        8/100  (idx,a,y,d) = (8, 1, -0.649979, 1)
                        9/100  (idx,a,y,d) = (9, 1, -0.114943, 1)
                read covariates from file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915]
                read n=[200] entries from file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915]
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 0/100  (idx,y) = (0, 0)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 1/100  (idx,y) = (1, 1)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 2/100  (idx,y) = (2, 2)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 3/100  (idx,y) = (3, 3)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 4/100  (idx,y) = (4, 4)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 5/100  (idx,y) = (5, 5)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 6/100  (idx,y) = (6, 6)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 7/100  (idx,y) = (7, 7)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 8/100  (idx,y) = (8, 8)
                file=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d362efb915] 9/100  (idx,y) = (9, 9)
                file for locations=[/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d3b1b0bd4]

                        nlocations=[100]
                        locations[0]=[1]
                        locations[1]=[2]
                        locations[2]=[3]
                        locations[3]=[4]
                        locations[4]=[5]
                        locations[5]=[6]
                        locations[6]=[7]
                        locations[7]=[8]
                        locations[8]=[9]
                        locations[9]=[10]
                cyclic=[0]
                rgeneric.file   [/tmp/RtmppGEh7p/file1f67d354055866/data.files/file1f67d360e1524e]
                rgeneric.model  [.inla.rgeneric.model.idx]
#Same collapse
#That is very strange: it says that the R version is 4.3.2 but this version is not installed on the HPC (only 4.3.1 or before)
R version 4.3.2 (2023-10-31) -- "Eye Holes"

Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)


R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Loading required package: Matrix
Loading required package: sp
Error: package or namespace load failed for ‘INLA’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/libs/Rcpp.so':
  /home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/INLA/bin/linux/64bit/first/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/libs/Rcpp.so)


 *** ERROR ***: load library [INLA] failed.


Håvard Rue

unread,
Nov 21, 2023, 2:11:42 AM11/21/23
to Olivier Supplisson, R-inla discussion group

This is weird, as 'rgeneric' fail because when the libR is initialized
and INLA is loaded, it will try to load Rcpp, which then fail because of
the libstdc++.so.6

Can you try to copy the system's libstdc++.so.6 to
/home/osupplisson/R/x86_64-pc-linux-gnu-library/4.3/INLA/bin/linux/64b
it/first/libstdc++.so.6

(ie overwrite the file), and check again?

Alternative, try to install Rocky9 or CentOS7 binaries and retry?



On Mon, 2023-11-20 at 21:48 +0100, Olivier Supplisson wrote:
> Error: package or namespace load failed for ‘INLA’ in dyn.load(file,
> DLLpth = DLLpath, ...):
>  unable to load shared object '/home/osupplisson/R/x86_64-pc-linux-
> gnu-library/4.3/Rcpp/libs/Rcpp.so':
>   /home/osupplisson/R/x86_64-pc-linux-gnu-
> library/4.3/INLA/bin/linux/64bit/first/libstdc++.so.6: version
> `GLIBCXX_3.4.29' not found (required by /home/osupplisson/R/x86_64-pc-
> linux-gnu-library/4.3/Rcpp/libs/Rcpp.so)

--
Håvard Rue
hr...@r-inla.org

Olivier Supplisson

unread,
Nov 21, 2023, 3:55:28 AM11/21/23
to Håvard Rue, R-inla discussion group

The system's libstdc++.so.6 is linked to libstdc++.so.6.0.25. Putting both files in the /first did not change anything (same error message).

I got the same issue with CentOS (reinstalling Rcpp and with the initial libstdc) and with Rocky9 (reinstalling Rcpp and with the initial libstdc) even the basic example was not able to run.

I will give it a try with another HPC that I haven't tried so far (R 4.3.0) to see if the same issue arises.

image.png



Reply all
Reply to author
Forward
0 new messages