mknrndll no compiling

Post Reply
kala
Posts: 2
Joined: Wed Jan 23, 2008 3:49 pm

mknrndll no compiling

Post by kala »

when i drop .mod file on mknrndll it gives me following output in terminal window:

./mknrndll.sh: line 22: cd: /Desktop/prknj/K22.mod: No such file or directory
/Applications/NEURON-6.2/nrn/umac/bin
*.mod
*.mod
make: *** No rule to make target `mod_func.c.lo', needed by `libnrnmech.la'. Stop.
Press 'return' key to close


what should I do to fix this problem?
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

What happens if you drag the folder
containing the mod file onto the icon?
kala
Posts: 2
Joined: Wed Jan 23, 2008 3:49 pm

Post by kala »

same message comes up
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

It is a very great puzzle to me how it can be the same message since the first line of your original error fragment is

Code: Select all

./mknrndll.sh: line 22: cd: /Desktop/prknj/K22.mod: No such file or directory 
means that the "change directory" command failed due to its filename argument. If you dragged a folder I would have expected at least that command to succeed. We should take this problem off line to email. Please send me all the output that appears in the terminal window when you drag the folder containing the mod file onto the icon. <michael.hines@yale.edu>
AlisonM

Re: mknrndll no compiling

Post by AlisonM »

I experienced the same problem as described above, receiving the same errors when I tried to drag either a single mod file or the folder containing that mod file onto mknrndll.
./mknrndll.sh: line 22: cd: /CompletedTools/ActionPotential 2: No such file or directory
.../NEURON-7.0/nrn/umac/bin
*.mod
*.mod
make: *** No rule to make target `mod_func.c.lo', needed by `libnrnmech.la'. Stop.
Press 'return' key to close
I was able to get around this problem by putting the folder with the mod file into the NEURON-7.0 folder (containing mknrndll), and then dragging the folder onto mknrndll - it compiled successfully, created the umac folder and all of its expected contents, and I could load my hoc file successfully. However, the hoc file would only load as long as the folder containing it remained in the NEURON-7.0 folder - if I try to move the folder anywhere else and load the hoc file, I get the following error:
-e
./nrngui.sh: line 68: cd: /CompletedTools/ActionPotential 2/ActionPotentialDemo.hoc: No such file or directory
As much as I understand it, it seems to be an issue with where NEURON thinks my file is versus where the file actually is. After I have unsuccessfully attempted to load the hoc file from its location outside the NEURON-7.0 folder, getcwd() returns the folder .../NEURON-7.0/nrn/umac/bin/, not the folder where my hoc file and associated files are located. What do I need to do to allow the hoc file to run from any location, not just from within the NEURON-7.0 folder?

Many thanks for any suggestions.
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: mknrndll no compiling

Post by hines »

The umac directory can be moved but you will need to edit the umac/special script
to change to the new absolute path.

However, mknrndll is supposed to work when you drag a folder. Try another test by putting the
folder into a location where the path has no spaces and see if that works.

Also run a terminal and see if you can
cd /CompletedTools
It is surprising to me that you have such a directory at the root of the filesystem, usually it is
a subdirectory of your $HOME
AlisonM

Re: mknrndll no compiling

Post by AlisonM »

From your comments, I think I figured out the mknrndll mystery (as well as your confusion regarding the location of /CompletedTools) - it was a folder on a flash drive, from which I had been attempting to run the hoc file, as well as compile the mod file. I pulled the folder onto the Desktop, and was able to successfully compile the mod file with mknrndll. It also seemed to appreciate getting rid of spaces in folder names - thanks for that suggestion.

As for getting the hoc file to run anywhere - is there a way to direct the special file to locate the umac folder in reference to the location of the hoc file (rather than one definite folder location), so that, as long as the umac folder is in the folder with the hoc file, the hoc file can still properly load what it needs from the umac folder? My goal is to be able to move the folder containing the hoc file and the umac folder around and still have the hoc file run, so that others are able to use it without difficulty.

Thanks for your help.
hines
Site Admin
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

Re: mknrndll no compiling

Post by hines »

Editing umac/special and using the proper relative path in the -dll arg should do
the trick.
AlisonM

Re: mknrndll no compiling

Post by AlisonM »

Beautiful! I used
./umac/.libs/libnrnmech.so
And it worked perfectly. Thanks.

As a semi-related question, am I correct in thinking that having users drag the hoc file they want to run onto nrngui.app should allow them to run the file, regardless of at what location they have NEURON installed (since undoubtedly it will be a different location than where I had NEURON installed when I compiled the mod file)? I noticed that the special file also references the location of NEURON's installation, but dragging the hoc file onto nrngui seemed to get around that problem. I'm not 100% sure, though. Basically, I'm attempting to remove the need for users to recompile the mod files with mknrndll, if at all possible.
ted
Site Admin
Posts: 5784
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: mknrndll no compiling

Post by ted »

AlisonM wrote:am I correct in thinking that having users drag the hoc file they want to run onto nrngui.app should allow them to run the file, regardless of at what location they have NEURON installed (since undoubtedly it will be a different location than where I had NEURON installed when I compiled the mod file)?
I don't have a Mac to try this with, but it's easy enough for you to test. What did you discover?
I'm attempting to remove the need for users to recompile the mod files with mknrndll, if at all possible.
Should be doable.

There is one circumstance under which it is always necessary to recompile: installation of a new version of NEURON.
AlisonM

Re: mknrndll no compiling

Post by AlisonM »

ted wrote:I don't have a Mac to try this with, but it's easy enough for you to test. What did you discover?
It worked fine to drag the hoc file onto nrngui.app, regardless of where the NEURON folder was. Actually, it worked fine to just double click on the hoc file regardless of where the folder was, up until I moved the NEURON folder in and then out of the Applications folder (then, NEURON wasn't able to open - I didn't copy down the exact error message but it was trying to reference something in the Applications folder even though it was no longer there). Regardless, dragging the hoc file onto nrngui.app again, even after that problem, still worked. And I guess if it doesn't work on the Mac of someone else trying to use the hoc file, they'll tell me pretty quickly!
There is one circumstance under which it is always necessary to recompile: installation of a new version of NEURON.
Good to know! I'm assuming that applies to all operating systems, not just OSX?

Thanks for the information.
ted
Site Admin
Posts: 5784
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: mknrndll no compiling

Post by ted »

You guessed correctly--mod files must be recompiled whenever a new version has been installed, under any operating system. It may be necessary to first delete any dll files, as well as any "intermediate files" (usually end with .c or .o) that may have been generated as byproducts of the previous compile.
Post Reply