Page 1 of 1

mknrndll not finding nrnunits.lib

Posted: Tue Apr 23, 2019 9:14 pm
by patoorio
Hi,

I wasn't sure whether to post this here or under the NMODL sub-forum, but finally posted here because it seems to be a Windows-specific issue.
With the last Neuron version (7.6.6), I'm getting the following error when trying to compile a .mod file that contains a UNITS block:

Code: Select all

c:\nrn/mingw/usr/bin/sh c:\nrn/lib/mknrndll.sh /cygdrive/c\nrn
x86_64-w64-mingw32-gcc -DDLL_EXPORT -DPIC -I/cygdrive/c\nrn/src/scopmath -I/cygdrive/c\nrn/src/nrnoc -I/cygdrive/c\nrn/src/oc  -c mod_func.c
nocmodl HHst
Translating HHst.mod into HHst.c
Set a MODLUNIT environment variable path to the units table file
Cant open units table in either of:
/cygdrive/C/nrn/lib/nrnunits.lib
/home/hines/neuron/nrnwinobj/share/nrn/lib/nrnunits.lib../../share/lib/nrnunits.lib at line 13 in file HHst.mod
UNITS {
      ^
make: *** [/cygdrive/c\nrn/lib/mknrndll.mak:25: HHst.c] Error 1

There was an error in the process of creating nrnmech.dll
Press Return key to exit
  • This happens at least in two different computers, running Windows and Neuron 7.6.6. I haven't tried now with older versions (yet), but last year this didn't happen.
  • .mod files that do not contain a UNITS block are compiled without problems.
  • The .mod files that I can't compile are successfully compiled under OS X.
  • The /cygdrive/C/nrn/lib/nrnunits.lib file is there!! I checked under the Neuron's own Bash terminal. For this reason, I didn't try to set the environment variable either. (why should I, if the program seems already to be looking in the right place?)
  • EDIT: I did try with

    Code: Select all

    set MODLUNIT=/cygdrive/c/nrn/lib/
    or

    Code: Select all

    set MODLUNIT=/cygdrive/c/nrn/lib/nrnunits.lib
    before running mknrndll (within the same Bash terminal session) but it didn't work either.
As always, I will appreciate any help!

Re: mknrndll not finding nrnunits.lib

Posted: Wed Apr 24, 2019 7:48 pm
by hines
Does the file
c:/nrn/lib/nrnunits.lib
exist in your installation?

Does mknrndll work in the bash terminal if you have
export MODLUNIT=/cygdrive/c/nrn/lib/nrnunits.lib

Make sure before running that you clean out the *.c and *.o files derived from *.mod


Looks like I have a problem with some script using /c/... instead of /cygdrive/c/...
The former no longer works with the newest msys2. I need to look for it and fix it and make a new distribution.

Re: mknrndll not finding nrnunits.lib

Posted: Wed Apr 24, 2019 10:04 pm
by patoorio
hines wrote: Wed Apr 24, 2019 7:48 pm Does the file
c:/nrn/lib/nrnunits.lib
exist in your installation?
Yes it does!
hines wrote: Wed Apr 24, 2019 7:48 pm Does mknrndll work in the bash terminal if you have
export MODLUNIT=/cygdrive/c/nrn/lib/nrnunits.lib
yes it works!!
(Previously I made the stupid mistake of using 'set' instead of 'export'... sorry, too much time away from a linux shell)
hines wrote: Wed Apr 24, 2019 7:48 pm Looks like I have a problem with some script using /c/... instead of /cygdrive/c/...
The former no longer works with the newest msys2. I need to look for it and fix it and make a new distribution.
Well, the message I get when I don't export the MODLUNIT variable is

Code: Select all

Cant open units table in either of:
/cygdrive/C/nrn/lib/nrnunits.lib
...
Can the problem be the capital 'C'? (it should be lower case, if I'm not wrong)

Re: mknrndll not finding nrnunits.lib

Posted: Wed Apr 24, 2019 10:10 pm
by hines
Yes. You noticed the contradiction
Cant open units table in either of:
/cygdrive/C/nrn/lib/nrnunits.lib
Where that is exactly the correct value for MODLUNIT (and if you export it as MODLUNIT the problem is fixed).
I need to do diagnostic runs to trace this to its most elementary source. Will get back when I know more.

Re: mknrndll not finding nrnunits.lib

Posted: Fri Apr 26, 2019 3:30 pm
by patoorio
Thank you!
I'll stay tuned

Re: mknrndll not finding nrnunits.lib

Posted: Sun Apr 28, 2019 8:40 am
by hines

Re: mknrndll not finding nrnunits.lib

Posted: Mon Apr 29, 2019 9:21 am
by patoorio
Great, thanks!