error creating nrnmech.dll modeldb 195615 with python

Post Reply
mahtah
Posts: 3
Joined: Tue Jul 30, 2024 7:03 am

error creating nrnmech.dll modeldb 195615 with python

Post by mahtah »

Hello,

I'm trying to run this model: https://modeldb.science/195615

After unzipping the files, I opened up cmd and tried 'nrnivmodl' in the directory. It came up with the following:

Code: Select all

C:\Users\~\modeldb 195615\spidemo>nrnivmodl
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c mod_func.c
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c misc.c
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c: In function 'nokill_':
misc.c:326:10: error: 'SIGHUP' undeclared (first use in this function)
  326 |   signal(SIGHUP, SIG_IGN);
      |          ^~~~~~
misc.c:326:10: note: each undeclared identifier is reported only once for each function it appears in
make: *** [/cygdrive/c/nrn/bin//../lib/mknrndll.mak:26: misc.o] Error 1

There was an error in the process of creating nrnmech.dll
This is what i get when i try 'mknrndll':

Code: Select all

C:\Users\~\modeldb 195615\spidemo> mknrndll
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c mod_func.c
nocmodl cadad
Translating cadad.mod into cadad.c
Thread Safe
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c cadad.c
nocmodl cal2
Translating cal2.mod into cal2.c
Warning: Default 2 of PARAMETER cao will be ignored and set by NEURON.
Warning: Default 5e-05 of PARAMETER cai will be ignored and set by NEURON.
Thread Safe
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c cal2.c
nocmodl can_mig
Translating can_mig.mod into can_mig.c
Warning: Default 2 of PARAMETER cao will be ignored and set by NEURON.
Warning: Default 5e-05 of PARAMETER cai will be ignored and set by NEURON.
Thread Safe
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c can_mig.c
nocmodl h_kole
Translating h_kole.mod into h_kole.c
Thread Safe
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c h_kole.c
nocmodl kBK
Translating kBK.mod into kBK.c
Thread Safe
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c kBK.c
nocmodl kap_BS
Translating kap_BS.mod into kap_BS.c
Thread Safe
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c kap_BS.c
nocmodl kdmc_BS
Translating kdmc_BS.mod into kdmc_BS.c
Thread Safe
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c kdmc_BS.c
nocmodl kdr_BS
Translating kdr_BS.mod into kdr_BS.c
Thread Safe
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c kdr_BS.c
nocmodl misc
Translating misc.mod into misc.c
Notice: VERBATIM blocks are not thread safe
x86_64-w64-mingw32-gcc.exe -DDLL_EXPORT -DPIC -I/cygdrive/c/nrn/bin//../include -I/cygdrive/c/nrn/bin//../src/scopmath -I/cygdrive/c/nrn/bin//../src/nrnoc -I/cygdrive/c/nrn/bin//../src/oc  -c misc.c
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c:49:22: error: expected ';', ',' or ')' before '->' token
   49 | #define t nrn_threads->_t
      |                      ^~
misc.c: In function 'nokill_':
misc.c:326:10: error: 'SIGHUP' undeclared (first use in this function)
  326 |   signal(SIGHUP, SIG_IGN);
      |          ^~~~~~
misc.c:326:10: note: each undeclared identifier is reported only once for each function it appears in
make: *** [/cygdrive/c/nrn/bin//../lib/mknrndll.mak:26: misc.o] Error 1

There was an error in the process of creating nrnmech.dll
I've also tried running the examples regardless and they failed to work, saying "LookupError: 'erev_ih' is not a defined hoc variable name."
I have also tried removing all the *.o, *.c, *.cpp, *.dll files from the folder (and there is no x86_64 folder).

I have NEURON 8.2.6 AMD64 on Windows 10. I also have some scripts in python calling neuron which seem to work fine.

Please let me know what I'm missing/what more information i should provide.
ted
Site Admin
Posts: 6358
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: error creating nrnmech.dll modeldb 195615 with python

Post by ted »

Under Linux nrnivmodl succeeds with 8.0a, 8.2.3, and 8.2.4 HEAD. I'll try with Windows.
ted
Site Admin
Posts: 6358
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: error creating nrnmech.dll modeldb 195615 with python

Post by ted »

Just did a fresh install of latest version of Anaconda Python and NEURON under Win 10--specifically NEURON 8.2.6+ HEAD dated 2024-07-24. neurondemo works fine, which confirms that at least some mod files can be compiled. But trying to compile the mod files from modeldb.science/195615 produces the same error msgs that you saw. Maybe those need to be revised, but I don't see guidelines for what changes might be necessary. That said, new releases aren't supposed to break previously working code, so maybe the latest version just has some bugs that need to be fixed. For now I'd suggest removing the most recent version of NEURON, and trying an earlier one.
ted
Site Admin
Posts: 6358
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: error creating nrnmech.dll modeldb 195615 with python

Post by ted »

Tried nrnivmodl with NEURON 8.2.2 under Win 10, and had the same problem. The killer error appears to be
'SIGHUP" undeclared

Apparently Windows doesn't have SIGHUP or anything equivalent to it--see http://stackoverflow.com/questions/3614020/ddg#3614203

If nrnivmodl is run under Windows and encounters an NMODL file that relies on things that are not available in Windows, like SIGHUP, it will generate an error message and quit. Models that require such mechanisms are incompatible with Windows.
mahtah
Posts: 3
Joined: Tue Jul 30, 2024 7:03 am

Re: error creating nrnmech.dll modeldb 195615 with python

Post by mahtah »

Hey Ted,

Thank you for looking into this, I really appreciate you going through reinstalling NEURON and anaconda.

So ultimately, is the model incompatible with Windows and can only be used on Linux? Do you know if there's a trivial way to make it compatible with windows, or shall I just pursue to try and run this in linux?
ted
Site Admin
Posts: 6358
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: error creating nrnmech.dll modeldb 195615 with python

Post by ted »

To quote my previous post
If nrnivmodl is run under Windows and encounters an NMODL file that relies on things that are not available in Windows, like SIGHUP, it will generate an error message and quit. Models that require such mechanisms are incompatible with Windows.
Do you know if there's a trivial way to make it compatible with windows
No. Windows has nothing equivalent to SIGHUP.

"Oh, but SIGHUP is only one little part of one NMODL file (misc.mod)--specifically, it's in PROCEDURE nokill(). Maybe the model itself doesn't use nokill, so I could comment it out and everything would be fine."

Maybe commenting out PROCEDURE nokill() will allow nrnivmodl to run to completion, but maybe not. nrnivmodl quits at the first serious error that it encounters. Maybe there are other problems waiting to be discovered by nrnivmodl.

But suppose that PROCEDURE nokill() is the only thing that gags nrnivmodl. So you get rid of nokill, and nrnivmodl runs to completion. Then you try executing a simulation. Three outcomes are possible: the simulation might crash, or it might grind away until you kill it, or it will execute to completion. The first two outcomes are clearly errors. But that doesn't mean that the third outcome means everything is fine. The worst kind of bug is the one that simply produces incorrect results without crashing or generating an error message.

So you have two practical choices.

1. Try to stick with Windows. Ask one of the model's authors if it uses nokill. If that person says no, then go ahead, comment it out, and see what happens.

2. Use the model under Linux.

In either case, if you do get it to run, be sure to compare simulation results with results published by the authors. Good luck!
mahtah
Posts: 3
Joined: Tue Jul 30, 2024 7:03 am

Re: error creating nrnmech.dll modeldb 195615 with python

Post by mahtah »

Thank you Ted.

I think i'll continue with linux.

I'm not sure how to mark this thread as resolved - please may you do this for me?
Post Reply