OpenMEEG error #134: dyld: library not loaded

Hey there,

I just updated brainstorm to the latest version and now I keep getting the following error when I attempt to compute an OpenMEEG head model (updated OpenMEEG as well).

OpenMEEG call: om_assemble -HM

OpenMEEG error #134
dyld: Library not loaded @rpath/libOpenMEEG.1.dylib
Referenced from: /Users/Jamoonie/.brainstorm/openmeeg/mac64/./om_assemble
Reason: image not found

It says that many openmeeg errors are due to memory and that I should reduce the number of vertices, but this has never been a problem before.
I've tried reinstalling brainstorm and that didn't work.

Thank you in advance!

@moon94 can you download:

extract the archive and then from a terminal go to the OpenMEEG-2.4.0-MacOSX/bin
folder when you run:

om_assemble -h

we recently updated openmeeg and you hit some bumps on the road…

thanks for reporting the problem


Thanks! I assume I extract it in the openmeeg folder?

Also, for some reason it’s saying that there is no command such as om_assemble, even though a file is clearly there…

EDIT: I did open with terminal on the om_assemble file instead and it seemed to work. Is there a specific folder all these contents should be in? I tried openmeeg on brainstorm again and it gave me the same error

sorry you need to run from the bin folder

./om_assemble -h

with a “.” and then a “/”


Thanks, but I keep getting the same error message.

@Francois I spoke to Alexandre about this issue that I’m facing and he suggested that I consult you to fix this problem. When I ran ./om_assemble -h on my terminal, everything seems to have worked, but Alexandre thinks that there may be a problem with brainstorm installation. He thinks that brainstorm moves around the libraries inappropriately when it installs.

Just to be clear, I downloaded openmeeg 2.4.0 and ran the om_assemble command in the bin folder and it seemed to work (still unclear where to put the contents of these folders). When I ran brainstorm>openmeeg, I still got the same error message as seen in the original post. I tried reinstalling brainstorm but the problem still persists.

I had the same issue which seems to be fixed by switching to openMEEG 2.2.0

see: Error in OpenMEEG

@bugnon the error you had with 2.3.99 looks similar but is actually unrelated.

@Francois or @Sylvain can you replicate the error? technically you should not need to move libraries to bin after extracting the openmeeg archive.

Could someone please help me either debug openmeeg 2.4.0 or revert to 2.2.0? I tried running ./om_assemble -h with 2.2.0 and I keep getting an error saying ‘cannot execute binary file’. I am in a rush to do some source localization analyses! Your help would be much appreciated!!

If you are under pressure, just use another head model for source analysis (e.g., sphere). It’s gonna be good enough to sift through your data. We’ll address the issue with openmeeg as soon as possible.

When Brainstorm installs OpenMEEG:

@bugnon @moon94: To test the versions Alex is sending you or use older versions downloaded from the OpenMEEG website, use the Brainstorm menu “Update > Update OpenMEEG > Install”.

@Alexandre: This logic doesn’t work anymore with 2.4 on macos then? It still works well on Windows and Linux. I can’t test it, I don’t have access to a mac at this moment. If you know what I should do, let me know.

@Sylvain: Can you please try to compute a BEM forward model on your mac?

@Francois I just tried what you do in Brainstorm (moving everything to bin folder)

it indeed breaks on mac (Library not loaded: @rpath/libOpenMEEG.1.dylib)

if you keep the libs in the lib folder it should work (i.e. just untar and keep things how they are).


@Alexandre OK, I will fix the code and make sure it does not move around the lib folders on macos, if you prefer it this way.

However, there is one intriguing thing I’d like to understand:
The folder $HOME/.brainstorm/openmeeg/ (where the lib files are moved to) is added to the DYLD_LIBRARY_PATH environment variable by bst_openmeeg.m. Do you have any idea why this was working before and does not work anymore? Are your binaries now trying to link the shared libraries from a fixed path instead of relying on DYLD_LIBRARY_PATH?

not sure what happens.

If I set DYLD_LIBRARY_PATH on my machine (after putting all in bin folder):


it works…

What we changed is the rpath of binaries so it works without hacking DYLD_LIBRARY_PATH or moving files.


I pushed this commit, which will keep the /bin and /lib subfolders only on MacOS:

Users facing this bug should just have to update Brainstorm and re-run the computation of a OpenMEEG forward model, it should update everything automatically on the OpenMEEG side.

I haven't tested this fix, I'm working blindly because I don't have access to a mac at the moment. I'd need someone with a MacOS system to try it.