Line too long error

NMODL and the Channel Builder.
Post Reply
jeh023

Line too long error

Post by jeh023 »

I have a very long CONSERVE statement in the KINETIC block of a channel model with a lot of states. Compiling produces the following error:

Translating na11_143.mod into na11_143.c
Line too long: CONSERVE c1+c2+c3+c4+c5+i1+i2+i3+i4+i5+i6+sc10+sc11+sc12+sc13+sc14+sc15+sc16+sc17+sc18+sc19+sc20+sc21+sc22+sc23+sc24+sc25+sc26+sc27+sc28+sc29+sc30+sc31+sc32+sc33+sc34+sc35+sc36+sc37+sc38+sc39+sc40+sc41+sc42+sc43+sc44+sc45+sc46+sc47+sc48+sc49+sc50+sc51+sc52+sc53+sc54+sc55+sc56+sc57+sc58+sc59+sc60+sc61+sc62+sc63+sc64+sc65+sc66+sc67+sc68+sc69+si10+si11+si12+si13+si14+si15+si16+si17+si18+si19+si20+si21+si22+si23+si24+si25+si26+si27+si28+si29+si30+si31+si32+si33+si34+si35+si36+si37+si38+si39+si40+si41+si42+si4 at line 616 in file na11_143.mod
CONSERVE c1+c2+c3+c4+c5+i1+i2+i3+i4+i5+i6+sc10+sc11+sc12+sc13+sc14+sc15+sc16+sc17+sc18+sc19+sc20+sc21+sc22+sc23+sc24+sc25+sc26+sc27+sc28+sc29+sc30+sc31+sc32+sc33+sc34+sc35+sc36+sc37+sc38+sc39+sc40+sc41+sc42+sc43+sc44+sc45+sc46+sc47+sc48+sc49+sc50+sc51+sc52+sc53+sc54+sc55+sc56+sc57+sc58+sc59+sc60+sc61+sc62+sc63+sc64+sc65+sc66+sc67+sc68+sc69+si10+si11+si12+si13+si14+si15+si16+si17+si18+si19+si20+si21+si22+si23+si24+si25+si26+si27+si28+si29+si30+si31+si32+si33+si34+si35+si36+si37+si38+si39+si40+si41+si42+si4
make: *** [na11_143.o] Error 1


Is there a way to break the statement into multple lines of code?
Also, what is the maximum line length before that error occurs?
hines
Site Admin
Posts: 1711
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

please send me your mod file.
michael.hines2yale.edu
it will save me the time of writing a test file.
Anyway, the limit is 512 characters per line.
That could be changed in nrn/src/nmodl/io.c
if you compiled the unix version. Just look for
the Fgets calls and where the buffer it uses
is declared and multiply those numbers by 10.
I would have thought you could break any line
at any whitespace but it appears that in this
case it is necessary to break them at points
in which a corresponding break in the c line
is valid. If you send me your mod file I will
look into whether and where there are valid
line break points. And perhaps adjust the
translator to generate c code
in a way that provides
more valid break points.
porio

Post by porio »

Have you thought about breaking your model?
With an allosteric way of thinking, many models with lots
of states can be reduced to an interaction between a few (2 or 3)
two-state equilibria (as far as I have seen, nobody postulates a
model with more than 20 states unless it is originated by allosteric activation).
This may not only eliminate your long CONSERVE statement but also simplify the equations and calculations maybe.
jeh023

Post by jeh023 »

I would have thought you could break any line
at any whitespace
Is it possible I didn't try that yesterday? Apparently, because breaking the line seemed to work.

Thanks
jeh023

Post by jeh023 »

jeh023 wrote: Apparently, because breaking the line seemed to work.
Interestingly, breaking the line works fine in NEURON on a Mac (OS X 10.4.2) but not in Windows XP. NEURON is the latest alpha version on both.

I can compile the mod file in both systems. On the Mac, everything proceeds normally and I can insert the channel and so forth. On the Windows system, I get the following error when I open a hoc file that tries to load the nrnmech.dll that includes my channel.

Error: unexpected relocation type 0

After that, NEURON seems to run normally, but I can only insert pas and hh; none of my mechanisms are available.
Post Reply