README 5.7 KB
Newer Older
TOUZE Francois's avatar
TOUZE Francois committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
Compiling the UAP software:

-----------------------------------------------------------------------------------

Xerces Setup:

1) You will need a copy of the C++ Xerces library from Apache.  You
can put this library anywhere you want. It is probably a good idea to keep this
separate from the UAP software

A) Download the Apache Xerces library Version 3.X (Currently 3.1 is the latest) from: 
  <http://xml.apache.org/xerces-c>

B) Install the Apache Xerces library. The Apache web site has install instructions.

Example to install to <xerces-path>/local where <xerces-path> is the path to the Xerces 
installation and generally looks something like "/.../xerces-c-3.1.1" :
  cd <xerces-path>
  mkdir local
  ./configure --prefix=<xerces-path>/local
  gmake
  gmake install

Note: If you want to install in the default /usr/local then remove the --prefix switch.
Just remember you will need write permission to /usr/local if you want to install there.

B) Set the XERCESC_LIBROOT environmental variable to
point to the install directory. Typically you want to add a line in your
.cshrc file that looks like:
    setenv XERCESC_LIBROOT <xerces-path>/local
For bash put in your .bashrc file:
    export XERCESC_LIBROOT=<xerces-path>/local

D) Make the shaired libraries available. For linux, if you are using tcsh then put in your .cshrc file:

    if ( $?LD_LIBRARY_PATH ) then
      setenv LD_LIBRARY_PATH  ${LD_LIBRARY_PATH}:<xerces-path>/local/lib
    else
      setenv LD_LIBRARY_PATH  <xerces-path>/local/lib
    endif

For linux, if you are using bash then put in your .bashrc file:
    if [ $?LD_LIBRARY_PATH ]; then
      export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:<xerces-path>/local/lib
    else
      export LD_LIBRARY_PATH=<xerces-path>/local/lib
    fi

For other platforms see the Xerces instructions

-----------------------------------------------------------------------------------
Fortran Setup:

The default Fortran90 compiler is the intel ifort compiler. 

An open source alternitive is the gfortran compiler which comes with gcc. To use
this compiler set:
Using tcsh, in .cshrc file:
		setenv UAP_FORTRAN_COMPILER GFORTRAN
For bash, in .bashrc file:
		export UAP_FORTRAN_COMPILER=GFORTRAN

If you use a different compiler than ifort or gfortran, you need to modifiy the 
accelerator-ml/uap/trunk/Makefile file. 

-----------------------------------------------------------------------------------

Compiling UAP:

1) Go to the directory:
    accelerator-ml/uap/trunk

2) run gmake.

-----------------------------------------------------------------------------------

Test Programs:

* Test programs are in:
    accelerator-ml/uap/trunk/programs

Look at programs:
  translate_driver.cpp         For reading in a lattice file and converting to another format.
																	Supported formats: AML, XSIF, MAD-8, MAD-X, SAD, and Bmad.
  expansion_driver.cpp         For reading in an AML lattice file with lattice expansion.

* Test files for these programs are in:
    accelerator-ml/uap/trunk/test_files

* gmake will put the executables in:
    accelerator-ml/uap/trunk/bin

Note: Since the code is still in the developmental stage, the code is, by default, compiled
under debug. This will increase execution times.

-----------------------------------------------------------------------------------

Compiling Unit Tests:

You will need to download and install CPPUnit 1.12.1.

A) Download the CPPUnit distribution from:
<http://sourceforge.net/apps/mediawiki/cppunit/>

B) Install the CPPUnit library and set the CPPUNITROOT environmental variable to
point to directory where you installed CPPUnit.

C) Go to the directory:
    accelerator-ml/uap/trunk

D) run gmake unittests.

E) gmake will put the TestRunner driver executable in accelerator-ml/uap/trunk/bin.
 Run TestRunner to run the unit tests.

* Unit tests are in:
    accelerator-ml/uap/trunk/unit_tests

-----------------------------------------------------------------------------------

NOTE: THIS DOCUMENTATION IS OLD AND SHOULD NOT BE TRUSTED...

Setup on Windows XP, using Microsoft Visual C++ 2005 Express Edition

You will first need to download and install:
1.  MSVC++ 2005 Express Edition
2.  MS Platform SDK
3.  Xerces-c


1.  MSVC++ 2005 Express Edition is available as a free download from Microsoft:
http://msdn.microsoft.com/vstudio/express/visualc/
Follow the instructions given at the above url.

2.  For compiling Windows applications (including Xerces) you will need to install
Microsoft Platform SDK (Software Developers' Kit).  This is available as a free
download from:
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
Follow the instructions at this url, including the modifications to your MSVC++ 2005
installation.

3.  Download the source release of Xerces-c from:
http://xml.apache.org/xerces-c/download.cgi
(Look for the .zip archive under "Current Source Releases of Xerces-C".)
3a.  Unzip the archive (this can take a while!)
3b.  Browse to \xerces-c-current\xerces-c-src_2_8_0\Projects\Win32\VC7\xerces-all
3c.  Open the solution (xerces-all.sln) with MSVC++ 2005 Express Edition.
3d.  Follow the instructions for converting to MSVC8 format.
3e.  Build the project XercesLib.  This should generate a library file xerces-c_2.lib
in the directory \xerces-c-current\xerces-c-src_2_8_0\Build\Win32\VC7\Release

4.  Download the Accelerator-ml subversion repository.

5.  Open the "solution" Accelerator-ml\uap-vc\uap-vc.sln using MSVC++ 2005 Express Edition.

6.  Build the projects:
  AML
  ANTLR270
  BMAD
  MAD
  UAP
Each of these projects should generate a static library (.lib) file.

7.  Add all the libraries from step 6, plus the xerces-c_2.lib library from step 3, to
the project uap-vc.

8.  Add the required source files (e.g. bmad_driver.cpp) to the project uap-vc.

9.  Build and execute uap-vc.