Windows McStas
Kristian Nielsen
kristian.nielsen at risoe.dk
Thu Nov 12 08:41:39 CET 1998
> Thanks for the mail, and the link to the executable. I couldn't get
> the executable you supplied to run - well, it ran, but it couldn't find
> the components... But, with the hint you provided about compiling in 32
> bit mode, I did get it to work. I'm guessing that the version you
> provided was still using forward slashes to separate directories, but
> maybe not... Anyway, I've got a working version.
The slashes should be ok (at least it worked for us ...). Probably the
MCSTAS environment variable was not set correctly for you? Anyway, you
got a working version, I assume you set the correct path for MC_SYS_DIR
in the source when you fixed the forward/back slashes issue?
> The output code calls mcparseoptions from mcstas_main. In
> mcparseoptions, the first command is to allocate memory of 'mcnumipar *
> size...' I'm not too sure how mcnumipar is set, but when I ran this, it
> was set to 0. This is a problem, because the very next line checks to
> see if the memory was allocated, and ends the program if it was not.
> And, in DOS/Windows, memory allocation returns NULL if set to a size of
> 0.
Ah, another bug ... thanks for pointing that out. The mcnumipar variable
is set to the number of instrument parameters (the list in
"DEFINE INSTRUMENT name (...)" in the instrument definition). If the
instrument has no parameters, it will be zero as you observed.
> The simple fix is to change that line to say 'if (paramsetarray ==
> NULL && mcnumipar != 0)' Then everything works fine. I'm just not sure
> where that's written from in the original MCStas.
This code comes from the file "mcstas-r.c" in the "lib"
subdirectory. I will fix this in the next version.
- Kristian.
More information about the mcstas-users
mailing list