# Specifying GraphViz plugins folder under MacOS?

**URL:** <https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698>\
**Category:** Help\
**Created:** [July 7, 2023, 11:15am UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698 "2023-07-07T11:15:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremyf](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jeremyf](https://forum.graphviz.org/u/jeremyf)\
**Post date:** [July 7, 2023, 11:15am UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698/1 "2023-07-07T11:15:22Z")

</div>

Hi all,

I’m maintaining a C++/Qt application that uses GraphViz to render diagrams using the “neato” plugin. Overall it’s working fine.

One issue is that GraphViz needs to find the file `libgvplugin_neato_layout.6.dylib` at runtime in order to work. When the application is built using our Jenkins build server, that’s no problem; the build-script is set up to copy that file (along with all of the other necessary files) into `MyApp.app/Contents/Frameworks`, so everything “just works” when the user installs the app.

My question is about developer builds, though – when building the app locally on my machine using `qmake`, qmake doesn’t know that the plugin files need to be copied in to the Frameworks folder, so after I manually build the program (using `qmake ; make`) and try to run it, I get a crash-on-startup (as shown below). Then I have to run a separate shell script to copy the files over, and after that the app runs okay.

My question is, is there any way that I could avoid having to copy the files over in this situation, e.g. by programmatically specifying a directory-path where graphviz should look to find its plugins? That would be a bit more elegant than having to make a copy of the plugins every time I do a clean build.

FWIW I tried adding the path to the plugins to my `LD_LIBRARY_PATH` environment variable, but that did not seem to make any difference.

Thanks,  
Jeremy

* * *

Termination Reason: Namespace DYLD, Code 1 Library missing  
Library not loaded: @rpath/libgvplugin\_neato\_layout.6.dylib  
Referenced from: /Users/USER/\*/MyApp.app/Contents/MacOS/MyApp  
Reason: tried: ‘/Users/jaf/sandbox/apps/MyApp/build/release/MyApp.app/Contents/Frameworks/libgvplugin\_neato\_layout.6.dylib’ (no such file),  
‘/Users/jaf/qt-everywhere-src-5.15.14/qtbase/lib/libgvplugin\_neato\_layout.6.dylib’ (no such file),  
‘/System/Volumes/Preboot/Cryptexes/OS/Users/jaf/qt-everywhere-src-5.15.14/qtbase/lib/libgvplugin\_neato\_layout.6.dylib’ (no such file),  
‘/Users/jaf/sandbox/apps/MyApp/build/release/MyApp.app/Contents/Frameworks/libgvplugin\_neato\_layout.6.dylib’ (no such file),  
‘/Users/jaf/qt-everywhere-src-5.15.14/qtbase/lib/libgvplugin\_neato\_layout.6.dylib’ (no such file),  
‘/System/Volumes/Preboot/Cryptexes/OS/Users/jaf/qt-everywhere-src-5.15.14/qtbase/lib/libgvplugin\_neato\_layout.6.dylib’ (no such file),  
‘/usr/local/lib/libgvplugin\_neato\_layout.6.dylib’ (no  
(terminated at launch; ignore backtrace)

Thread 0 Crashed:  
0 dyld 0x7ff81c258c42 \_\_abort\_with\_payload + 10  
1 dyld 0x7ff81c272fd7 abort\_with\_payload\_wrapper\_internal + 82  
2 dyld 0x7ff81c273009 abort\_with\_payload + 9  
3 dyld 0x7ff81c1f78f0 dyld4::halt(char const\*) + 375  
4 dyld 0x7ff81c1f4b71 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const\*) + 4526  
5 dyld 0x7ff81c1f33bd start + 1805

---

<div class="post-metadata">

**Author:** ![jeremyf](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jeremyf](https://forum.graphviz.org/u/jeremyf)\
**Post date:** [July 7, 2023, 11:40am UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698/2 "2023-07-07T11:40:05Z")

</div>

Digging in to this a bit further, it appears that the problem arises because the GraphViz libraries are referenced via `@rpath` instead of via their absolute-file-paths:

```auto
$ otool -L ./MyApp.app/Contents/MacOS/MyApp
./MyApp.app/Contents/MacOS/MyApp:
        @rpath/libgvplugin_neato_layout.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        @rpath/libgvplugin_dot_layout.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        @rpath/libgvc.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        @rpath/libxdot.4.dylib (compatibility version 4.0.0, current version 4.0.0)
        @rpath/libcgraph.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        @rpath/libcdt.5.dylib (compatibility version 5.0.0, current version 5.0.0)
        @rpath/libpathplan.4.dylib (compatibility version 4.0.0, current version 4.0.0)
        /Users/jaf/sandbox/3rdparty/libsndfile/src/.libs/lib/libsndfile.1.dylib (compatibility version 2.0.0, current version 2.28.0)
        [...]

```

I’m not sure how/why that happens, though. Is there some way to force the absolute file-paths to be used in this case (e.g. as is done for `libsndfile.1.dylib` above)?

---

<div class="post-metadata">

**Author:** ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)\
**Post date:** [July 8, 2023, 1:03am UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698/3 "2023-07-08T01:03:14Z")

</div>

relevant codeI admire your optimism :-). In the last few months, with our failed migration to Mac M1 in gitlab, oops I forgot my homework, graphviz MacOS support has become so thin that MacOS is being “temporarily” dropped from the CI build in the hopes that we can at least make new releases again. John Ellson probably wrote the plugin loader and related config file code, long ago, and hopefully, is now relaxing on a beautiful beach somewhere.

It turns out the relevant code is: [lib/gvc/gvconfig.c · main · graphviz / graphviz · GitLab](https://gitlab.com/graphviz/graphviz/-/blob/main/lib/gvc/gvconfig.c#L293) which gives some hopes you could try setting the GVBINDIR [sic] environment variable. Otherwise, someone who feels motivated needs to read the code and try to reconstruct what is going on here.

Possibly someone else with more knowledge about this may want to weigh in.

Best regards  
Stephen North

---

<div class="post-metadata">

**Author:** ![smattr](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/smattr/32/85_2.png) [@smattr](https://forum.graphviz.org/u/smattr)\
**Post date:** [July 8, 2023, 6:21am UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698/4 "2023-07-08T06:21:07Z")

</div>

> [@jeremyf](#):
>
> I tried adding the path to the plugins to my `LD_LIBRARY_PATH` environment variable

I think you want `DYLD_LIBRARY_PATH` on macOS.

---

<div class="post-metadata">

**Author:** ![jeremyf](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jeremyf](https://forum.graphviz.org/u/jeremyf)\
**Post date:** [July 8, 2023, 1:27pm UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698/5 "2023-07-08T13:27:31Z")

</div>

Yes, setting `DYLD_LIBRARY_PATH` did the trick. Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)\
**Post date:** [July 8, 2023, 5:31pm UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698/6 "2023-07-08T17:31:18Z")

</div>

Thanks. We should document this, er, somewhere.

---

<div class="post-metadata">

**Author:** ![tonyvsuk](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@tonyvsuk](https://forum.graphviz.org/u/tonyvsuk)\
**Post date:** [July 12, 2025, 12:36pm UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698/7 "2025-07-12T12:36:55Z")

</div>

> [@jeremyf](#):
>
> `DYLD_LIBRARY_PATH`

I’m trying to get my app working with the graphviz dylibs and just found this post. It’s what I’ve been looking for. If I set the DYLD\_LIBRARY\_PATH in a terminal window and then launch my app, it works fine. Launch via a double click, it crashes.

Tried setting the environment variables in code when my app loads for the first time, things still crash. And it looks like there is no way to set the environment variable before the app bundle loads.

Is there any other way to do this? I’ve spent many hours trying to get this to work, only stumbled across this post. Is there an API call to set where the libs are loaded from?

Thanks in advance,

Tony.

---

<div class="post-metadata">

**Author:** ![smattr](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/smattr/32/85_2.png) [@smattr](https://forum.graphviz.org/u/smattr)\
**Post date:** [July 14, 2025, 7:03am UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698/8 "2025-07-14T07:03:59Z")

</div>

You could try using a wrapper?

```bash
$ cat - >wrapper.sh <<EOT
#/usr/bin/env bash

env DLYD_LIBRARY_PATH=/path/to/stuff /path/to/dot
EOT
$ chmod +x wrapper.sh

```

Alternatively, maybe you want the statically linked `dot_builtins` instead?

---

<div class="post-metadata">

**Author:** ![GraphVizDev](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@GraphVizDev](https://forum.graphviz.org/u/GraphVizDev)\
**Post date:** [January 29, 2026, 4:47pm UTC](https://forum.graphviz.org/t/specifying-graphviz-plugins-folder-under-macos/1698/9 "2026-01-29T16:47:27Z")

</div>

This works for us:

Swift: setenv(“GVBINDIR”, pathToDir, 1)

Objc: setenv(“GVBINDIR”, pathToDir, 1);
