Windows McStas

Andrew Garrett agarrett at ccbsf0.kek.jp
Thu Nov 12 03:46:40 CET 1998


Kristian,

  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.

  Now, problem 2.  The output code from McStas has a problem, at least
when compiling under DOS/Windows.  It's a 1-line problem, but it does
need to be fixed.

  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.

  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.

  Thanks again for your help,

  Drew Garrett





More information about the mcstas-users mailing list