• Home
  • Accessing Our Facilities
    • Apply for Access
    • HPC Resource List
    • Our Staff
    • Our Research Projects
    • Our Research Software

    • Contributions & Costings
    • HPC Driving Test
  • Documentation
    • Documentation Home
    • Getting Started
    • Advanced Topics
    • Training & Workshops
    • FAQ
    • Policies & Procedures
    • Using the Wiki

    • Data & Report Terminology
    • About this website

    • Reports
  • My Account
    • My HPC Projects
HPC Support
Trace: • 038

How do I extend my LD_LIBRARY_PATH for R/R-Studio?

When launching R-Studio from our Open OnDemand service you don't have the ability to preload any custom modules or any paths to self-installed code. Once R-Studio is running it's not feasible to amend the LD_LIBRARY_PATH of the running application.

Instead, R offers a generic method of changing environment variables or making other settings changes as it loads. This is the file $HOME/.Renviron.

To add a custom library search path simply open $HOME/.Renviron in any text editor (create it first if it does not already exist), and set the following:

LD_LIBRARY_PATH=/path/to/your/custom/libraries:${LD_LIBRARY_PATH}

This will add /path/to/your/custom/libraries to the start of any existing LD_LIBRARY_PATH entries (such as those set by loading modules). Inside R/R-Studio you can check the content of the variable as follows:

> Sys.getenv("LD_LIBRARY_PATH")
[1] "/path/to/your/custom/libraries:/opt/software/easybuild/software/CUDA/12.8.0/nvvm/lib64:/opt/software/easybuild/software/CUDA/12.8.0/extras/CUPTI/lib64:/opt/software/easybuild/software/CUDA/12.8.0/targets/x86_64-linux/lib:/opt/software/manual/apps/R-studio/2025-05-01-binary/rstudio-2025.05.1+513/lib64:

You can see in the example above that /path/to/your/custom/libraries has been added to the front of the path, which already includes things like CUDA and R-Studio itself.


Back to FAQ Index

Previous Next

HPC Support

Table of Contents

HPC Service

  • News & Changes

Main Content Sections

  • Documentation Home
  • Getting Started
  • Advanced Topics
  • Training & Workshops
  • FAQ
  • Policies & Procedures
  • Using the Wiki
  • Contact us & Get Help

Documentation Tools

  • Wiki Login
  • RSE-HPC Team Area
Developed and operated by
Research Software Engineering
Copyright © Newcastle University
Contact us @rseteam