using compiled mod files from python script in a different direcory
Posted: Wed Apr 29, 2020 5:43 pm
I am trying to organize my code for a simulation which uses several external mod files. I compile the mod files using nrnivmodl (Mac OS) and can use the channels without a problem as long as the nrnivmodl generated x86_64 directory is in the working directory from which I start my python script.
However, this will not always be the case, and starting my python script from any other directory fails to load the channels. Is there a specific, unambiguous way to load the compiled channels directly in a script (hoc or python) so that I do not have to depend on the simulation being run from the same directory as the compiled files?
I looked at but this does not seem to work (and there does not appear to be any .dll created on compilation with Mac OS or Linux.
The main reason I want to do this is for code organization. I would like to have all my mod files separate from my hoc and python files in an nmodl/ subdirectory and compile them within that directory whenever I change them.
My workaround now uses a makefile to copy then compile the mod files in all the directories of my project then delete them the mods, which is not ideal.
However, this will not always be the case, and starting my python script from any other directory fails to load the channels. Is there a specific, unambiguous way to load the compiled channels directly in a script (hoc or python) so that I do not have to depend on the simulation being run from the same directory as the compiled files?
I looked at
Code: Select all
nrn_load_dll("path/to/x86_64")
The main reason I want to do this is for code organization. I would like to have all my mod files separate from my hoc and python files in an nmodl/ subdirectory and compile them within that directory whenever I change them.
My workaround now uses a makefile to copy then compile the mod files in all the directories of my project then delete them the mods, which is not ideal.