Hi,
The first question - I have a neuron simulation, in which I use C code with VERBATIM. The C code is reused from this forum, I use it as a random number generator in rand.mod file (see below).
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
NEURON {
SUFFIX nothing
}
VERBATIM
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <values.h> /* contains MAXLONG */
#include <time.h>
#include <sys/time.h>
#if !defined(MAXLONG)
#include <limits.h>
#define MAXLONG RAND_MAX /*LONG_MAX*/
#endif
ENDVERBATIM
FUNCTION seed() {
VERBATIM
srandom((unsigned)time(NULL));
ENDVERBATIM
}
FUNCTION pois() {
VERBATIM
struct timeval tv;
time_t curtime;
gettimeofday(&tv, NULL);
curtime = tv.tv_usec;
srandom((unsigned)curtime);
_lpois = ((double)random()) / ((double)MAXLONG);
/*_lpois = - _lmean * log(((double)random()+1.) / ((double)MAXLONG+1.));*/
ENDVERBATIM
}
I can run my simulation pretty well in LINUX. Then I move the program to WINDOWS, after successful compilation, I double clicked mosinit.hoc to run it, however, I got the following errors,
Undefined symbol _random referenced from nrnmech.dll
Undefined symbol _time referenced from nrnmech.dll
Undefined symbol _srandom referenced from nrnmech.dll
Undefined symbol _gettimeofday referenced from nrnmech.dll
What do these really mean? Can windows neuron simulator compile C code in Verbatim?
The second question - how to use command line to execute the Neuron simulation? I will not use the popular "double click" on .hoc file to start the simulation because I have to run a huge statistical simulation and thus have to dispatch my jobs to a number of computers using Condor. I have to use windows batch file in which windows command lines are required.
Thank you for any suggestions.
Michael
Neuron simulator in Windows - two questions
Of the functions in the neuron executable, only the ones listed in nrn/src/mswin/windll/nrnmech.h and nrnmath.h can be called. You can call functions directly linked with libraries during the building of the nrnmech.dll file as well but that is not often done. ModelDB has an example of a mod file (vecst.mod) that contains a copy of the drand48,srand48 code.
The only experience I have had with command line is with the rxvt terminal.
However, I expect that the best way to launch is with nrniv.exe directly instead
of through the neuron.exe stub which calls lib/neuron.sh which calls lib/neuron2.sh which calls nrniv.exe.
Just take a look at those shell scripts to determine the proper environment variables.
The only experience I have had with command line is with the rxvt terminal.
However, I expect that the best way to launch is with nrniv.exe directly instead
of through the neuron.exe stub which calls lib/neuron.sh which calls lib/neuron2.sh which calls nrniv.exe.
Just take a look at those shell scripts to determine the proper environment variables.