Problems running NEURON

Post Reply
xiaosage
Posts: 16
Joined: Sat May 11, 2013 10:01 am

Problems running NEURON

Post by xiaosage »

Hi,

I have installed NEURON v7.3 in my Macbook with OS X 10.7.5. And I have installed the Xcode v4.5 as well as the latest version of the command line developer tools to compile mod files as suggested.

The problem is, when I try to use terminal to run it, it shows "-bash: nrnivmodl: command not found".

I also tried to first double click the ion button and then drag the entire folder that contains the mod file into the terminal window, but after I enter the return button, the window disappeared with nothing changes in the file.

Could you please help me solve this problem? Many thanks.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Problems running NEURON

Post by ted »

Let me guess--you installed NEURON from the dmg, right?
Can you tell if NEURON is even on your path? In the terminal enter this command
echo $PATH
and tell me what you get.
xiaosage
Posts: 16
Joined: Sat May 11, 2013 10:01 am

Re: Problems running NEURON

Post by xiaosage »

Hi Ted,

Thanks for your reply! Your guess is exactly right, I installed NEURON from the dmg.

If I enter the command echo $PATH in the terminal, the following shows up,

applematoMacBook-Pro-3:~ apple$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Problems running NEURON

Post by ted »

Since your PATH environment variable does not contain NEURON, you can only compile mod files by dragging and dropping the folder that contains the mod files onto the mknrndll icon. I suppose there's a way to change your PATH variable so you will be able to compile mod files and launch NEURON from a terminal, but I'll have to find out exactly what has to be added to the PATH and get back to you.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Problems running NEURON

Post by ted »

OK, here's what to do. This assumes that you dragged NEURON into Applications.

First open a terminal and at the system prompt enter the command

Code: Select all

export PATH=/Applications/NEURON-7.3/nrn/x86_64/bin
Then in that terminal enter the command

Code: Select all

nrngui
NEURON should start up and the NEURON Main Menu toolbar should appear.

If that works, quit NEURON, and execute the command

Code: Select all

ls -a
Look for a file called .bashrc or .bash_profile.
Open that file with a plain text editor and insert the following line

Code: Select all

export PATH=/Applications/NEURON-7.3/nrn/x86_64/bin
then save the file.

Log out of OS X.
The next time you log in, you should be able to run nrngui, nrniv, and nrnivmodl (or mknrndll if that's what it's called in OS X) from the command line.
xiaosage
Posts: 16
Joined: Sat May 11, 2013 10:01 am

Re: Problems running NEURON

Post by xiaosage »

Hi Ted,

I try to follow your procedure, it's okay that I can run

Code: Select all

nrngui
after enter the command

Code: Select all

export PATH=/Applications/NEURON-7.3/nrn/x86_64/bin
But when I try to use

Code: Select all

ls -a
, the terminal returns command not found. It seems I cannot use any command after the export. Do you have any idea how to continue? Many thanks!
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Problems running NEURON

Post by ted »

Oops, that should have been

Code: Select all

export PATH=$PATH:/Applications/NEURON-7.3/nrn/x86_64/bin
If you can edit .bashrc or .bash_profile, whichever it was, and make this change, then log out and log back in, everything should be OK.
xiaosage
Posts: 16
Joined: Sat May 11, 2013 10:01 am

Re: Problems running NEURON

Post by xiaosage »

Yes, it works now. Thanks a lot!
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Problems running NEURON

Post by ted »

Glad to hear that it works.
Post Reply