mattmc88 wrote:if I place and then compile the exp2delay.mod file in the directory /src/nrnoc/ along with the other point mechanisms, and compile it
Don't do that. Don't put anything in NEURON's source code tree, or NEURON's installation tree. If you're working on a model that needs anything more than the built in mechanisms, put the mod files for the extra mechanisms into the same directory as your model's hoc and ses files, then compile them there. Please read
Suggestions for how to develop models
viewtopic.php?f=15&t=950
If I change the working directory to the one with exp2delay.mod in it, I now see exp2delay in the PointProcess Manager.
because NEURON automatically loads the nrnmech.dll file that it found there. It is best to put the mod file(s) in the same directory as your model's hoc file, and use mknrndll to create a nrnmech.dll there so it will be automatically loaded whenever you double click on your model's hoc file.
Is there a way to incorporate exp2delay.mod into Neuron so it doesn't have to be in the working directory?
Yes, but it would involve recompiling NEURON, and it would have many negative consequences.
1. Collisions in name space. Each mechanism needs a unique name (SUFFIX or POINT_PROCESS class name). There are many different variations of Na, K, Ca, Cl, Ih, leak etc. currents, each of which would have to be given its own name. Even in the course of model development it is often necessary to create slight variants, and compare them against each other. Every time you tried a new variant, you would have to cook up a new name for it and recompile NEURON. Name collisions would also occur if somebody else shared code with you. Following the recommended practice means that these situations never occur. Going to make a variant of a mod file? put the original in a subdirectory in case you have to revert to it (or, better yet, use a version control system like RCS, CVS, git, mercurial etc.). Want to try somebody else's model? Unzip it into a new directory and try it there, so the mechanism names in its mod files won't conflict with any of yours. Want to use somebody else's Ih mechanism in your model? If its SUFFIX is different from the SUFFIX of the Ih that you've been using, no problem. If it is the same, then either move your old mechanism's mod file into a subdirectory before copying the new one into the directory that contains your model's source code. The only time you have to be concerned about names is if you are in a situation where two essential mod files specify the same SUFFIX (or POINT_PROCESS class name). Then you decide which one whose name you will alter.
2. Separation of custom user-written mod files from the hoc and ses files that require them makes it more difficult to practice version control and keep track of which version of which mod file goes with which version of which hoc or ses file.
3. Model archiving and sharing would be much more difficult. With all user-written source code in one directory, just zip up all the hoc, ses, and mod files in that directory, and you have everything you need. Start putting mod files in NEURON's source code tree, and you have to remember the names of which mod files went with which hoc files.