| 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.17 $ |
|---|
| 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 has been successfully compiled on Windows using Microsoft |
|---|
| 88 | Visual C++ in 32-bit mode. Define the preprocessor macro 'WIN32' when |
|---|
| 89 | compiling to get McStas to use the Windows file system |
|---|
| 90 | semantics. Search the archive of the mailing list |
|---|
| 91 | (http://neutron.risoe.dk/neutron-mc/) for details. As far as we know, |
|---|
| 92 | the front-end programs have not been used on Windows at this point. |
|---|
| 93 | |
|---|
| 94 | At Ris, we do not use McStas in Windows, so we cannot provide direct |
|---|
| 95 | support for this operating system. Try asking on the mailing list if you |
|---|
| 96 | need help. If you experience a specific problem with using McStas on |
|---|
| 97 | Windows, send a description of the problem to the mailing list so that |
|---|
| 98 | we can fix it in the next version. |
|---|
| 99 | |
|---|
| 100 | If you want to volunteer to provide Windows binaries to other users, |
|---|
| 101 | please contact kristian.nielsen@risoe.dk. |
|---|
| 102 | |
|---|
| 103 | Macintosh: |
|---|
| 104 | |
|---|
| 105 | McStas has been successfully compiled on the Macintosh using Code |
|---|
| 106 | Warrior. Define the preprocessor macro 'MAC' when compiling to get |
|---|
| 107 | McStas to use the Macintosh file system semantics. It is reportedly |
|---|
| 108 | necessary to increase the default size of memory allocated to programs |
|---|
| 109 | by the compiler to make the simulations work. It may also be necessary |
|---|
| 110 | to edit the default file paths in the file port.h, since environment |
|---|
| 111 | variables are (as far as we know) not available on the Macintosh. |
|---|
| 112 | |
|---|
| 113 | At Ris, we do not use McStas on the Macintosh, so we cannot provide |
|---|
| 114 | direct support for this system. Try asking on the mailing list if you |
|---|
| 115 | need help. If you experience a specific problem with using McStas on the |
|---|
| 116 | Macintosh, send a description of the problem to the mailing list so that |
|---|
| 117 | we can fix it in the next version. |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | Troubleshooting |
|---|
| 121 | =============== |
|---|
| 122 | |
|---|
| 123 | [Also see the FAQ at http://neutron.risoe.dk/mcstas/FAQ.html for |
|---|
| 124 | up-to-date help on common problems in McStas.] |
|---|
| 125 | |
|---|
| 126 | You should try to make sure that the directory containing the McStas |
|---|
| 127 | binaries (mcstas, gscan, mcdisplay, etc.) is contained in the PATH |
|---|
| 128 | environment variable. The default directory is /usr/local/bin, which is |
|---|
| 129 | usually, but not always, included in PATH. Alternatively, you can |
|---|
| 130 | reference the McStas programs using the full path name, ie. |
|---|
| 131 | |
|---|
| 132 | /usr/local/bin/mcstas my.instr |
|---|
| 133 | perl /usr/local/bin/mcrun -N10 -n1e5 mysim -f output ARG=42 |
|---|
| 134 | perl /usr/local/bin/mcdisplay --multi mysim ARG=42 |
|---|
| 135 | |
|---|
| 136 | This may also be necessary for the front-end programs if the install |
|---|
| 137 | procedure could not determine the location of the perl interpreter on |
|---|
| 138 | your system. |
|---|
| 139 | |
|---|
| 140 | If McStas is installed properly, it should be able to find the files it |
|---|
| 141 | needs automatically. If not, you should set the MCSTAS environment |
|---|
| 142 | variable to the directory containing the runtime files "mcstas-r.c" and |
|---|
| 143 | "mcstas-r.h" and the standard components (*.comp). Use one of |
|---|
| 144 | |
|---|
| 145 | MCSTAS=/usr/local/lib/mcstas; export MCSTAS # sh, bash |
|---|
| 146 | setenv MCSTAS /usr/local/lib/mcstas # csh, tcsh |
|---|
| 147 | |
|---|
| 148 | The PGPLOT library, which is used by the mcdisplay frontend, needs the |
|---|
| 149 | PGPLOT_DIR environment variable to be set to the directory containing |
|---|
| 150 | PGPLOT, eg. |
|---|
| 151 | |
|---|
| 152 | PGPLOT_DIR=/usr/lib/pgplot; export PGPLOT_DIR # sh, bash |
|---|
| 153 | setenv PGPLOT_DIR /usr/lib/pgplot # csh, tcsh |
|---|
| 154 | |
|---|
| 155 | See the PGPLOT documentation for details. |
|---|