Loading hoc library from other location
Loading hoc library from other location
I have two versions of NEURON installed. One by our system administrator on the network and the latest standard distribution locally. It turns out that when running the latest standard distribution I am not loading hoc from that distribution but hoc from the other earlier installed distribution. So naturally the following questions arises: Can I force NEURON to load the correct standard hoc libraries? Preferably just during startup, but if really needed also a local reinstall is an option.
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Loading hoc library from other location
If you are using UNIX/Linux and have control over your own PATH, you should be able to define where the shell looks for any command.
Re: Loading hoc library from other location
I have included in nrnenv:
a definition of neuronhome dir N followed by
and the correct path names then appear when issuing in bash.
I am trying to fix a problem in spkplot.hoc so I made my own toy version spkplotx.hoc containing the template SpikePlotX in $N/share/lib/hoc/netbild
resulting in the following output:
SpikePlotX is not a template
in test2.ses near line 81
{ocbox_ = new SpikePlotX(NetData[0],1)}
explicitly adding
to the code solves this problem ...
... but it implies that I get my standard hoc from elsewhere, i.e. the distribution on the network. Explicitly changing spkplot.hoc in the distribution I want to use confirms this.
So i tried to adjust the path but NEURON does not pick it up.
a definition of neuronhome dir N followed by
Code: Select all
export PATH="$N/share/lib/hoc:$N/share/lib/hoc/celbild:$N/share/lib/hoc/chanbild:$N/share/lib/hoc/import3d:$N/share/lib/hoc/lincir:$N/share/lib/hoc/mulfit:$N/share/lib/hoc/mview:$N/share/lib/hoc/netbild:$PATH"
Code: Select all
echo $PATH
I am trying to fix a problem in spkplot.hoc so I made my own toy version spkplotx.hoc containing the template SpikePlotX in $N/share/lib/hoc/netbild
resulting in the following output:
SpikePlotX is not a template
in test2.ses near line 81
{ocbox_ = new SpikePlotX(NetData[0],1)}
explicitly adding
Code: Select all
load_file("../../../../nrn/share/lib/hoc/netbild/spkplotx.hoc")
... but it implies that I get my standard hoc from elsewhere, i.e. the distribution on the network. Explicitly changing spkplot.hoc in the distribution I want to use confirms this.
So i tried to adjust the path but NEURON does not pick it up.
Re: Loading hoc library from other location
The PATH is not used by NEURON but only by the shell to find nrnivmodl, nrngui, etc and those are in (bash)
export PATH=$N/x86_64/bin:$PATH
or whatever the host cpu is for your machine.
Regardless of which nrniv is launched, you can force it to look for the standard hoc files by specifying
export NEURONHOME=$N/share/nrn
but I don't recommend using it and instead let nrniv figure it out from its install location. You can ask what the
NEURONHOME is within NEURON with the hoc command
neuronhome()
Lastly you can
export HOC_LIBRARY_PATH=path1:path2:...
to specify a list of paths to look in when one does a
load_file("filename")
but again, using that makes it more difficult to zip up a complete project and send it to someone.
export PATH=$N/x86_64/bin:$PATH
or whatever the host cpu is for your machine.
Regardless of which nrniv is launched, you can force it to look for the standard hoc files by specifying
export NEURONHOME=$N/share/nrn
but I don't recommend using it and instead let nrniv figure it out from its install location. You can ask what the
NEURONHOME is within NEURON with the hoc command
neuronhome()
Lastly you can
export HOC_LIBRARY_PATH=path1:path2:...
to specify a list of paths to look in when one does a
load_file("filename")
but again, using that makes it more difficult to zip up a complete project and send it to someone.
Re: Loading hoc library from other location
Aha, yes that works. I admit that I also was confused by other copies lingering around in the tree. Which might be a particularity of my copy, but I found and had opened in my editor copies from not . Of course that was the one thing I was not checking.
Thanks!
Code: Select all
$N\share\lib\hoc\netbild
Code: Select all
$N\share\nrn\lib\hoc\netbild
Thanks!