mod files no longer compile with NEURON7.3

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
vellamike

mod files no longer compile with NEURON7.3

Post by vellamike » Tue May 28, 2013 8:41 pm

I have some mod files which would compile OK with nrnivmodl (using NEURON7.1). Now when I load them using NEURON 7.3 I get the following error:
In [1]: import neuron
NEURON -- Release 7.3 (849:5be3d097b917) 2013-04-11
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits

loading membrane mechanisms from x86_64/.libs/libnrnmech.so
dlopen failed -
x86_64/.libs/libnrnmech.so: undefined symbol: nrnmpi_myid
The output of nrnivmodl is:
Creating x86_64 directory for .o files.

/home/mike/dev/cortical-shape-modulation
na.mod
na.mod
"/usr/local/nrn/x86_64/bin/nocmodl" na
Translating na.mod into na.c
Notice: Assignment to the GLOBAL variable, "tadj", is not thread safe
"/usr/local/nrn/share/nrn/libtool" --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I"/usr/local/nrn/include/nrn" -I"/usr/local/nrn/x86_64/lib" -g -O2 -c -o na.lo na.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/nrn/include/nrn -I/usr/local/nrn/x86_64/lib -g -O2 -c na.c -fPIC -DPIC -o .libs/na.o
"/usr/local/nrn/share/nrn/libtool" --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I"/usr/local/nrn/include/nrn" -I"/usr/local/nrn/x86_64/lib" -g -O2 -c -o mod_func.lo mod_func.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/nrn/include/nrn -I/usr/local/nrn/x86_64/lib -g -O2 -c mod_func.c -fPIC -DPIC -o .libs/mod_func.o
"/usr/local/nrn/share/nrn/libtool" --tag=CC --mode=link gcc -module -g -O2 -o libnrnmech.la -rpath "/usr/local/nrn/x86_64/lib" na.lo mod_func.lo -L"/usr/local/nrn/x86_64/lib" -lnrnoc -loc -lmemacs -lscopmath -lsparse13 -lreadline -lncurses -L"/usr/local/nrn/x86_64/lib" "/usr/local/nrn/x86_64/lib/libnrniv.la" -livoc -lneuron_gnu -lmeschach -lsundials -lm -ldl
libtool: link: gcc -shared -fPIC -DPIC .libs/na.o .libs/mod_func.o -Wl,-rpath -Wl,/usr/local/nrn/x86_64/lib -Wl,-rpath -Wl,/usr/local/nrn/x86_64/lib -L/usr/local/nrn/x86_64/lib /usr/local/nrn/x86_64/lib/libnrnoc.so /usr/local/nrn/x86_64/lib/liboc.so /usr/local/nrn/x86_64/lib/libmemacs.so /usr/local/nrn/x86_64/lib/libscopmath.so /usr/local/nrn/x86_64/lib/libsparse13.so /usr/local/nrn/x86_64/lib/libreadline.so -lncurses /usr/local/nrn/x86_64/lib/libnrniv.so /usr/local/nrn/x86_64/lib/libivoc.so /usr/local/nrn/x86_64/lib/libneuron_gnu.so /usr/local/nrn/x86_64/lib/libmeschach.so /usr/local/nrn/x86_64/lib/libsundials.so -lm -ldl -O2 -pthread -Wl,-soname -Wl,libnrnmech.so.0 -o .libs/libnrnmech.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libnrnmech.so.0" && ln -s "libnrnmech.so.0.0.0" "libnrnmech.so.0")
libtool: link: (cd ".libs" && rm -f "libnrnmech.so" && ln -s "libnrnmech.so.0.0.0" "libnrnmech.so")
libtool: link: ( cd ".libs" && rm -f "libnrnmech.la" && ln -s "../libnrnmech.la" "libnrnmech.la" )
Successfully created x86_64/special
And the contents of the mod file in question (I am using only one mod file to try and simplify the problem):

COMMENT
26 Ago 2002 Modification of original channel to allow variable time step and to correct an initialization error.
Done by Michael Hines(michael.hines@yale.e) and Ruggero Scorcioni(rscorcio@gmu.edu) at EU Advance Course in Computational Neuroscience. Obidos, Portugal


na.mod

Sodium channel, Hodgkin-Huxley style kinetics.

Kinetics were fit to data from Huguenard et al. (1988) and Hamill et
al. (1991)

qi is not well constrained by the data, since there are no points
between -80 and -55. So this was fixed at 5 while the thi1,thi2,Rg,Rd
were optimized using a simplex least square proc

voltage dependencies are shifted approximately from the best
fit to give higher threshold

Author: Zach Mainen, Salk Institute, 1994, zach@salk.edu

ENDCOMMENT

INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}

NEURON {
SUFFIX na
USEION na READ ena WRITE ina
RANGE m, h, gna, gbar
GLOBAL tha, thi1, thi2, qa, qi, qinf, thinf
RANGE minf, hinf, mtau, htau
GLOBAL Ra, Rb, Rd, Rg
GLOBAL q10, temp, tadj, vmin, vmax, vshift
}

PARAMETER {
gbar = 1000 (pS/um2) : 0.12 mho/cm2
vshift = -10 (mV) : voltage shift (affects all)

tha = -35 (mV) : v 1/2 for act (-42)
qa = 9 (mV) : act slope
Ra = 0.182 (/ms) : open (v)
Rb = 0.124 (/ms) : close (v)

thi1 = -50 (mV) : v 1/2 for inact
thi2 = -75 (mV) : v 1/2 for inact
qi = 5 (mV) : inact tau slope
thinf = -65 (mV) : inact inf slope
qinf = 6.2 (mV) : inact inf slope
Rg = 0.0091 (/ms) : inact (v)
Rd = 0.024 (/ms) : inact recov (v)

temp = 23 (degC) : original temp
q10 = 2.3 : temperature sensitivity

v (mV)
dt (ms)
celsius (degC)
vmin = -120 (mV)
vmax = 100 (mV)
}


UNITS {
(mA) = (milliamp)
(mV) = (millivolt)
(pS) = (picosiemens)
(um) = (micron)
}

ASSIGNED {
ina (mA/cm2)
gna (pS/um2)
ena (mV)
minf hinf
mtau (ms) htau (ms)
tadj
}


STATE { m h }

INITIAL {
trates(v+vshift)
m = minf
h = hinf
}

BREAKPOINT {
SOLVE states METHOD cnexp
gna = tadj*gbar*m*m*m*h
ina = (1e-4) * gna * (v - ena)
}

LOCAL mexp, hexp

DERIVATIVE states { :Computes state variables m, h, and n
trates(v+vshift) : at the current v and dt.
m' = (minf-m)/mtau
h' = (hinf-h)/htau
}

PROCEDURE trates(v) {


TABLE minf, hinf, mtau, htau
DEPEND celsius, temp, Ra, Rb, Rd, Rg, tha, thi1, thi2, qa, qi, qinf

FROM vmin TO vmax WITH 199

rates(v): not consistently executed from here if usetable == 1

: tinc = -dt * tadj

: mexp = 1 - exp(tinc/mtau)
: hexp = 1 - exp(tinc/htau)
}


PROCEDURE rates(vm) {
LOCAL a, b

a = trap0(vm,tha,Ra,qa)
b = trap0(-vm,-tha,Rb,qa)

tadj = q10^((celsius - temp)/10)

mtau = 1/tadj/(a+b)
minf = a/(a+b)

:"h" inactivation

a = trap0(vm,thi1,Rd,qi)
b = trap0(-vm,-thi2,Rg,qi)
htau = 1/tadj/(a+b)
hinf = 1/(1+exp((vm-thinf)/qinf))
}


FUNCTION trap0(v,th,a,q) {
if (fabs(v/th) > 1e-6) {
trap0 = a * (v - th) / (1 - exp(-(v - th)/q))
} else {
trap0 = a * q
}
}
Has anyone seen this error before? I found what appears to be a related error here http://www.neuron.yale.edu/phpbb/viewto ... f=16&t=944 but this was not resolved.

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

Re: mod files no longer compile with NEURON7.3

Post by hines » Wed May 29, 2013 6:43 am

I've seen that problem on the mac and believe it is fixed with the changeset.
http://www.neuron.yale.edu/hg/neuron/nr ... 045d6239bb
Please try one of the mac dmg files at
http://www.neuron.yale.edu/ftp/neuron/versions/alpha/
depending on your osx. If you are not using mac, and you need an updated 7.3 distribution. I'll prepare one and upload it to the above url.
There have been a dozen or so other minor bug fixes for the Release 7.3 and it is probably time remake the distribution files.

vellamike

Re: mod files no longer compile with NEURON7.3

Post by vellamike » Wed May 29, 2013 2:11 pm

I'm afraid I'm using Ubuntu Linux. Could you submit the patch?

Many thanks!

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

Re: mod files no longer compile with NEURON7.3

Post by hines » Wed May 29, 2013 3:12 pm

The patch is in the hg repository. Are you building from the repository, the tar.gz file, or installing a deb file?

vellamike

Re: mod files no longer compile with NEURON7.3

Post by vellamike » Wed May 29, 2013 3:24 pm

I usually use the tar.gz files but I can clone from the repository - what is the repository URL?


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

Re: mod files no longer compile with NEURON7.3

Post by hines » Wed May 29, 2013 4:12 pm

Presently the trunk and 'Release 7.3' branch are alternating as the tip. After cloning I recommend
hg update 'Release 7.3'

vellamike

Re: mod files no longer compile with NEURON7.3

Post by vellamike » Wed May 29, 2013 4:14 pm

I'm having trouble compiling from source for some reason (I'm not sure why, the tar.gz compiled fine).

Make is giving the following error:
libtool: link: `ansi.lo' is not a valid libtool object
make[3]: *** [libmemacs.la] Error 1
make[3]: Leaving directory `/home/mike/neuron/nrn/src/memacs'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/mike/neuron/nrn/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mike/neuron/nrn'
make: *** [all] Error 2

vellamike

Re: mod files no longer compile with NEURON7.3

Post by vellamike » Wed May 29, 2013 4:36 pm

I fixed the previous compilation problem and now I'm encountering one I've not seen before when compiling neuron, searching on google hasn't thrown up much help:
parse1.y: In function ‘yyparse’:
parse1.y:139:3: error: ‘yyps’ undeclared (first use in this function)
parse1.y:139:3: note: each undeclared identifier is reported only once for each function it appears in
parse1.y:139:3: error: ‘yypv’ undeclared (first use in this function)
make[3]: *** [parse1.o] Error 1
make[3]: Leaving directory `/home/mike/dev/nrn/src/modlunit'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/mike/dev/nrn/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mike/dev/nrn'
make: *** [all] Error 2

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

Re: mod files no longer compile with NEURON7.3

Post by hines » Wed May 29, 2013 4:45 pm

Did that use yacc or bison? I generally use the latter. Anyway, I uploaded the following tar.gz file if you want to start from there.
http://www.neuron.yale.edu/ftp/neuron/v ... 875.tar.gz

vellamike

Re: mod files no longer compile with NEURON7.3

Post by vellamike » Wed May 29, 2013 4:48 pm

this helped me (I had byacc installed as well as bison, removing byacc seems to have solved the problem but only *after* I deleted the repository and cloned it again (I don't understand why that should have made a difference?)

vellamike

Re: mod files no longer compile with NEURON7.3

Post by vellamike » Wed May 29, 2013 5:10 pm

Its working! Thanks for the support. At first I thought it wasn't working but I'd forgotten to run nrnivmodl again.

Post Reply