Neuron simulator in Windows - two questions
Posted: Wed May 24, 2006 1:15 pm
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
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