Page 1 of 1

NMODL file in different folder

Posted: Thu Aug 23, 2018 7:14 am
by Dradeliomecus
Hi,

Is it possible to put all the NMODL files in a folder and tell hoc to go find the compiled nrnmech.dll in this folder?

And if it's possible, is it also possible to put them in 2 differents folders (like a folder "channels" and a folder "synapses") and tell hoc to look in these 2 folders?

Thanks.

Re: NMODL file in different folder

Posted: Thu Aug 23, 2018 11:24 am
by ted
Yes, but it's rarely useful. How are you ever going to share your code with anyone else? "Oh, that'll never happen." Right.

KISS--if a model needs a particular set of mechanisms, put the necessary mod files in the same directory as the other files that the model uses. If you can't live with that, put the mod files into a subdirectory of the one that contains the other files that the model needs. Then execute
nrnivmodl subdirname.

Re: NMODL file in different folder

Posted: Mon Aug 27, 2018 5:49 am
by Dradeliomecus
It's just that I have channels being used in different cells, and I'd like my folder architecture to be just one file (main hoc file) and subdirectories with "channels", "synapses", "cells"..., that way it'll be more understandable if I share my code and it'll be cleaner :)

How do you run nrnivmodl subdirname? That looks like what I'm looking for.

Thanks.

Re: NMODL file in different folder

Posted: Mon Aug 27, 2018 11:03 am
by ted
Every elaborate strategy is perfectly natural and intuitive to its inventor, but appears to be idiosyncratic and obscure to everyone else.

Apropos of which, it seemed to me that
nrnivmodl subdirname
was about as obvious as the nose on anyone's face, but apparently not. Let me try again.

If the working directory contains a subdirectory foo, and foo contains NMODL files,
nrnivmodl foo
will compile the NMODL files in foo.

Re: NMODL file in different folder

Posted: Thu Aug 30, 2018 4:33 am
by Dradeliomecus
Ok thanks.
So I guess my problem was actually that 'nrnivmodl' isn't recognized as a command, and what I want to do doesn't work with mknrndll.hoc.

I'll look into it, thank you for your help!
EDIT: It doesn't work on Windows: viewtopic.php?t=1909