OSX 10.4.11: problem using .mod files

Post Reply
fltchr
Posts: 4
Joined: Tue Nov 27, 2007 11:50 am
Location: Oberlin, OH

OSX 10.4.11: problem using .mod files

Post by fltchr »

I am learning to use .mod files and am at the point where I have successfully compiled a file but it does not appear that nrngui.app loads the results. I compiled a file in ~/Documents/nrn_mdls/mod_test/ and the result is the creation of a folder named /umac (or /i686, depending on the version of NEURON I am using) in the /mod_test folder. /umac seems to have everything necessary including the special executable. My problem is that I cannot get nrngui.app to load the new mechanism (an artificial cell). When I run nrngui.app (from /Applications/NEURON-n.n/nrngui.app) I get nothing saying that the new mechanism is loaded and the network builder does not show any new type of artificial cell.

I am running 10.4.11 on an intel MacBook. I have tried:
nrn-6.0.i386-apple-darwin8.dmg
nrn-6.1.MacOSX10.4.dmg,
nrn-5.9.i686-apple-darwin8.dmg (from the thread OSX 10.4.6 compiling mod files, which has been very helpful).
The artificial cell is the invlfire.mod example from chapter 11 in The NEURON Book.

Any ideas on what to do?

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

Post by ted »

I use Linux and occasionally MSWin, but one of the following suggestions may help:

Are you launching nrngui from the command line in a terminal, or from the GUI?

Under UNIX/Linux, when nrngui is started from the command line, NEURON will
automatically detect the existence of an i686 directory in the current working directory,
and load the compiled mechanisms.

Under any OS, if you are launching nrngui from the GUI, then click on
NEURON Main Menu / File / working dir
to get a tool that you can use to navigate to the directory that contains the i686 directory.
The mechanisms will then be loaded. Also, the next time you start nrngui, you can jump
right to that directory by
NEURON Main Menu / File / recent dir
and selecting one of the displayed paths.

Under MSWin, if mod files have been compiled in a directory, then double clicking on a
hoc file in that directory will load the compiled mechanisms. This should work under OS X,
or maybe you have to drag and drop the hoc file onto the nrngui icon. In any case,
to avoid having to navigate to the directory that contains the compiled mechanisms,
under MSWin one creates a dummy hoc file called init.hoc which contains one line
load_file("nrngui.hoc")
and puts a copy this file in the directory where the mechanisms were compiled. Double
clicking on that copy makes NEURON start, read the hoc library files that have the
same effect as starting nrngui, and loads the compiled mechanisms. This trick (or the
drag & drop variant) may work under OS X.

Please let me know which, if any, of these suggestions worked for you.
fltchr
Posts: 4
Joined: Tue Nov 27, 2007 11:50 am
Location: Oberlin, OH

Post by fltchr »

I got the mechanism loaded, thanks.

I tried all three of your suggestions. The command line and changing working directories in nrngui.app approaches did not work for either NEURON 5.9 or 6.1 Making a .hoc file containing only "load_file("nrngui.hoc")" in the directory containing both /umac and /i686 and opening that with NEURON works with 6.1 but not 5.9.

Thank you for the help.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

The command line method really ought
to work if you launched from the folder
containing the umac folder. Please
verify that under those conditions you did
not load the mod files and also tell us the
exact command line you used, and the
directory listing of the directory you launched from.

With regard to changing directories
after launching from the nrngui.app icon.
that will work only if you do not have a
umac folder in the directory it starts out
in since it only loads from its current working directory, once.
fltchr
Posts: 4
Joined: Tue Nov 27, 2007 11:50 am
Location: Oberlin, OH

Post by fltchr »

Using the commands:

Code: Select all

~/Documents/nrn_mdls/mod_test fletcher$ open /Applications/NEURON-6.1/nrngui.app/
or

Code: Select all

~/Documents/nrn_mdls/mod_test fletcher$ open ../../../../../Applications/NEURON-6.1/nrngui.app/
do not work. The /mod_test directory that I am in contains the umac folder. However:

Code: Select all

 open -a /Applications/NEURON-6.1/nrngui.app/ /Users/fletcher/Documents/nrn_mdls/mod_test/mc_init.hoc
does work. The -a flag causes open to use a specified application to open specified files. I guess that it is identical to the "drag and drop" method that also works for me.

I have verified if the mechanisms were loaded by checking Main Menu -> Tools -> Point processes -> viewers and by checking the oc> prompt.

Not sure if this is related but one time that the mechanisms were loaded I got the following error:

Code: Select all

loading membrane mechanisms from /Users/fletcher/Documents/nrn_mdls/mod_test/umac/.libs/libnrnmech.so
Additional mechanisms from files
 ampa.mod nmda.mod
oc: Bad file descriptor
/Applications/NEURON-6.1/nrn/umac/bin/nrniv.app/Contents/MacOS/nrniv: errno set during call of xpanel
 in /Applications/NEURON-6.1/nrn/share/nrn/lib/hoc/nrngui.hoc near line 2
 nrnmainmenu()
              ^
        1 
oc>
The error has not reappeared in multiple openings since.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

We generally use the unix style command line launching from a terminal window. ie.
from your mod_test folder try

Code: Select all

/Applications/NEURON-6.1/nrn/umac/bin/nrngui mc_init.hoc
I'm not familiar with the "open" command.
Post Reply