nrnivmodl failing with duplicate definition of setstate

Post Reply
huguenard
Posts: 4
Joined: Wed Jan 26, 2011 7:41 pm

nrnivmodl failing with duplicate definition of setstate

Post by huguenard »

Hi,

This is on Centos 5.9 x86_64 with nrn-7.3 and iv-1.8. When we run nrnivmodl we get the following error in which setstate, which is created in the Ih.c file created from Ih.mod, is a duplicate function name declared in stdlib.h. Any help?

ampa.mod Ih.mod ITGHK.mod
ampa.mod Ih.mod ITGHK.mod
"/usr/local/nrn/share/nrn/libtool" --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 Ih.lo `test -f 'Ih.c' || echo '/'`Ih.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 Ih.c -fPIC -DPIC -o .libs/Ih.o
Ih.c:264: error: conflicting types for 'setstate'
/usr/include/stdlib.h:459: error: previous declaration of 'setstate' was here
make: *** [Ih.lo] Error 1
John H.
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: nrnivmodl failing with duplicate definition of setstate

Post by ted »

If "setstate" is a name defined in the NMODL file, the easy fix is to change it to something else. If not, send me the mod file so I can reproduce the problem and give you more specific advice.
ted dot carnevale at yale dot edu

PS--I coudn't find an Ih.mod in ModelDB that contains a "setstate" so I downloaded an Ih.mod selected at random, verified that nrnivmodl compiled it nicely, then changed the name of the block called by the SOLVE statement to setstate
i.e. made these substitutions

Code: Select all

:       SOLVE ihkin METHOD sparse
        SOLVE setstate METHOD sparse
and

Code: Select all

: KINETIC ihkin {
KINETIC setstate {
and sure enough, nrnivmodl complained

Code: Select all

error: conflicting types for ‘setstate’
/usr/include/stdlib.h:341: note: previous declaration of ‘setstate’ was here
make: *** [Ihx.lo] Error 1
So it is reasonable to expect that changing "setstate" in your mod file to some other name is a likely workaround. This particular mod file probably used the name ihkin because it's a KINETIC block. By analogy if it were a DERIVATIVE block one might have called it ihde or even ihderiv, either of which seems likely to be acceptable to compilation via nrnivmodl.
huguenard
Posts: 4
Joined: Wed Jan 26, 2011 7:41 pm

Re: nrnivmodl failing with duplicate definition of setstate

Post by huguenard »

Thanks Ted!

That fixed it. I renamed the function setstate2 within the mod file and bobs your uncle

john
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: nrnivmodl failing with duplicate definition of setstate

Post by ted »

Thanks for using NEURON in your research!
Post Reply