next up previous
Next: Binary install, Linux Up: Source code build Previous: Windows build

Unix build

McStas uses autoconf to detect the system configuration and create the proper Makefiles needed for compilation. On Unix-like systems, you should be able to compile and install McStas using the following steps:
  1. Unpack the sources to somewhere convenient and change to the source directory:
    gunzip -c mcstas-1.7-src.tar.gz | tar xf -
    cd mcstas-1.7/
  2. Configure and compile McStas:
    ./configure
    make
  3. Install McStas:
    make install

You should now be able to use McStas. For some examples to try, see the examples/ directory.

The installation of McStas in step 3 by default installs in the /usr/local/ directory, which on most systems requires superuser (root) privileges. To install in another directory, use the -prefix= option to configure in step 2. For example,

./configure -prefix=/home/joe

will install the McStas programs in /home/joe/bin/ and the library files needed by McStas in /home/joe/lib/mcstas/.

In case ./configure makes an incorrect guess, some environment variables can be set to override the defaults:

To use these options, set the variables before running ./configure. Eg.

setenv PERL /pub/bin/perl5

./configure

It may be necessary to remove configure's cache of old choices first:

rm -f config.cache

If you experience any problems, or have some questions or ideas concerning McStas, please contact peter.willendup@risoe.dk or the McStas mailing list at neutron-mc@risoe.dk.

You should try to make sure that the directory containing the McStas binaries (mcstas, gscan, mcdisplay, etc.) is contained in the PATH environment variable. The default directory is /usr/local/bin, which is usually, but not always, included in PATH. Alternatively, you can reference the McStas programs using the full path name, ie.

/usr/local/bin/mcstas my.instr

perl /usr/local/bin/mcrun -N10 -n1e5 mysim -f output ARG=42

perl /usr/local/bin/mcdisplay --multi mysim ARG=42

This may also be necessary for the front-end programs if the install procedure could not determine the location of the perl interpreter on your system.

If McStas is installed properly, it should be able to find the files it needs automatically. If not, you should set the MCSTAS environment variable to the directory containing the runtime files "mcstas-r.c" and "mcstas-r.h" and the standard components (*.comp). Use one of

MCSTAS=/usr/local/lib/mcstas; export MCSTAS # sh, bash

setenv MCSTAS /usr/local/lib/mcstas # csh, tcsh

To get a fully working McStas environment, you must also install an ANSI-c compiler, for instance gcc. A prebuilt package probably exists for your system. To get a functional graphical user interface and plotting facilities, you must also install the following packages:


next up previous
Next: Binary install, Linux Up: Source code build Previous: Windows build
Peter Willendrup 2003-05-20