# ERROR: Unable to load dependent library ... libopenlibm.so

**URL:** <https://discourse.julialang.org/t/error-unable-to-load-dependent-library-libopenlibm-so/127308>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 24, 2025, 1:11pm UTC](https://discourse.julialang.org/t/error-unable-to-load-dependent-library-libopenlibm-so/127308 "2025-03-24T13:11:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 24, 2025, 1:11pm UTC](https://discourse.julialang.org/t/error-unable-to-load-dependent-library-libopenlibm-so/127308/1 "2025-03-24T13:11:36Z")

</div>

I am trying to bisect an issue with Julia, it is fixed in `master` and present in `v11.4`. My problem is that if I try to compile anything in the `release-1.11` branch, I get an error like

```sh
ERROR: Unable to load dependent library /home/tamas/src/julia-git/usr/bin/../lib/libopenlibm.so
Message:/home/tamas/src/julia-git/usr/bin/../lib/libopenlibm.so: cannot enable executable stack as shared object requires: Invalid argument
make[1]: *** [sysimage.mk:64: /home/tamas/src/julia-git/usr/lib/julia/corecompiler.ji] Error 1
make: *** [Makefile:103: julia-sysimg-ji] Error 2

```

I found [a related topic pointing to a PR](https://discourse.julialang.org/t/can-not-start-julia-dependent-library-libopenlibm-so/125973) and of course it is fixed in `master`, but how can I work around this to compile 1.11.4?

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [March 24, 2025, 1:24pm UTC](https://discourse.julialang.org/t/error-unable-to-load-dependent-library-libopenlibm-so/127308/2 "2025-03-24T13:24:11Z")

</div>

You need to manually clear the executable stack flag from the library. Two options were mentioned over at [Crash under glibc 2.41 due to libopenlibm having an executable stack · Issue #57250 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/57250)

If you have the `execstack` program on your system:

```julia
execstack -c /your/path/to/lib/libopenlibm.so

```

If you have `patchelf`:

```julia
patchelf --clear-execstack /your/path/to/lib/libopenlibm.so

```

I did not have either on my system, so I installed the first. Worked like a charm!

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 24, 2025, 2:49pm UTC](https://discourse.julialang.org/t/error-unable-to-load-dependent-library-libopenlibm-so/127308/3 "2025-03-24T14:49:34Z")

</div>

It is unclear where in the compilation process I should apply this though (I want to automate it for bisection). The best I would come up with is

```julia
#!/bin/sh
make cleanall
make
patchelf --clear-execstack /home/tamas/src/julia-git/usr/bin/../lib/libopenlibm.so
make

```

ie calling `make` _twice_, because it updates the binary then fails.

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [March 24, 2025, 3:38pm UTC](https://discourse.julialang.org/t/error-unable-to-load-dependent-library-libopenlibm-so/127308/4 "2025-03-24T15:38:32Z")

</div>

Calling `make` twice might be the most reliable among quick solutions. I can only think of

```bash
echo "
install-openlibm: $(build_prefix)/manifest/openlibm
    patchelf --clear-execstack /home/tamas/src/julia-git/usr/bin/../lib/libopenlibm.so
" >> deps/openlibm.mk

```

but that’s pretty ugly.
