| 1 | /******************************************************************************* |
|---|
| 2 | * |
|---|
| 3 | * McStas, neutron ray-tracing package |
|---|
| 4 | * Copyright 1997-2002, All rights reserved |
|---|
| 5 | * Risoe National Laboratory, Roskilde, Denmark |
|---|
| 6 | * Institut Laue Langevin, Grenoble, France |
|---|
| 7 | * |
|---|
| 8 | * Documentation: INSTALL |
|---|
| 9 | * |
|---|
| 10 | * %Identification |
|---|
| 11 | * Written by: KN |
|---|
| 12 | * Date: 1997 |
|---|
| 13 | * Origin: Risoe |
|---|
| 14 | * Release: all McStas |
|---|
| 15 | * Version: $Revision: 1.18 $ |
|---|
| 16 | * |
|---|
| 17 | * This file is part of McStas. |
|---|
| 18 | * It details the installation procedure |
|---|
| 19 | * |
|---|
| 20 | *******************************************************************************/ |
|---|
| 21 | |
|---|
| 22 | NOTE: This document is obsolete - please refer to the documents in |
|---|
| 23 | |
|---|
| 24 | install_docs/tex/install.* |
|---|
| 25 | install_docs/html/install.html |
|---|
| 26 | |
|---|
| 27 | McStas uses autoconf to detect the system configuration and create the |
|---|
| 28 | proper Makefiles needed for compilation. On Unix-like systems, you |
|---|
| 29 | should be able to compile and install McStas using the following steps: |
|---|
| 30 | |
|---|
| 31 | 1. Unpack the sources to somewhere convenient and change to the source |
|---|
| 32 | directory: |
|---|
| 33 | |
|---|
| 34 | gunzip -c mcstas-<release>.tar.gz | tar xf - |
|---|
| 35 | cd mcstas-<release>/ |
|---|
| 36 | |
|---|
| 37 | 2. Configure and compile McStas: |
|---|
| 38 | |
|---|
| 39 | ./configure |
|---|
| 40 | make |
|---|
| 41 | |
|---|
| 42 | 3. Install McStas: |
|---|
| 43 | |
|---|
| 44 | make install |
|---|
| 45 | |
|---|
| 46 | You should now be able to use McStas. For some examples to try, see the |
|---|
| 47 | examples/ directory. |
|---|
| 48 | |
|---|
| 49 | The installation of McStas in step 3 by default installs in the |
|---|
| 50 | /usr/local/ directory, which on most systems requires superuser (root) |
|---|
| 51 | privileges. To install in another directory, use the --prefix= option to |
|---|
| 52 | configure in step 2. For example, |
|---|
| 53 | |
|---|
| 54 | ./configure --prefix=/home/joe |
|---|
| 55 | |
|---|
| 56 | will install the McStas programs in /home/joe/bin/ and the library files |
|---|
| 57 | needed by McStas in /home/joe/lib/mcstas/. |
|---|
| 58 | |
|---|
| 59 | In case ./configure makes an incorrect guess, some environment variables |
|---|
| 60 | can be set to override the defaults: |
|---|
| 61 | |
|---|
| 62 | - The CC environment variable may be set to the name of the C compiler |
|---|
| 63 | to use (this must be an ANSI C compiler). This will also be used for |
|---|
| 64 | the automatic compilation of McStas simulations in mcgui and mcrun. |
|---|
| 65 | - CFLAGS may be set to any options needed by the compiler (eg. for |
|---|
| 66 | optimization or ANSI C conformance). Also used by mcgui/mcrun. |
|---|
| 67 | - PERL may be set to the path of the Perl interpreter to use. |
|---|
| 68 | |
|---|
| 69 | To use these options, set the variables before running ./configure. Eg. |
|---|
| 70 | |
|---|
| 71 | setenv PERL /pub/bin/perl5 |
|---|
| 72 | ./configure |
|---|
| 73 | |
|---|
| 74 | It may be necessary to remove configure's cache of old choices first: |
|---|
| 75 | |
|---|
| 76 | rm -f config.cache |
|---|
| 77 | |
|---|
| 78 | If you experience any problems, or have some questions or ideas |
|---|
| 79 | concerning McStas, please contact kristian.nielsen@risoe.dk. |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | Installing on non-Unix systems |
|---|
| 83 | ============================== |
|---|
| 84 | |
|---|
| 85 | Windows: |
|---|
| 86 | |
|---|
| 87 | McStas can be installed on Windows machines, including all support applications |
|---|
| 88 | (scilab, PGPLOT, VRML viewer, C compiler, perl, perl-Tk). The installer is a standard |
|---|
| 89 | executable. Launch it and follow the instructions. |
|---|
| 90 | |
|---|
| 91 | Macintosh: |
|---|
| 92 | |
|---|
| 93 | McStas can be installed on Mac OSX machines, including all support applications |
|---|
| 94 | (scilab, PGPLOT, PDL, VRML viewer, C compiler, perl, perl-Tk). |
|---|
| 95 | We provide a dmg installer containing information on the installation |
|---|
| 96 | procedure. |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | Troubleshooting |
|---|
| 100 | =============== |
|---|
| 101 | |
|---|
| 102 | [Also see the FAQ at http://mcstas.org/documentation/faq for |
|---|
| 103 | up-to-date help on common problems in McStas.] |
|---|
| 104 | |
|---|
| 105 | You should try to make sure that the directory containing the McStas |
|---|
| 106 | binaries (mcstas, gscan, mcdisplay, etc.) is contained in the PATH |
|---|
| 107 | environment variable. The default directory is /usr/local/bin, which is |
|---|
| 108 | usually, but not always, included in PATH. Alternatively, you can |
|---|
| 109 | reference the McStas programs using the full path name, ie. |
|---|
| 110 | |
|---|
| 111 | /usr/local/bin/mcstas my.instr |
|---|
| 112 | perl /usr/local/bin/mcrun -N10 -n1e5 mysim -f output ARG=42 |
|---|
| 113 | perl /usr/local/bin/mcdisplay --multi mysim ARG=42 |
|---|
| 114 | |
|---|
| 115 | This may also be necessary for the front-end programs if the install |
|---|
| 116 | procedure could not determine the location of the perl interpreter on |
|---|
| 117 | your system. |
|---|
| 118 | |
|---|
| 119 | If McStas is installed properly, it should be able to find the files it |
|---|
| 120 | needs automatically. If not, you should set the MCSTAS environment |
|---|
| 121 | variable to the directory containing the runtime files "mcstas-r.c" and |
|---|
| 122 | "mcstas-r.h" and the standard components (*.comp). Use one of |
|---|
| 123 | |
|---|
| 124 | MCSTAS=/usr/local/lib/mcstas; export MCSTAS # sh, bash |
|---|
| 125 | setenv MCSTAS /usr/local/lib/mcstas # csh, tcsh |
|---|
| 126 | |
|---|
| 127 | The PGPLOT library, which is used by the mcdisplay frontend, needs the |
|---|
| 128 | PGPLOT_DIR environment variable to be set to the directory containing |
|---|
| 129 | PGPLOT, eg. |
|---|
| 130 | |
|---|
| 131 | PGPLOT_DIR=/usr/lib/pgplot; export PGPLOT_DIR # sh, bash |
|---|
| 132 | setenv PGPLOT_DIR /usr/lib/pgplot # csh, tcsh |
|---|
| 133 | |
|---|
| 134 | See the PGPLOT documentation for details. |
|---|