Loading hoc library from other location

Post Reply
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Loading hoc library from other location

Post by Raj »

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.
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Loading hoc library from other location

Post by ted »

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.
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Re: Loading hoc library from other location

Post by Raj »

I have included in nrnenv:

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"
and the correct path names then appear when issuing

Code: Select all

echo $PATH
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

Code: Select all

load_file("../../../../nrn/share/lib/hoc/netbild/spkplotx.hoc")
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.
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: Loading hoc library from other location

Post by hines »

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.
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Re: Loading hoc library from other location

Post by Raj »

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

Code: Select all

 $N\share\lib\hoc\netbild
not

Code: Select all

$N\share\nrn\lib\hoc\netbild
. Of course that was the one thing I was not checking.

Thanks!
Post Reply