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