mknrndll not finding nrnunits.lib

Post Reply
patoorio
Posts: 81
Joined: Wed Jan 30, 2008 12:46 pm

mknrndll not finding nrnunits.lib

Post 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!
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: mknrndll not finding nrnunits.lib

Post 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.
patoorio
Posts: 81
Joined: Wed Jan 30, 2008 12:46 pm

Re: mknrndll not finding nrnunits.lib

Post 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)
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: mknrndll not finding nrnunits.lib

Post 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.
patoorio
Posts: 81
Joined: Wed Jan 30, 2008 12:46 pm

Re: mknrndll not finding nrnunits.lib

Post by patoorio »

Thank you!
I'll stay tuned
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: mknrndll not finding nrnunits.lib

Post by hines »

patoorio
Posts: 81
Joined: Wed Jan 30, 2008 12:46 pm

Re: mknrndll not finding nrnunits.lib

Post by patoorio »

Great, thanks!
Post Reply