McStas Windows installation instructions
The distribution packages for McStas may be downloaded via http://downloads.mcstas.org
Installing McStas 2.4 and later on Windows
See bottom of page for known issues for this platform.
- Download and install
(NOTE: Because of problems with the 64 bit gcc on windows, we only
provide a 32bit version on windows!
- The provided Strawberry Perl package, which also contains the
gcc compiler. IMPORTANT: Please uninstall any older version of
Perl before attempting to install the McStas bundle!
- The provided McStas metapackage - important:
Right-click and 'Run as Administrator', otherwise you easily get
some of the known issues listed below!
- The McStas meta package contains:
- Python 3 and dependencies (miniconda), also including the gcc compiler.
- McStas-specific extensions to Perl 5.18
- McStas code generator, components, instruments and datafiles
- The new set of Python McStas tools
- The "classic" McStas perl tools
- Optionally install iFit to visualize results using a Matlab environment (for free, no license needed).
- Optionally install a VRML/X3D plotter such as Freewrl or InstantReality.
- Optionally, you can install the NeXus format libraries to be able to export data files in HDF5.
The Windows installation bundle has no configurable options and
defaults to install McStas in
Start it after
installation by using the desktop links mcstas-2.4-shell and mcgui-2.4.
After installation, please place this
configuration file in your
folder (hint: run 'start %MCSTAS%' from the terminal and you should
get an explorer window in
Windows Subsystem for Linux (Win10 x64
As an alternative to the above approach, you can also run our Debian
Linux binaries directly under Windows via the WSL (Windows 10 64bit
and newer only.
Description and recipe:
Partnering with Ubuntu Linux, Microsoft has released the (experimental) feature "Windows subsystem for
Linux" (WSL), also known as "Bash on Ubuntu on Windows". Read more here and here.
It turns out that it is relatively straightforward to get McStas
running under this new feature - thereby overcoming some of the
annoyances of McStas on the Windows platform.
To try it out, please follow the below steps
- Install a copy of Windows 10 64 bit
- Update it beyond "Windows 10 Version 1607" - aka the "anniversary build"
- Enable "developer mode" in settings
- Use "turn features on or off" to enable "Bash in windows"
- Start bash via the start icon / cmd+esc
- Install McStas as usual on a Debian
systems. Also remember that you can easily install openmpi etc.
- Install and start the Xming X-server
- Turn back to your bash and execute
- export DISPLAY=localhost:0.0
- mcgui & or mcgui-py & (or any of the usual McStas commands)
As the feature is considered experimental, you might still find some
rough edges, but so far it seems functional and looks very promising!
A few extra tips:
- An easy way to access your data simulated under Linux is to run
from within your Windows home folder, accessible under Linux at
- Add Xming to your windows Startup items via "windows+r" key and
- Add the line export DISPLAY=localhost:0.0 to your Linux
Please report any trouble in using these instructions to email@example.com.
Known issues for the Windows platform - mostly obsolete from v. 2.4:
- You will have issues with Perl if more than one version
of Perl is installed at the same time. Please
- Use the windows add/remove software tool to remove any older
version of Perl before installing a new McStas
- Please fully remove both of the folders c:\perl and
c:\strawberry before installing a new McStas
- Our tool set does not fully support working directories
including spaces or other non-ascii characters. If you have an older Windows system with a user
account in c:\Documents and Settings we advice you to create and use
a working directory on the root of the drive e.g. c:\McStaswork
- We suggest to use our 32bit package for windows 64 also, since we feel the 64-bin gcc on
windows is not mature - gives problems in a few, specific cases. In any case, the 32-bit
McStas for windows works perfectly fine on a 64-bit operating system!
- If you are not able to start any simulation from mcgui - only
getting back the mcrun --help or the text "press any key to
continue", your Perl is likely not registered access all commandline
parameters. This can be remedied by
- Starting the regedit.exe program
- Searching for keys with content C:\strawberry\perl\bin\perl.exe
- Ensure that any entry like that includes a final %* like this:
HKEY_CLASSES_ROOT\Applications\perl.exe\shell\open\command = "C:\strawberry\perl\bin\perl.exe" "%1" %*
- If you experience strange behavior from perl/mcgui on Windows like
- ppm shell not being able to install the extra Perl
packages, i.e. no Tk module on the Perl PATH
- mcgui not being able to run / compile a simulation (all you get is mcrun -- help output)
- mcgui not being able to access local component files
- - Then the solution can be to ensure your user has "full control" to the executables in
c:\strawberry\perl\bin (Right-click the folder, Properties, Security, Authenticated users -> Edit)
Last modified: Thu May 18 14:38:55 CEST 2017
Last Modified: Thursday, 18-May-2017 14:40:02 CEST