]>
Commit | Line | Data |
---|---|---|
63ba5337 | 1 | How to install HepMC on your laptop (Linux/Mac OSX) and link to Pythia |
2 | ||
3 | Here are two alternative recipes, one simpler with a more recent version | |
4 | and one more flexible with an older one. | |
5 | Note: This comes with no guarantee; it is what worked for me. | |
6 | Other combinations should also work, but have not been tried. | |
7 | ||
8 | ------------------------------------------------------------------------ | |
9 | ||
10 | Alternative A, with HepMC 2.06.08. | |
11 | ||
12 | 1) Create a directory where you want to do the installation, e.g. | |
13 | mkdir hepmc | |
14 | and move to it | |
15 | cd hepmc | |
16 | ||
17 | 2) Open | |
18 | http://lcgapp.cern.ch/project/simu/HepMC/download | |
19 | in a browser, scroll down to "HepMC 2.06.08" and pick the version relevant | |
20 | for your platform from the list to the right. If there is no match, you | |
21 | have to go for Alternative B below. | |
22 | ||
23 | 3) In the pop-up menu pick "Save to file" and then the above hepmc directory. | |
24 | You should now have the appropriate version in that directory, | |
25 | e.g. HepMC-2.06.08-x86_64-mac106-gcc42-opt.tar.gz on a current Mac. | |
26 | ||
27 | 4) Unpack with | |
28 | tar -xzf file.tar.gz | |
29 | with "file" the name of the downloaded file. This will create a new directory, | |
30 | e.g. x86_64-mac106-gcc42-opt/, where ready-to-use libraries can be found. | |
31 | ||
32 | 5) Now move to your pythia8160 (or later) directory and configure with | |
33 | ./configure --with-hepmc=mypath/hepmc/newdir --with-hepmcversion=2.06.08 | |
34 | where "mypath" is the absolute path to the hepmc directory (use pwd if | |
35 | in doubt) and "newdir" is the name of the new directory created in step 4. | |
36 | (Re)compile with "make" (or "gmake") as usual. | |
37 | ||
38 | 6) Move to the examples subdirectory and do | |
39 | source config.sh | |
40 | source config.csh | |
41 | Only one of them will work, depending on which shell you use, but the other | |
42 | should be harmless. | |
43 | ||
44 | 7) You should now be able to make and run e.g. main41 to produce HepMC | |
45 | output files. | |
46 | ||
47 | ------------------------------------------------------------------------ | |
48 | ||
49 | Alternative B, with HepMC 2.04.02. | |
50 | ||
51 | 1) Create a directory where you want to do the installation, e.g. | |
52 | mkdir hepmc | |
53 | and move to it | |
54 | cd hepmc | |
55 | ||
56 | 2) Open | |
57 | http://lcgapp.cern.ch/project/simu/HepMC/download | |
58 | in a browser, scroll down to "HepMC 2.04.02" and | |
59 | click on "source" rightmost on the line below. | |
60 | ||
61 | 3) In the pop-up menu pick "Save to file" and then the above hepmc directory. | |
62 | You should now have a file "HepMC-2.04.02.tar.gz" in that directory. | |
63 | ||
64 | 4) Unpack with | |
65 | tar -xzf HepMC-2.04.02.tar.gz | |
66 | ||
67 | 5) Create two new subdirectories | |
68 | mkdir build install | |
69 | and move to build | |
70 | cd build | |
71 | ||
72 | 6) Configure the compilation with | |
73 | ../HepMC-2.04.02/configure -prefix=mypath/hepmc/install -with-momentum=GEV -with-length=MM | |
74 | all on one line, where "mypath" is the absolute path to the hepmc directory | |
75 | (use pwd if in doubt). | |
76 | ||
77 | 7) Compile and install with | |
78 | make | |
79 | make check | |
80 | make install | |
81 | which takes a minute or two and an amount of output. | |
82 | ||
83 | 8) Now move to your pythia8160 (or later) directory and configure with | |
84 | ./configure --with-hepmc=mypath/hepmc/install --with-hepmcversion=2.04.02 | |
85 | (Re)compile with "make" (or "gmake") as usual. | |
86 | ||
87 | 9) Move to the examples subdirectory and do | |
88 | source config.sh | |
89 | source config.csh | |
90 | Only one of them will work, depending on which shell you use, but the other | |
91 | should be harmless. | |
92 | ||
93 | 10) You should now be able to make and run e.g. main41 to produce HepMC | |
94 | output files (you can ignore compilation warnings about variables being | |
95 | shadowed; this is harmless). | |
96 | ||
97 | NOTE: HepMC 2.04 allows you to set the units of the event record, | |
98 | i.e. to ensure that the Pythia default choice of GeV and mm (with c = 1) | |
99 | is propagated to the HepMC event record. This feature is not available | |
100 | in 2.03. The two test programs main31 and main32 therefore come with | |
101 | the Units code commented out, but with instructions how to restore it. |