# How to set LD\_LIBRARY\_PATH for custom Slurm build in cluster YAML (OOD v4)

**URL:** <https://discourse.openondemand.org/t/how-to-set-ld-library-path-for-custom-slurm-build-in-cluster-yaml-ood-v4/4277>\
**Category:** Get Help\
**Created:** [May 29, 2025, 8:34pm UTC](https://discourse.openondemand.org/t/how-to-set-ld-library-path-for-custom-slurm-build-in-cluster-yaml-ood-v4/4277 "2025-05-29T20:34:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![matzmz](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/matzmz/32/2769_2.png) [@matzmz](https://discourse.openondemand.org/u/matzmz)\
**Post date:** [May 29, 2025, 8:34pm UTC](https://discourse.openondemand.org/t/how-to-set-ld-library-path-for-custom-slurm-build-in-cluster-yaml-ood-v4/4277/1 "2025-05-29T20:34:14Z")

</div>

Hi all,

I’m using Open OnDemand 4.x and I have a custom installation of Slurm on my system. The Slurm binaries are located in a **non-standard path** , and they depend on shared libraries (`.so`) that are also located outside the standard library paths.

Here’s a redacted version of my current cluster YAML configuration:

```yaml
v2:
  metadata:
    title: FooBar
    url: "https://foo.bar.local/"
  login:
    host: 192.168.10.200
  job:
    adapter: "slurm"
    bin: "/opt/share/sw/intel/gcc-11.4.1/slurm-24.11.3/bin"
    conf: "/opt/share/sw/intel/gcc-11.4.1/slurm-24.11.3/etc/slurm.conf"

```

The problem is that Slurm binaries won’t run correctly unless `LD_LIBRARY_PATH` includes this directory:

```auto
/opt/share/sw/intel/gcc-11.4.1/slurm-24.11.3/lib

```

Is there a supported way in OOD v4 to **set `LD_LIBRARY_PATH` in the cluster config YAML** , or otherwise inject environment variables into the context where `sbatch`, `squeue`, and other Slurm commands are executed?

If YAML doesn’t support this directly, what’s the best practice in OOD v4 for this situation? I’d prefer not to modify system-wide environment settings if possible.

This is the error that appears:

```auto
An error occurred when submitting jobs for simulation 1: sbatch: error: plugin_load_from_file: dlopen(/opt/share/sw/intel/gcc-11.4.1/slurm-24.11.3/lib/slurm/auth_munge.so): libmunge.so.2: cannot open shared object file: No such file or directory
sbatch: error: Couldn't load specified plugin name for auth/munge: Dlopen of plugin file failed
sbatch: error: cannot create auth context for auth/munge
sbatch: fatal: failed to initialize auth plugin

```

Best

---

<div class="post-metadata">

**Author:** ![anderss](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/anderss/32/3359_2.png) [@anderss](https://discourse.openondemand.org/u/anderss)\
**Post date:** [May 30, 2025, 3:17am UTC](https://discourse.openondemand.org/t/how-to-set-ld-library-path-for-custom-slurm-build-in-cluster-yaml-ood-v4/4277/2 "2025-05-30T03:17:23Z")

</div>

I think this may be what you are looking for:

> **[PUN environment — Open OnDemand 4.0.0 documentation](https://osc.github.io/ood-documentation/latest/reference/pun-environment.html)**

Particularly the bits about **nginx\_stage.yml** and **/etc/ood/profile**.

Good luck!  
Sean

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 30, 2025, 1:10pm UTC](https://discourse.openondemand.org/t/how-to-set-ld-library-path-for-custom-slurm-build-in-cluster-yaml-ood-v4/4277/3 "2025-05-30T13:10:14Z")

</div>

Or if it were me, I’d just write some more wrappers to supply to the `bin` directory. I.e., simple shell scripts that can set environment variables and issue the command.

Not sure how adding to `LD_LIBRARY_PATH` may affect the PUN startup as now nginx will boot with this library path, but is probably OK.

---

<div class="post-metadata">

**Author:** ![matzmz](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/matzmz/32/2769_2.png) [@matzmz](https://discourse.openondemand.org/u/matzmz)\
**Post date:** [May 30, 2025, 2:56pm UTC](https://discourse.openondemand.org/t/how-to-set-ld-library-path-for-custom-slurm-build-in-cluster-yaml-ood-v4/4277/4 "2025-05-30T14:56:27Z")

</div>

Thank you all for the prompt replies! For now, I’ve resolved the issue by creating some wrapper scripts:

```yaml
bin_overrides:
      squeue: "/opt/ood/slurm-wrapper/squeue"
      scontrol: "/opt/ood/slurm-wrapper/scontrol"
      sbatch: "/opt/ood/slurm-wrapper/sbatch"
      scancel: "/opt/ood/slurm-wrapper/scancel"

```

Next, I’ll look into the suggestion provided by @anderss

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [November 26, 2025, 2:57pm UTC](https://discourse.openondemand.org/t/how-to-set-ld-library-path-for-custom-slurm-build-in-cluster-yaml-ood-v4/4277/5 "2025-11-26T14:57:26Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
