Page 2 of 2
Re: If you can't compile mod files . . .
Posted: Tue Jan 06, 2015 1:11 am
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
Re: If you can't compile mod files . . .
Posted: Thu Apr 15, 2021 5:00 am
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
Re: If you can't compile mod files . . .
Posted: Thu Apr 15, 2021 7:45 am
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.
Re: If you can't compile mod files . . .
Posted: Thu Apr 15, 2021 9:28 am
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 :)
Re: If you can't compile mod files . . .
Posted: Thu Apr 15, 2021 11:37 am
by hines
Did you launch using a terminal from the parent folder of the x86_64 folder?
Re: If you can't compile mod files . . .
Posted: Thu Apr 15, 2021 4:42 pm
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?
Re: If you can't compile mod files . . .
Posted: Thu Apr 15, 2021 7:20 pm
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")
Re: If you can't compile mod files . . .
Posted: Fri Apr 16, 2021 4:29 am
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
Re: If you can't compile mod files . . .
Posted: Fri Apr 16, 2021 7:26 am
by hines
I wonder if "kv" is not the SUFFIX in the kv.mod file. In your mods folder, what is the result of
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.
Re: If you can't compile mod files . . .
Posted: Fri Apr 16, 2021 8:19 am
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
Re: If you can't compile mod files . . .
Posted: Fri Apr 16, 2021 11:59 am
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?
Re: If you can't compile mod files . . .
Posted: Fri Apr 16, 2021 2:06 pm
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 ...)