INLA + fmesher Installation Failure on HPC Cluster (R 4.4 / 4.5, Conda & Singularity Tried)

71 views
Skip to first unread message

Ji Gna

unread,
Jul 24, 2025, 4:07:29 PMJul 24
to R-inla discussion group

Hello INLA team and community,

We’ve been trying to run an INLA model with SPDE on a university-managed HPC cluster. Over the past two weeks, we’ve exhausted nearly all documented installation options for INLA + fmesher in both Conda and containerized environments, but still face critical errors. Below is a detailed description of all methods we’ve tried and the corresponding errors.

What We've Tried 

  1. Conda + R 4.4.2 + INLA (24.05.10)
    Installed R 4.4 through Conda. However, install.packages("INLA") now pulls version 25+, which requires fmesher. Since fmesher is not available for R 4.4, the installation fails.

  2. Conda + R 4.5.0 + INLA (25.06)
    Tried using the r-ver=4.5.0 image in Conda and installing INLA and fmesher. INLA installs, but fmesher installation fails due to missing system-level library libudunits2.so.0.

  3. Singularity + rocker/r-ver:4.5.0 image
    This was our most promising attempt. INLA installs and runs successfully for simple models. However, fmesher again fails to install due to the same libudunits2.so.0 error during compilation.

  4. Installing fmesher from GitHub using pak::pkg_install("inlabru-org/fmesher@stable")
    This fails at the compilation stage with the same libudunits2.so.0 issue.

  5. Basic model test with INLA (without mesh)
    Successfully ran a simple INLA model using y ~ x, which confirms that INLA itself works in the R 4.5.0 + Singularity setup.

  6. Running the full script (INLA_model_script.R)
    The script loads all packages and data correctly, but crashes silently or freezes right after launching inla(). The last message is either “INLA running” or “*** inla.core.safe: The inla program failed…”

  7. Manually installed all required R packages (here, haven, readr, posterior, etc.)
    All packages were installed successfully, except fmesher which consistently fails.

  8. Slurm interactive job session (srun --account=...)
    Successfully accessed compute node via srun, and tried rerunning the INLA script in that environment. Results were the same: INLA loads, but script halts during model fitting.

  9. Verified file path and project root
    Confirmed that INLA_model_script.R and all required data exist, and that here() correctly resolves the working directory.

  10. Tried older and newer versions of INLA
    Installed both 24.x and 25.x releases via direct tarball. But older INLA versions now also depend on fmesher, so they fail in the same way.

Error Messages Encountered

  • package ‘fmesher’ is not available for this version of R

  • libudunits2.so.0: cannot open shared object file

  • The inla program failed, but will rerun in case better initial values may help.

  • The inla-program exited with an error. Unless you interrupted it yourself...

  • Fatal error: cannot open file INLA_model_script.R

  • Script hangs indefinitely after printing "INLA running"

  • Error: there is no package called 'rprojroot' (solved after manual install)

Current Setup Summary

  • Cluster OS: Linux (university HPC, shared)

  • Scheduler: Slurm (interactive session tested)

  • R versions: 4.4.2 (Conda), 4.5.0 (Conda and Singularity)

  • Container: rocker/r-ver:4.5.0 via Singularity

  • Tested script: INLA_model_script.R (SPDE + covariates on U.S. mortality data)

  • Goal: Fit a spatial INLA model using mesh and census covariates

Questions

  1. Is there any way to use fmesher on an HPC without sudo access or without libudunits2.so.0 installed system-wide?

  2. Has anyone successfully run INLA + SPDE in a shared cluster environment?

  3. Is it possible to use older versions of INLA that do not require fmesher?

  4. Does a precompiled container with INLA + fmesher exist for public use?

Any help, working setup examples, or suggested direction would be deeply appreciated!

Thanks so much!

Helpdesk (Haavard Rue)

unread,
Jul 24, 2025, 4:17:27 PMJul 24
to Ji Gna, R-inla discussion group
Please use R-4.5

- after installing INLA, do

inla.binary.install()

which give you access to RedHat7,8,9 binaries, which hopefully should work for
your system. just chose one, and if it does not work, retry. otherwise, let me
know with info about the HPC system of yours

my preferred stategy, is the compile R-4.5 locally myself, and simply use that
one

for fmesher install, then if you're missing libraries, ask admin to install, or
install them locally

best
Havard



On Thu, 2025-07-24 at 12:19 -0700, Ji Gna wrote:
> Hello INLA team and community,
> We’ve been trying to run an INLA model with SPDE on a university-managed HPC
> cluster. Over the past two weeks, we’ve exhausted nearly all documented
> installation options for INLA + fmesher in both Conda and containerized
> environments, but still face critical errors. Below is a detailed description
> of all methods we’ve tried and the corresponding errors.
> What We've Tried 
>    1.
>       Conda + R 4.4.2 + INLA (24.05.10)
>       Installed R 4.4 through Conda. However, install.packages("INLA") now
> pulls version 25+, which requires fmesher. Since fmesher is not available for
> R 4.4, the installation fails.
>    2.
>       Conda + R 4.5.0 + INLA (25.06)
>       Tried using the r-ver=4.5.0 image in Conda and installing INLA and
> fmesher. INLA installs, but fmesher installation fails due to missing system-
> level library libudunits2.so.0.
>    3.
>       Singularity + rocker/r-ver:4.5.0 image
>       This was our most promising attempt. INLA installs and runs successfully
> for simple models. However, fmesher again fails to install due to the same
> libudunits2.so.0 error during compilation.
>    4.
>       Installing fmesher from GitHub using
> pak::pkg_install("inlabru-org/fmesher@stable")
>       This fails at the compilation stage with the same libudunits2.so.0
> issue.
>    5.
>       Basic model test with INLA (without mesh)
>       Successfully ran a simple INLA model using y ~ x, which confirms that
> INLA itself works in the R 4.5.0 + Singularity setup.
>    6.
>       Running the full script (INLA_model_script.R)
>       The script loads all packages and data correctly, but crashes silently
> or freezes right after launching inla(). The last message is either “INLA
> running” or “*** inla.core.safe: The inla program failed…”
>    7.
>       Manually installed all required R packages (here, haven, readr,
> posterior, etc.)
>       All packages were installed successfully, except fmesher which
> consistently fails.
>    8.
>       Slurm interactive job session (srun --account=...)
>       Successfully accessed compute node via srun, and tried rerunning the
> INLA script in that environment. Results were the same: INLA loads, but script
> halts during model fitting.
>    9.
>       Verified file path and project root
>       Confirmed that INLA_model_script.R and all required data exist, and that
> here() correctly resolves the working directory.
>   10.
>       Tried older and newer versions of INLA
>       Installed both 24.x and 25.x releases via direct tarball. But older INLA
> versions now also depend on fmesher, so they fail in the same way.
> Error Messages Encountered
>  *
>    package ‘fmesher’ is not available for this version of R
>  *
>    libudunits2.so.0: cannot open shared object file
>  *
>    The inla program failed, but will rerun in case better initial values may
> help.
>  *
>    The inla-program exited with an error. Unless you interrupted it
> yourself...
>  *
>    Fatal error: cannot open file INLA_model_script.R
>  *
>    Script hangs indefinitely after printing "INLA running"
>  *
>    Error: there is no package called 'rprojroot' (solved after manual install)
> Current Setup Summary
>  *
>    Cluster OS: Linux (university HPC, shared)
>  *
>    Scheduler: Slurm (interactive session tested)
>  *
>    R versions: 4.4.2 (Conda), 4.5.0 (Conda and Singularity)
>  *
>    Container: rocker/r-ver:4.5.0 via Singularity
>  *
>    Tested script: INLA_model_script.R (SPDE + covariates on U.S. mortality
> data)
>  *
>    Goal: Fit a spatial INLA model using mesh and census covariates
> Questions
>    1.
>       Is there any way to use fmesher on an HPC without sudo access or without
> libudunits2.so.0 installed system-wide?
>    2.
>       Has anyone successfully run INLA + SPDE in a shared cluster environment?
>    3.
>       Is it possible to use older versions of INLA that do not require
> fmesher?
>    4.
>       Does a precompiled container with INLA + fmesher exist for public use?
> Any help, working setup examples, or suggested direction would be deeply
> appreciated!
> Thanks so much!
> --
> 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/dd74e598-0c8a-450d-8a3a-811a6390f34fn%40googlegroups.com
> .

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

Finn Lindgren

unread,
Jul 24, 2025, 5:01:41 PMJul 24
to Helpdesk, Ji Gna, R-inla discussion group
Hi,
The units lib is a system requirement for the units package, which sf depends on, and femesher depends on sf. You’ll need to have all system requirements installed for all dependent packages. This is a generic R package installation issue and not specific to fmesher/inla.
Installing the GitHub version of fmesher makes no difference in that regard, as the library that’s missing isn’t linked into fmesher.
The “not available for this R version” is likely a misleading error message due to incorrect specification of repository info, for example; the source package should build on any system that has a properly configured build system. Other dependent packages need their system reqs fulfilled as well. See https://cran.r-project.org/web/packages/units/index.html
Most such requirements are usually already installed on most systems, but sometimes there are special requirements.
Finn

On 24 Jul 2025, at 21:17, Helpdesk (Haavard Rue) <he...@r-inla.org> wrote:

Please use R-4.5
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.

Caroline

unread,
Aug 22, 2025, 2:06:39 AMAug 22
to R-inla discussion group
Hi Ji Gna,

Have you had luck resolving this? I have been having similar issues and have been unable to run my code on an HPC Cluster and am stuck on "the inla-program exited with an error. Unless you interrupted it yourself..." 

Caroline

Havard Rue

unread,
Aug 22, 2025, 4:09:22 AMAug 22
to R-inla discussion group, Caroline
Use R 4.5.  And the most recent testing version
 
After installing, install new binaries with
 
inla.binary.install()
 
Try centos7 

-- 
Håvard Rue 
--

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.
Reply all
Reply to author
Forward
0 new messages