I am the dev of T2N, the Matlab-NEURON interface, where I also implemented auto compiling of the mod files.
For this I used this script which is modification of the original mknrndll.sh and which allows to hand over the NEURON path from Matlab via the console:
Code: Select all
if test -f $1/bin/cygpath ; then
N="`$1/bin/cygpath -u $1`"
PATH=$N/bin
else
N=$1
if test -d $N/mingw ; then
PATH=$N/mingw/bin:$PATH
fi
if test -d $N/bin64 ; then
PATH=$N/bin64:$PATH
else
PATH=$N/bin:$PATH
fi
fi
export PATH
export N
NEURONHOME=$N
export NEURONHOME
rm -f nrnmech.dll
sh $N/lib/mknrndl2.sh
echo ""
if [ -f nrnmech.dll ] ; then
echo "nrnmech.dll was built successfully."
else
echo "There was an error in the process of creating nrnmech.dll"
fi
If I provide $N as I always did with "/c/nrn" I first get an error
which I can easily fix by changing the call to sh in my script such that is calls it with "sh c:/nrn/lib/mkrnrndl2.sh". However, even with this fix I get errors in the subsequent NEURON scripts:sh: /c/nrn/lib/mknrndl2.sh: No such file or directory
make: /c/nrn/lib/mknrndll.mak: No such file or directory
make: *** No rule to make target '/c/nrn/lib/mknrndll.mak'. Stop.
If I provide $N as "C:/nrn" I get the error
x86_64-w64-mingw32-gcc -DDLL_EXPORT -DPIC -Ic:/nrn/src/scopmath -Ic:/nrn/src/nrnoc -Ic:/nrn/src/oc -c mod_func.c
make: x86_64-w64-mingw32-gcc: Command not found
make: *** [c:/nrn/lib/mknrndll.mak:67: mod_func.o] Error 127
Of course I can copy and modifiy NEURON's "mknrndl2.sh", too, to fix the issues happening in there, too, but I am trying to avoid this for obvious reasons (e.g. having to check for any modifications you did in these files in each new NEURON version).
As NEURON's mknrndll scripts in version 7.6.7 seem to work when using them as intended via NEURONs mknrndll on Windows (otherwise there would already be complaints I guess) there should be some way for making it work without having to change more than "mknrndll.sh", so I hope you can help me with the solution.
Thank you very much.