If you can't compile mod files . . .

hines
Site Admin
Posts: 1619
Joined: Wed May 18, 2005 3:32 pm

Re: If you can't compile mod files . . .

Post by hines »

Why the problem happens for you is a puzzle to me.
Googling values.h shows comments like

Code: Select all

/* This interface is obsolete.  New programs should use
   <limits.h> and/or <float.h> instead of <values.h>.  */
New systems, eg, mac clang compiler don't bother supporting the legacy values.h
LN_philippe
Posts: 5
Joined: Wed Apr 14, 2021 12:25 pm

Re: If you can't compile mod files . . .

Post by LN_philippe »

Hi everybody!

I'm new to NEURON :)
I'm using NEURON + python (spyder3 through anaconda). It worked OK until the error

" soma.insert('kv') # add potassium channel
ValueError: argument not a density mechanism name."

I wanted to compile the folder "mods" to deal with this issue. I followed the instructions in this website : https://www.neuron.yale.edu/neuron/stat ... macos.html

It seemed to work ok (no error message). However, the folder I get after dragging the "mods" folder onto mkrnrdll icon isn't named as it should be (it's named x86_64 instead of nrnmac.dll). Moreover, there is no .dll file in this folder, just .o and .c files.

I don't understand why it didn't compile ok. I made sure that I had Xcode + command line tools + XQuartz + mpi installed (and I made updates).
I'm running macOS Catalina 10.15.4 and NEURON 7-8

Can you help me ?

Thank you in advance,
LN
hines
Site Admin
Posts: 1619
Joined: Wed May 18, 2005 3:32 pm

Re: If you can't compile mod files . . .

Post by hines »

The web page referred to needs to be updated. The library is present in the x86_64 folder and will be automatically loaded if you launch nrniv in the
parent folder.
LN_philippe
Posts: 5
Joined: Wed Apr 14, 2021 12:25 pm

Re: If you can't compile mod files . . .

Post by LN_philippe »

Hi,
Thank you for your answer!
So if I understood this right, there is no issue with compilation?
Then, do you know why Spyder displays this message error? :
" soma.insert('kv') # add potassium channel
ValueError: argument not a density mechanism name."

Thank you again,
LN :)
hines
Site Admin
Posts: 1619
Joined: Wed May 18, 2005 3:32 pm

Re: If you can't compile mod files . . .

Post by hines »

Did you launch using a terminal from the parent folder of the x86_64 folder?
ted
Site Admin
Posts: 5885
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: If you can't compile mod files . . .

Post by ted »

why Spyder displays this message
implies launching from within Spyder. What does Spyder treat as the "working directory" and is there a way to make Spyder change that to the parent of the x86_64 directory?
hines
Site Admin
Posts: 1619
Joined: Wed May 18, 2005 3:32 pm

Re: If you can't compile mod files . . .

Post by hines »

One can always use

Code: Select all

from neuron import h
h.nrn_load_dll("/the/full/path/to/the/x86_64/libnrnmech.dylib")
LN_philippe
Posts: 5
Joined: Wed Apr 14, 2021 12:25 pm

Re: If you can't compile mod files . . .

Post by LN_philippe »

Thank you both for your responses,

When I do :

from neuron import h
>>> h.nrn_load_dll("/Applications/NEURON-7.8/mods/libnrnmech.dylib")

I get :

Additional mechanisms from files
"Ca_HVA.mod" "Ca_LVAst.mod" "CaDynamics_E2.mod" "epsp.mod" "Ih.mod" "Im.mod" "K_Pst.mod" "K_Tst.mod" "kv.mod" "na.mod" "Nap_Et2.mod" "NaTa_t.mod" "NaTs2_t.mod" "ProbAMPA.mod" "ProbAMPANMDA_EMS.mod" "ProbAMPANMDA.mod" "ProbAMPANMDA2_ratio.mod" "ProbGABAA_EMS.mod" "ProbGABAA.mod" "ProbGABAAB_EMS.mod" "ProbNMDA.mod" "SK_E2.mod" "SKv3_1.mod"
1.0

Which is an improvement!
However, after that, when I run my file, I still have :

h.soma.insert("kv") # add potassium channel
ValueError: argument not a density mechanism name.

This is weird, given the fact that the kv.mod has been loaded!
Do you know what's wrong?

Thank you for your help again,
LN
hines
Site Admin
Posts: 1619
Joined: Wed May 18, 2005 3:32 pm

Re: If you can't compile mod files . . .

Post by hines »

I wonder if "kv" is not the SUFFIX in the kv.mod file. In your mods folder, what is the result of

Code: Select all

grep -w kv *.mod
From another direction, what is the result of (after loading the dylib) of

Code: Select all

import neuron
dir(neuron.nrn)
print ("kv" in dir(neuron.nrn))
By the way, I generally don't add my user stuff under /Applications/NEURON as it can get lost when I drag that to the trash in order to upgrade to a new version.
LN_philippe
Posts: 5
Joined: Wed Apr 14, 2021 12:25 pm

Re: If you can't compile mod files . . .

Post by LN_philippe »

Hi!

I found a solution : a used another Spyder application (a newer one than the one I was using with anaconda).
I added the python paths and it worked! I don't understand why it's working this way and not with the other spyder application because I executed the same actions ...
I can use NEURON at last, that's the most important!

I thank you again for the help you gave me,
LN
ted
Site Admin
Posts: 5885
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: If you can't compile mod files . . .

Post by ted »

I found a solution
Great!

But just to help us better understand what the original problem was, could you please execute
grep -w kv *.mod
in the folder that contains your mod files, and tell us what it reported?
LN_philippe
Posts: 5
Joined: Wed Apr 14, 2021 12:25 pm

Re: If you can't compile mod files . . .

Post by LN_philippe »

oh yes of course sorry!

I had :

kv.mod:kv.mod
kv.mod: SUFFIX kv

(The suffix was OK, this is very puzzling aha ...)
Post Reply