INLA on Alpine linux

7 views
Skip to first unread message

Thierry Onkelinx

unread,
Oct 9, 2025, 4:03:50 AM (5 days ago) Oct 9
to R-inla discussion group
Dear all,

I'm trying to run INLA on Alpine linux because it is a minimal distribution, leading to much smaller Docker images (about 1 GB smaller than an Ubuntu based Docker).

However, I'm getting the error that "inla.mkl" is not found. Below is a Dockerfile to reproduce the problem and the commands to build and run it.

> INLA::inla(mpg ~ wt, family = "gaussian", data = mtcars)
readlink: unrecognized option: e
BusyBox v1.37.0 (2025-08-05 16:40:33 UTC) multi-call binary.

Usage: readlink [-fnv] FILE

Display the value of a symlink

-n Don't add newline
-f Canonicalize by following all symlinks
-v Verbose
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 90: /root/inla.mkl: No such file or directory

 *** inla.core.safe:  The inla program failed, but will rerun in case better initial values may help. try=1/1
readlink: unrecognized option: e
BusyBox v1.37.0 (2025-08-05 16:40:33 UTC) multi-call binary.

Usage: readlink [-fnv] FILE

Display the value of a symlink

-n Don't add newline
-f Canonicalize by following all symlinks
-v Verbose
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 90: /root/inla.mkl: No such file or directory
Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts,  :
  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>.
The inla program failed and the maximum number of tries has been reached.
Calls: <Anonymous> -> inla.core.safe
Execution halted


##### Dockerfile

FROM rhub/r-minimal:4.5.1-patched

RUN echo 'options(repos = c(CRAN = "https://cloud.r-project.org/", INLA = "https://inla.r-inla-download.org/R/stable"))' > /usr/local/lib/R/etc/Rprofile.site
# install minimal dependencies
RUN installr -c -p -a 'gfortran icu-data-full linux-headers' fmesher lifecycle rlang withr MatrixModels
# install INLA
RUN Rscript -e 'install.packages("INLA")'

CMD R -e 'INLA::inla(mpg ~ wt, family = "gaussian", data = mtcars)'

##### Dockerfile

# Build docker
docker build --tag inla-test .

# Run docker
docker run --rm inla-test


ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry....@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
Postadres: Koning Albert II-laan 15 bus 186, 1210 Brussel
Poststukken die naar dit adres worden gestuurd, worden ingescand en digitaal aan de geadresseerde bezorgd. Zo kan de Vlaamse overheid haar dossiers volledig digitaal behandelen. Poststukken met de vermelding ‘vertrouwelijk’ worden niet ingescand, maar ongeopend aan de geadresseerde bezorgd.
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////


INLA help

unread,
Oct 9, 2025, 4:08:25 AM (5 days ago) Oct 9
to R-inla discussion group, Thierry Onkelinx
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 90: /root/inla.mkl: No such file or directory


This is where it happens.  Add after the first line of ‘inla.mkl.run’,

set  -vx

So we can see in the output what is happening. 

Haavard Rue
HelpDesk 
help@r-inla. org
--
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, visit https://groups.google.com/d/msgid/r-inla-discussion-group/CAJuCY5wcCR72r%2BQYgnHNL6RuA3W5TqEsUWesKpe-HsMHmbHFNQ%40mail.gmail.com.

Thierry Onkelinx

unread,
Oct 9, 2025, 4:45:09 AM (5 days ago) Oct 9
to INLA help, R-inla discussion group
Dear Havard,

Here is the output you requested. I started R from the directory containing inla.mkl.run.
I used the testing version of INLA. You can find the session info at the end of the output.

Best regards,

Thierry

> INLA::inla(mpg ~ wt, family = "gaussian", data = mtcars)

cmd=$(readlink -e "$0")
++ readlink -e /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run

readlink: unrecognized option: e
BusyBox v1.37.0 (2025-08-05 16:40:33 UTC) multi-call binary.

Usage: readlink [-fnv] FILE

Display the value of a symlink

        -n      Don't add newline
        -f      Canonicalize by following all symlinks
        -v      Verbose
+ cmd=
DIR=$(dirname "$cmd")
++ dirname ''
+ DIR=.
tmp=$(basename "$0")
++ basename /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
+ tmp=inla.mkl.run
prog=${tmp%%.run}
+ prog=inla.mkl

DR=""
+ DR=
if [ ! -z ${R_HOME+x} ]; then
    d="$R_HOME/lib"
    if [ -d "$d" ]; then
        DR=$d
    fi
fi
+ '[' '!' -z x ']'
+ d=/usr/local/lib/R/lib
+ '[' -d /usr/local/lib/R/lib ']'
+ DR=/usr/local/lib/R/lib

D=""
+ D=
for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib; do
    if [ -d "$d" ]; then
        if [ -z "$D" ]; then
            D="$d"
        else
            D="$D:$d"
        fi
    fi
done
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /lib64 ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /usr/lib64 ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /usr/lib64/R/lib ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /lib/x86_64-linux-gnu ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /usr/lib/x86_64-linux-gnu ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /lib ']'
+ '[' -z '' ']'
+ D=/lib
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /usr/lib ']'
+ '[' -z /lib ']'
+ D=/lib:/usr/lib

if [ -n "${INLA_NATIVE_LD_LIBRARY_PATH}" ]; then
    ## so we can revert back to old behaviour
    export LD_LIBRARY_PATH="$DIR/first:$D:$DIR:$LD_LIBRARY_PATH"
else
    ## this is the new default, is that we use the libs used when we
    ## build. Try to use libR from system by default
    export LD_LIBRARY_PATH="$DIR/first:$DR:$DIR:$D:$LD_LIBRARY_PATH"
fi
+ '[' -n '' ']'
+ export LD_LIBRARY_PATH=./first:/usr/local/lib/R/lib:.:/lib:/usr/lib:/usr/local/lib/R/lib:/usr/local/lib
+ LD_LIBRARY_PATH=./first:/usr/local/lib/R/lib:.:/lib:/usr/lib:/usr/local/lib/R/lib:/usr/local/lib

export PARDISOLICMESSAGE=1
+ export PARDISOLICMESSAGE=1
+ PARDISOLICMESSAGE=1
if [ -n "${INLA_MALLOC_LIB}" ]; then
    if [ -f "${INLA_MALLOC_LIB}" ]; then
        export LD_PRELOAD="${INLA_MALLOC_LIB}:$LD_PRELOAD"
    else  
        for nm in ${INLA_MALLOC_LIB}; do
            for f in $DIR/malloc/lib*.so*; do
                case "$f" in
                    $DIR/malloc/lib${INLA_MALLOC_LIB}malloc.so*)
                        export LD_PRELOAD="$f:$LD_PRELOAD";;
                esac
            done
        done
    fi
    case "$LD_PRELOAD" in
        *libjemalloc*)
            ;;
        *libmimalloc*)
            ;;
    esac
fi
+ '[' -n mi ']'
+ '[' -f mi ']'
+ for nm in ${INLA_MALLOC_LIB}
+ for f in $DIR/malloc/lib*.so*
+ case "$f" in
+ for f in $DIR/malloc/lib*.so*
+ case "$f" in
+ export LD_PRELOAD=./malloc/libmimalloc.so.3.0:
+ LD_PRELOAD=./malloc/libmimalloc.so.3.0:
+ for f in $DIR/malloc/lib*.so*
+ case "$f" in
+ case "$LD_PRELOAD" in

if [ -n "${INLA_DEBUG}" ]; then
    export OMP_DISPLAY_ENV=true
    for var in $(set | grep ^INLA_); do
        echo "*** $0 *** $var"
    done
    echo "*** $0 *** MALLOC_CONF=$MALLOC_CONF"
    echo "*** $0 *** LD_PRELOAD=$LD_PRELOAD"
    echo "*** $0 *** LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
    ldd -r "$DIR/$prog"

    for arg in "$@"; do
        if [ -r "$arg" ]; then
            echo -e "\n*** FILE $arg:"
            grep ^### "$arg"
            echo -e "*** END OF FILE $arg:\n"
        fi
    done

fi
+ '[' -n '' ']'

if [ -n "${INLA_DEBUG}" ]; then
    set | grep ^OMP_ | while read v; do echo "*** $0 *** $v"; done
    echo " *** $0 *** exec $DIR/$prog $@"
fi
+ '[' -n '' ']'

nc=""
+ nc=
if [ -n "$INLA_NUMACTL_ARG" ]; then
    ncp=$(type --path numactl)
    if [ -n "$ncp" ]; then
        nc="$ncp ${INLA_NUMACTL_ARG} "
    fi
fi
+ '[' -n '' ']'
exec $nc "$DIR/$prog" "$@"
+ exec ./inla.mkl -s -v -t12:1 -P compact /tmp/RtmpJDbNKl/file118185488b4/Model.ini
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 91: /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl: cannot execute: required file not found


 *** inla.core.safe:  The inla program failed, but will rerun in case better initial values may help. try=1/1

cmd=$(readlink -e "$0")
++ readlink -e /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run

readlink: unrecognized option: e
BusyBox v1.37.0 (2025-08-05 16:40:33 UTC) multi-call binary.

Usage: readlink [-fnv] FILE

Display the value of a symlink

        -n      Don't add newline
        -f      Canonicalize by following all symlinks
        -v      Verbose
+ cmd=
DIR=$(dirname "$cmd")
++ dirname ''
+ DIR=.
tmp=$(basename "$0")
++ basename /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
+ tmp=inla.mkl.run
prog=${tmp%%.run}
+ prog=inla.mkl

DR=""
+ DR=
if [ ! -z ${R_HOME+x} ]; then
    d="$R_HOME/lib"
    if [ -d "$d" ]; then
        DR=$d
    fi
fi
+ '[' '!' -z x ']'
+ d=/usr/local/lib/R/lib
+ '[' -d /usr/local/lib/R/lib ']'
+ DR=/usr/local/lib/R/lib

D=""
+ D=
for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib; do
    if [ -d "$d" ]; then
        if [ -z "$D" ]; then
            D="$d"
        else
            D="$D:$d"
        fi
    fi
done
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /lib64 ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /usr/lib64 ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /usr/lib64/R/lib ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /lib/x86_64-linux-gnu ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /usr/lib/x86_64-linux-gnu ']'
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /lib ']'
+ '[' -z '' ']'
+ D=/lib
+ for d in {,/usr}/lib64 /usr/lib64/R/lib {,/usr}/lib/x86_64-linux-gnu {,/usr}/lib
+ '[' -d /usr/lib ']'
+ '[' -z /lib ']'
+ D=/lib:/usr/lib

if [ -n "${INLA_NATIVE_LD_LIBRARY_PATH}" ]; then
    ## so we can revert back to old behaviour
    export LD_LIBRARY_PATH="$DIR/first:$D:$DIR:$LD_LIBRARY_PATH"
else
    ## this is the new default, is that we use the libs used when we
    ## build. Try to use libR from system by default
    export LD_LIBRARY_PATH="$DIR/first:$DR:$DIR:$D:$LD_LIBRARY_PATH"
fi
+ '[' -n '' ']'
+ export LD_LIBRARY_PATH=./first:/usr/local/lib/R/lib:.:/lib:/usr/lib:/usr/local/lib/R/lib:/usr/local/lib
+ LD_LIBRARY_PATH=./first:/usr/local/lib/R/lib:.:/lib:/usr/lib:/usr/local/lib/R/lib:/usr/local/lib

export PARDISOLICMESSAGE=1
+ export PARDISOLICMESSAGE=1
+ PARDISOLICMESSAGE=1
if [ -n "${INLA_MALLOC_LIB}" ]; then
    if [ -f "${INLA_MALLOC_LIB}" ]; then
        export LD_PRELOAD="${INLA_MALLOC_LIB}:$LD_PRELOAD"
    else  
        for nm in ${INLA_MALLOC_LIB}; do
            for f in $DIR/malloc/lib*.so*; do
                case "$f" in
                    $DIR/malloc/lib${INLA_MALLOC_LIB}malloc.so*)
                        export LD_PRELOAD="$f:$LD_PRELOAD";;
                esac
            done
        done
    fi
    case "$LD_PRELOAD" in
        *libjemalloc*)
            ;;
        *libmimalloc*)
            ;;
    esac
fi
+ '[' -n mi ']'
+ '[' -f mi ']'
+ for nm in ${INLA_MALLOC_LIB}
+ for f in $DIR/malloc/lib*.so*
+ case "$f" in
+ for f in $DIR/malloc/lib*.so*
+ case "$f" in
+ export LD_PRELOAD=./malloc/libmimalloc.so.3.0:
+ LD_PRELOAD=./malloc/libmimalloc.so.3.0:
+ for f in $DIR/malloc/lib*.so*
+ case "$f" in
+ case "$LD_PRELOAD" in

if [ -n "${INLA_DEBUG}" ]; then
    export OMP_DISPLAY_ENV=true
    for var in $(set | grep ^INLA_); do
        echo "*** $0 *** $var"
    done
    echo "*** $0 *** MALLOC_CONF=$MALLOC_CONF"
    echo "*** $0 *** LD_PRELOAD=$LD_PRELOAD"
    echo "*** $0 *** LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
    ldd -r "$DIR/$prog"

    for arg in "$@"; do
        if [ -r "$arg" ]; then
            echo -e "\n*** FILE $arg:"
            grep ^### "$arg"
            echo -e "*** END OF FILE $arg:\n"
        fi
    done

fi
+ '[' -n '' ']'

if [ -n "${INLA_DEBUG}" ]; then
    set | grep ^OMP_ | while read v; do echo "*** $0 *** $v"; done
    echo " *** $0 *** exec $DIR/$prog $@"
fi
+ '[' -n '' ']'

nc=""
+ nc=
if [ -n "$INLA_NUMACTL_ARG" ]; then
    ncp=$(type --path numactl)
    if [ -n "$ncp" ]; then
        nc="$ncp ${INLA_NUMACTL_ARG} "
    fi
fi
+ '[' -n '' ']'
exec $nc "$DIR/$prog" "$@"
+ exec ./inla.mkl -s -v -t12:1 -P compact /tmp/RtmpJDbNKl/file1182d16734f/Model.ini
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 91: /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl: cannot execute: required file not found

Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts,  :
  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>.
The inla program failed and the maximum number of tries has been reached.

> sessioninfo::session_info("INLA")
─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.5.1 Patched (2025-09-24 r88906)
 os       Alpine Linux v3.22
 system   x86_64, linux-musl
 ui       unknown
 language (EN)
 collate  C
 ctype    C.UTF-8
 tz       UTC
 date     2025-10-09
 pandoc   NA
 quarto   NA

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package      * version  date (UTC) lib source
 class          7.3-23   2025-01-01 [1] CRAN (R 4.5.1)
 classInt       0.4-11   2025-01-08 [1] CRAN (R 4.5.1)
 cli            3.6.5    2025-04-23 [1] CRAN (R 4.5.1)
 DBI            1.2.3    2024-06-02 [1] CRAN (R 4.5.1)
 dplyr          1.1.4    2023-11-17 [1] CRAN (R 4.5.1)
 e1071          1.7-16   2024-09-16 [1] CRAN (R 4.5.1)
 fmesher        0.5.0    2025-07-07 [1] CRAN (R 4.5.1)
 generics       0.1.4    2025-05-09 [1] CRAN (R 4.5.1)
 glue           1.8.0    2024-09-30 [1] CRAN (R 4.5.1)
 INLA           25.10.01 2025-10-01 [1] local
 KernSmooth     2.23-26  2025-01-01 [1] CRAN (R 4.5.1)
 lattice        0.22-7   2025-04-02 [1] CRAN (R 4.5.1)
 lifecycle      1.0.4    2023-11-07 [1] CRAN (R 4.5.1)
 magrittr       2.0.4    2025-09-12 [1] CRAN (R 4.5.1)
 MASS           7.3-65   2025-02-28 [1] CRAN (R 4.5.1)
 Matrix         1.7-4    2025-08-28 [1] CRAN (R 4.5.1)
 MatrixModels   0.5-4    2025-03-26 [1] CRAN (R 4.5.1)
 pillar         1.11.1   2025-09-17 [1] CRAN (R 4.5.1)
 pkgconfig      2.0.3    2019-09-22 [1] CRAN (R 4.5.1)
 proxy          0.4-27   2022-06-09 [1] CRAN (R 4.5.1)
 R6             2.6.1    2025-02-15 [1] CRAN (R 4.5.1)
 Rcpp           1.1.0    2025-07-02 [1] CRAN (R 4.5.1)
 rlang          1.1.6    2025-04-11 [1] CRAN (R 4.5.1)
 s2             1.1.9    2025-05-23 [1] CRAN (R 4.5.1)
 sf             1.0-21   2025-05-15 [1] CRAN (R 4.5.1)
 sp             2.2-0    2025-02-01 [1] CRAN (R 4.5.1)
 splancs        2.01-45  2024-05-27 [1] CRAN (R 4.5.1)
 tibble         3.3.0    2025-06-08 [1] CRAN (R 4.5.1)
 tidyselect     1.2.1    2024-03-11 [1] CRAN (R 4.5.1)
 units          0.8-7    2025-03-11 [1] CRAN (R 4.5.1)
 utf8           1.2.6    2025-06-08 [1] CRAN (R 4.5.1)
 vctrs          0.6.5    2023-12-01 [1] CRAN (R 4.5.1)
 withr          3.0.2    2024-10-28 [1] CRAN (R 4.5.1)
 wk             0.9.4    2024-10-11 [1] CRAN (R 4.5.1)

 [1] /usr/local/lib/R/library
ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry....@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
Postadres: Koning Albert II-laan 15 bus 186, 1210 Brussel
Poststukken die naar dit adres worden gestuurd, worden ingescand en digitaal aan de geadresseerde bezorgd. Zo kan de Vlaamse overheid haar dossiers volledig digitaal behandelen. Poststukken met de vermelding ‘vertrouwelijk’ worden niet ingescand, maar ongeopend aan de geadresseerde bezorgd.
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////




Op do 9 okt 2025 om 10:08 schreef INLA help <he...@r-inla.org>:

Facundo Muñoz

unread,
Oct 9, 2025, 5:10:22 AM (5 days ago) Oct 9
to r-inla-disc...@googlegroups.com

Hi Thierry,

Part of the problem seems to be that INLA is relying in GNU version of `readlink`, while alpine ships a striped-down version [1].

Still, installing GNU coreutils beforehand does not solve the problem completely. Now I get a different error:

aa5dfcfd5292:~# Rscript -e 'INLA::inla(mpg ~ wt, family = "gaussian", data = mtcars)'
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 90: /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl: cannot execute: required file not found



 *** inla.core.safe:  The inla program failed, but will rerun in case better initial values may help. try=1/1

/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 90: /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl: cannot execute: required file not found


Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts,  :
  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>.
The inla program failed and the maximum number of tries has been reached.
Calls: <Anonymous> -> inla.core.safe
Execution halted

Helpdesk (Haavard Rue)

unread,
Oct 9, 2025, 5:22:05 AM (5 days ago) Oct 9
to Facundo Muñoz, r-inla-disc...@googlegroups.com
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 91:
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl: cannot execute: required
file not found

which says that the main executable file is not there, so there must be some
installation error

can you add after 'set -vx'

ls -lR /usr/local/lib/R/library/INLA/bin


we can replace 'readline -f' with a shell function, like below, although its
annoying that these issues arise. MacOS has the same issue for older versions of
MacOS (now its fine). this code is from old versions of the `run' script, but
can be adapted to check if '-f' is supported or not (or just replace it
entirely)


if [ "$(type --path readlink)"X == "X" ]; then
readlink () {
(
shift 1
tfile=$1
cd $(dirname "$tfile")
tfile=$(basename "$tfile")
while [ -L "$tfile" ]
do
tfile=$(readlink -f "$tfile")
cd $(dirname "$tfile")
tfile=$(basename "$tfile")
done
pdir=$(pwd -P)
echo "$pdir/$tfile"
)
}
fi
> >  --
> >  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, visit
> > https://groups.google.com/d/msgid/r-inla-discussion-group/CAJuCY5wcCR72r%2BQYgnHNL6RuA3W5TqEsUWesKpe-HsMHmbHFNQ%40mail.gmail.com
> > .
> >  
>  
>  
> --
> 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, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/f69b264d-186b-49eb-8e79-c28ab590ac69%40gmail.com
> .

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

Thierry Onkelinx

unread,
Oct 9, 2025, 6:17:44 AM (5 days ago) Oct 9
to Helpdesk, Facundo Muñoz, r-inla-disc...@googlegroups.com
Dear Havard,

Here is the updated Dockerfile and output. The new docker installs co

### Dockerfile
FROM rhub/r-minimal:4.5.1-patched

RUN apk add nano
RUN echo 'options(repos = c(CRAN = "https://cloud.r-project.org/", INLA = "https://inla.r-inla-download.org/R/testing"))' > /usr/local/lib/R/etc/Rprofile.site
# install minimal dependencies
RUN installr -c -p -a 'coreutils gfortran icu-data-full linux-headers' fmesher lifecycle rlang withr MatrixModels sessioninfo

# install INLA
RUN Rscript -e 'install.packages("INLA")'
COPY fix.sh fix.sh

CMD R -e 'sessioninfo::session_info("INLA")' -e 'INLA::inla(mpg ~ wt, family = "gaussian", data = mtcars)'
### Dockerfile

### fix.sh
sed -i.bak '2i\
set -vx\
' /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
sed -i.bak '3i\
ls -lR /usr/local/lib/R/library/INLA/bin\
' /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
### fix.sh

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

> INLA::inla(mpg ~ wt, family = "gaussian", data = mtcars)
ls -lR /usr/local/lib/R/library/INLA/bin
+ ls -lR /usr/local/lib/R/library/INLA/bin




cmd=$(readlink -e "$0")
++ readlink -e /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
+ cmd=/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
DIR=$(dirname "$cmd")
++ dirname /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
+ DIR=/usr/local/lib/R/library/INLA/bin/linux/64bit
+ export LD_LIBRARY_PATH=/usr/local/lib/R/library/INLA/bin/linux/64bit/first:/usr/local/lib/R/lib:/usr/local/lib/R/library/INLA/bin/linux/64bit:/lib:/usr/lib:/usr/local/lib/R/lib:/usr/local/lib
+ LD_LIBRARY_PATH=/usr/local/lib/R/library/INLA/bin/linux/64bit/first:/usr/local/lib/R/lib:/usr/local/lib/R/library/INLA/bin/linux/64bit:/lib:/usr/lib:/usr/local/lib/R/lib:/usr/local/lib
+ export LD_PRELOAD=/usr/local/lib/R/library/INLA/bin/linux/64bit/malloc/libmimalloc.so.3.0:
+ LD_PRELOAD=/usr/local/lib/R/library/INLA/bin/linux/64bit/malloc/libmimalloc.so.3.0:
+ exec /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl -s -v -t12:1 -P compact /tmp/RtmpkbEpLH/filea18bbbfd/Model.ini
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 94: /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl: cannot execute: required file not found


 *** inla.core.safe:  The inla program failed, but will rerun in case better initial values may help. try=1/1
ls -lR /usr/local/lib/R/library/INLA/bin
+ ls -lR /usr/local/lib/R/library/INLA/bin




cmd=$(readlink -e "$0")
++ readlink -e /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
+ cmd=/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
DIR=$(dirname "$cmd")
++ dirname /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run
+ DIR=/usr/local/lib/R/library/INLA/bin/linux/64bit
+ export LD_LIBRARY_PATH=/usr/local/lib/R/library/INLA/bin/linux/64bit/first:/usr/local/lib/R/lib:/usr/local/lib/R/library/INLA/bin/linux/64bit:/lib:/usr/lib:/usr/local/lib/R/lib:/usr/local/lib
+ LD_LIBRARY_PATH=/usr/local/lib/R/library/INLA/bin/linux/64bit/first:/usr/local/lib/R/lib:/usr/local/lib/R/library/INLA/bin/linux/64bit:/lib:/usr/lib:/usr/local/lib/R/lib:/usr/local/lib
+ export LD_PRELOAD=/usr/local/lib/R/library/INLA/bin/linux/64bit/malloc/libmimalloc.so.3.0:
+ LD_PRELOAD=/usr/local/lib/R/library/INLA/bin/linux/64bit/malloc/libmimalloc.so.3.0:
+ exec /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl -s -v -t12:1 -P compact /tmp/RtmpkbEpLH/filea3a0bba81/Model.ini
/usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl.run: line 94: /usr/local/lib/R/library/INLA/bin/linux/64bit/inla.mkl: cannot execute: required file not found

Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts,  :
  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>.
The inla program failed and the maximum number of tries has been reached.
Calls: <Anonymous> -> inla.core.safe
Execution halted

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry....@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
Postadres: Koning Albert II-laan 15 bus 186, 1210 Brussel
Poststukken die naar dit adres worden gestuurd, worden ingescand en digitaal aan de geadresseerde bezorgd. Zo kan de Vlaamse overheid haar dossiers volledig digitaal behandelen. Poststukken met de vermelding ‘vertrouwelijk’ worden niet ingescand, maar ongeopend aan de geadresseerde bezorgd.
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////




Op do 9 okt 2025 om 11:22 schreef Helpdesk (Haavard Rue) <he...@r-inla.org>:
Reply all
Reply to author
Forward
0 new messages