NMODL file in different folder

Particularly useful chunks of hoc and/or NMODL code. May be pedestrian or stunningly brilliant, may make you gasp or bring tears to your eyes, but always makes you think "I wish I had written that; I'm sure going to steal it."
Post Reply
Dradeliomecus
Posts: 5
Joined: Fri Jul 20, 2018 3:24 am

NMODL file in different folder

Post by Dradeliomecus » Thu Aug 23, 2018 7:14 am

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.

ted
Site Admin
Posts: 5370
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NMODL file in different folder

Post by ted » Thu Aug 23, 2018 11:24 am

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.

Dradeliomecus
Posts: 5
Joined: Fri Jul 20, 2018 3:24 am

Re: NMODL file in different folder

Post by Dradeliomecus » Mon Aug 27, 2018 5:49 am

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.

ted
Site Admin
Posts: 5370
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NMODL file in different folder

Post by ted » Mon Aug 27, 2018 11:03 am

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.

Dradeliomecus
Posts: 5
Joined: Fri Jul 20, 2018 3:24 am

Re: NMODL file in different folder

Post by Dradeliomecus » Thu Aug 30, 2018 4:33 am

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

Post Reply