| 1 | __This is a draft__ |
| 2 | ---- |
| 3 | = HOWTO build CLHEP with Visual Studio 2005 == |
| 4 | |
| 5 | CLHEP is officially documented to build with VC7.1 but the switch to VC8 requires a little know-how to get the build steps right. This is because the VC8 compiler has a few features namely to prevent misuse or errorprone use of iterators, which render the CLHEP unusable. |
| 6 | |
| 7 | == Prerequisites == |
| 8 | |
| 9 | To successfully compile CLHEP you will need |
| 10 | * A working istallation of Visual Studio 2005 |
| 11 | * A CYGWIN setup including `autoconf`, `automake`, `make` and `tar` packages |
| 12 | |
| 13 | == Prepare the build environment == |
| 14 | |
| 15 | To provide the CLHEP build scripts with the necessary information, insert the following line just before the `bash --login -i` line in the `Cygwin.bat` file found in the base directory of your CYGWIN installation: |
| 16 | |
| 17 | {{{call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"}}} |
| 18 | |
| 19 | Create an installation directory for the CLHEP libraries. I suggest to use `C:\clhep` and the following steps will rely on this choice. |
| 20 | |
| 21 | == Download CLHEP == |
| 22 | |
| 23 | * Download the latest source package from http://proj-clhep.web.cern.ch/proj-clhep/ |
| 24 | * Move the downloaded file into your CYGWIN `var/tmp` directory usually located at `C:\cygwin\var\tmp` |
| 25 | * Enter the CYGWIN environment (by double-clicking the Cygwin symbol on your desktop) |
| 26 | |
| 27 | == Unpack, configure and build CLHEP == |
| 28 | |
| 29 | The following steps will build a debug and a release version of the CLHEP library. |
| 30 | |
| 31 | Execute the following commands: |
| 32 | |
| 33 | * `mkdir clhep; cd clhep` |
| 34 | * `tar xzf /var/tmp/clhep-*-src.tgz` |
| 35 | * `cd *; cd CLHEP` |
| 36 | * `mkdir debug; cd debug` |
| 37 | * `../configure --prefix=/cygdrive/c/clhep/debug` |
| 38 | * `make AM_CXXFLAGS="-Ehsc -nologo -GR -MDd -ZI -D_HAS_ITERATOR_DEBUGGING=0 -D_SECURE_SCL=0"` |
| 39 | * `make install` |
| 40 | * `cd ..; mkdir release; cd release` |
| 41 | * `../configure --prefix=/cygdrive/c/clhep` |
| 42 | * `make AM_CXXFLAGS="-Ehsc -nologo -GR -MD -D_HAS_ITERATOR_DEBUGGING=0 -D_SECURE_SCL=0"` |
| 43 | * `make install` |
| 44 | |
| 45 | If in the previous steps you have chosen an installation directory other than `C:\clhep`, please change the `--prefix=` parameters accordingly. |
| 46 | |
| 47 | You now have a ready-to-rock version of CLHEP installed on your system and are ready to proceed with [wiki:InstallationForVisualStudio building Rave] and of course you can skip the step of downloading the precompiled CLHEP package. |