Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions for custom modules are incomplete/outdated(?) #1331

jakobj opened this issue Nov 1, 2019 · 4 comments · Fixed by #1578

Instructions for custom modules are incomplete/outdated(?) #1331

jakobj opened this issue Nov 1, 2019 · 4 comments · Fixed by #1578


Copy link

jakobj commented Nov 1, 2019

When following the guidelines here for compiling and installing a custom module, NEST fails to load the module with the following error:

SLI ] (mymodule) Install

Nov 01 16:39:56 Install [Error]: DynamicModuleManagementError
    Module 'mymodule' could not be opened.
    The dynamic loader returned the following error: 'file not found'.

A possibly related issue is that during cmake NEST announces that the installation will be to a non-default directory, although -DCMAKE_INSTALL_PREFIX was not used:

The module will be installed into a non-default location!                                              
Make sure to set the environment variables:                                                              
  export NEST_MODULE_PATH=/home/jordan/opt/nest-simulator-mymodule/install/lib/nest:$NEST_MODULE_PATH     
  export SLI_PATH=/home/jordan/opt/nest-simulator-mymodule/install/share/nest/sli:$SLI_PATH  

Setting the NEST_MODULE_PATH, SLI_PATH variables does not fix the issue.

For some reason this can be fixed by setting LD_LIBRARY_PATH to {install}/lib and {install}/lib/nest:

$ export LD_LIBRARY_PATH=/home/jordan/opt/nest-simulator-mymodule/install/lib:$LD_LIBRARY_PATH
$ export LD_LIBRARY_PATH=/home/jordan/opt/nest-simulator-mymodule/install/lib/nest:$LD_LIBRARY_PATH
SLI ] (mymodule) Install

Nov 01 16:57:00 Install [Info]:
    loaded module My NEST Module

Could we please make the documentation on this topic a bit more precise, e.g., there seems to be a mismatch between the advice from cmake (setting NEST_MODULE_PATH) and the advice from the NEST binary (setting LD_LIBRARY_PATH)?
Additionally, the loader should be fixed to only require setting LD_LIBRARY_PATH once, if that problem is not specific to my setup (Debian buster 10.1).

@heplesser @jessica-mitchell

Copy link

Silmathoron commented Nov 2, 2019

Yes, this is also an issue in the context of NESTML and we should decide on a fix...
I briefly discussed it with @jougs and @clinssen here and I think that it would be best to include a check in cmake that the filename does not exist (with an option to overwrite mentioned if it does), then install directly in the NEST install lib folder.

Copy link

sarakonradi commented Apr 17, 2020

Mentioning #1513 here, as we are currently deciding there whether or not to keep NEST_MODULE_PATH in the first place.

Copy link

clinssen commented Apr 29, 2020

It looks like setting the runpath is not the solution here, as it was in #1545. When you type "(mymodule) Install", the dynamic loader ignores the configured runpaths (but looks at LD_LIBRARY_PATH); see for documentation.


  1. Manually add the relevant path using lt_dladdsearchdir(). It is however not clear how we should obtain the installation path in the C++ context (in
  2. Rely on (DY)LD_LIBRARY_PATH and change the documentation suggesting to source (which sets (DY)LD_LIBRARY_PATH).

Copy link

jougs commented Apr 29, 2020

I think option 1. is the one to use and that a #define NEST_LIBRARY_PATH "the/library/path" in libnestutil/ should nicely solve the problem. It could be set from within CMake as all the other macros are and used from within the DynamicLoader.

@jougs jougs self-assigned this Jun 22, 2020
Documentation automation moved this from To do to Done Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Successfully merging a pull request may close this issue.

6 participants