Page 1 of 1

Which libnrnmech.so file to load on linux/mac

Posted: Fri Nov 17, 2017 8:42 am
by MBeining
I am testing a NEURON interface on different OS and I am a bit confused concerning the libnrnmech file which has to be loaded on linux/mac with the nrn_load_dll function in order to implement the compiled mechanisms.
The reason is that these files have slightly different names on different machines that my testers are using.

There is libnrnmech.so
but also libnrnmech.0.so
and libnrnmech.so.0

What is the reason behind that (I am a Windows user so no idea about linux/mac specific stuff)? How might a program know which file will be in the .libs/ folder that should be loaded?

Thank you in advance!

Re: Which libnrnmech.so file to load on linux/mac

Posted: Fri Nov 17, 2017 2:34 pm
by ted
Why bother with that level of detail? Just put the necessary mod files in the same directory as the main program (the hoc or Python file that starts everything), let prospective users compile them in that location, and let NEURON automatically find and load the binaries for itself when it starts up. It is generally a mistake to use OS-specific code, even when you think you're doing it to avoid OS-specific problems. If you don't deliberately create those problems in the first place, you won't have to fix them.

Re: Which libnrnmech.so file to load on linux/mac

Posted: Sat Nov 18, 2017 8:38 am
by MBeining
The problem is that, as the interface can start NEURON simulations in parallel, there are several folders each containing the hoc files for each run (e.g. several current steps for calculating an F-I relationship). Hence I would have to copy that x86_64 folder (or what ever it is called on that system) into each of these subfolders, which is not really ideal.

Re: Which libnrnmech.so file to load on linux/mac

Posted: Mon Nov 27, 2017 12:02 pm
by ted
The problem is that, as the interface can start NEURON simulations in parallel, there are several folders each containing the hoc files for each run (e.g. several current steps for calculating an F-I relationship). Hence I would have to copy that x86_64 folder (or what ever it is called on that system) into each of these subfolders, which is not really ideal.
I don't know anything about this "interface" that you are working with, but if it used MPI to take advantage of NEURON's bulletin-board-style parallelization, there would be no need to deal with multiple folders containing almost-duplicate hoc files and subdirectories with OS-specific binaries. Here's a tutorial written for hoc
https://www.neuron.yale.edu/ftp/ted/neu ... zation.zip
Use a browser to open bulletin_board_parallelization.html

It wouldn't take much to revise this for Python if that's your preferred language.