1 | import os |
---|
2 | from fabric.api import run, env, cd |
---|
3 | |
---|
4 | |
---|
5 | ROOT_SOURCE = 'ftp://root.cern.ch/root/root_v5.34.05.source.tar.gz' |
---|
6 | ROOT_CFLAGS = ' '.join(['--enable-mathmore', |
---|
7 | '--enable-minuit2', |
---|
8 | '--enable-fftw3', |
---|
9 | '--enable-xml', |
---|
10 | '--prefix=/usr/local']) |
---|
11 | |
---|
12 | VTK_SOURCE = 'http://www.vtk.org/files/release/5.10/vtk-5.10.1.tar.gz' |
---|
13 | |
---|
14 | env.use_ssh_config = True |
---|
15 | env.user = 'root' |
---|
16 | env.hosts = ['compute1', |
---|
17 | 'compute2'] |
---|
18 | |
---|
19 | |
---|
20 | def wget(url): |
---|
21 | run('wget %s' % url) |
---|
22 | |
---|
23 | |
---|
24 | def untar(filename): |
---|
25 | run('tar xfz %s' % filename) |
---|
26 | |
---|
27 | |
---|
28 | def basepath(path): |
---|
29 | return os.path.join('$HOME', 'software', path) |
---|
30 | |
---|
31 | |
---|
32 | def fetch(): |
---|
33 | with cd(basepath('.')): |
---|
34 | wget(ROOT_SOURCE) |
---|
35 | untar(os.path.basename(ROOT_SOURCE)) |
---|
36 | |
---|
37 | wget(VTK_SOURCE) |
---|
38 | untar(os.path.basename(VTK_SOURCE)) |
---|
39 | |
---|
40 | |
---|
41 | def install(): |
---|
42 | fetch() |
---|
43 | |
---|
44 | with cd(basepath('root')): |
---|
45 | run('./configure %s' % ROOT_CFLAGS) |
---|
46 | run('make -j12') |
---|
47 | run('make install') |
---|
48 | |
---|
49 | with cd(basepath('VTK5.10.1')): |
---|
50 | run('cmake . -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release') |
---|
51 | run('make -j12') |
---|
52 | run('make install') |
---|
53 | |
---|
54 | |
---|
55 | def deploy(): |
---|
56 | run('zypper in gsl gsl-devel') |
---|
57 | install() |
---|
58 | run('ldconfig') |
---|