-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstallation.html
288 lines (279 loc) · 21.7 KB
/
installation.html
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Installation overview — CCTBX Developer documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/classic.css?v=def86cc0" />
<script src="_static/documentation_options.js?v=9c77bcdb"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Tour of the cctbx" href="tour.html" />
<link rel="prev" title="Computational Crystallography Toolbox" href="index.html" />
</head><body>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="tour.html" title="Tour of the cctbx"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Computational Crystallography Toolbox"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">CCTBX Developer documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">Installation overview</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<nav class="contents" id="table-of-contents" role="doc-toc">
<span id="installation"></span><p class="topic-title">Table of Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#installation-overview" id="id1">Installation overview</a></p></li>
<li><p><a class="reference internal" href="#manually-building-from-sources-under-linux-and-macos" id="id2">Manually building from sources under Linux and macOS</a></p></li>
<li><p><a class="reference internal" href="#manually-building-from-sources-under-windows-2000-or-higher" id="id3">Manually building from sources under Windows 2000 or higher</a></p></li>
</ul>
</nav>
<section id="installation-overview">
<h1><a class="toc-backref" href="#id1" role="doc-backlink">Installation overview</a><a class="headerlink" href="#installation-overview" title="Link to this heading">¶</a></h1>
<p>Periodically, the most recent cctbx source code including all its
dependencies is automatically exported from the source code repositories
(git) and bundled into compressed binary installers that are published
at:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference external" href="http://cci.lbl.gov/cctbx_build/">http://cci.lbl.gov/cctbx_build/</a></p></li>
</ul>
</div></blockquote>
<p>This web page provides compressed binary distributions for a
variety of platforms. It is most convenient to use these binary bundles
if possible. Installation is very simple and fast. After uncompressing the
bundle, run the <code class="docutils literal notranslate"><span class="pre">install</span> <span class="pre">--prefix=<installation</span> <span class="pre">location></span></code> command to
install on macOS and Linux. On Windows, uncompressing the zip file will provide
a working copy of cctbx. There is not installation script.</p>
</section>
<section id="manually-building-from-sources-under-linux-and-macos">
<h1><a class="toc-backref" href="#id2" role="doc-backlink">Manually building from sources under Linux and macOS</a><a class="headerlink" href="#manually-building-from-sources-under-linux-and-macos" title="Link to this heading">¶</a></h1>
<p>Please note: <strong>The following instructions are for developers!</strong></p>
<p>Building from sources requires Python 2.7, 3.6 or newer and a C++
compiler. If you like to use the most recent Python, it can be
installed in the following way:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tar</span> <span class="o">-</span><span class="n">xf</span> <span class="n">Python</span><span class="o">-</span><span class="mf">2.7.13</span><span class="o">.</span><span class="n">tar</span><span class="o">.</span><span class="n">xz</span>
<span class="n">cd</span> <span class="n">Python</span><span class="o">-</span><span class="mf">2.7.13</span>
<span class="o">./</span><span class="n">configure</span> <span class="o">--</span><span class="n">prefix</span><span class="o">=/</span><span class="n">your</span><span class="o">/</span><span class="n">choice</span>
<span class="n">make</span>
<span class="n">make</span> <span class="n">install</span>
</pre></div>
</div>
<p>It may be convenient (but is not required) to add the directory
<code class="docutils literal notranslate"><span class="pre">/your/choice/bin</span></code> to the command-line search <code class="docutils literal notranslate"><span class="pre">PATH</span></code>, e.g. using
<code class="docutils literal notranslate"><span class="pre">csh</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>set path=(/your/choice/bin $path)
</pre></div>
</div>
<p>Recent cctbx sources are available from the cctbx <a class="reference external" href="https://github.com/cctbx/cctbx_project/">GitHub</a> repository. To
download the repository and build cctbx, use bootstrap.py:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mkdir</span> <span class="o"><</span><span class="n">installation</span> <span class="n">directory</span><span class="o">></span>
<span class="n">cd</span> <span class="o"><</span><span class="n">installation</span> <span class="n">directory</span><span class="o">></span>
<span class="n">wget</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">raw</span><span class="o">.</span><span class="n">githubusercontent</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">cctbx</span><span class="o">/</span><span class="n">cctbx_project</span><span class="o">/</span><span class="n">master</span><span class="o">/</span><span class="n">libtbx</span><span class="o">/</span><span class="n">auto_build</span><span class="o">/</span><span class="n">bootstrap</span><span class="o">.</span><span class="n">py</span>
<span class="n">python</span> <span class="o">./</span><span class="n">bootstrap</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>On macOS, since <code class="docutils literal notranslate"><span class="pre">wget</span></code> is not available by default, use <code class="docutils literal notranslate"><span class="pre">curl</span></code> instead:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">curl</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">raw</span><span class="o">.</span><span class="n">githubusercontent</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">cctbx</span><span class="o">/</span><span class="n">cctbx_project</span><span class="o">/</span><span class="n">master</span><span class="o">/</span><span class="n">libtbx</span><span class="o">/</span><span class="n">auto_build</span><span class="o">/</span><span class="n">bootstrap</span><span class="o">.</span><span class="n">py</span> <span class="o">></span> <span class="n">bootstrap</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>After some time, this creates the subdirectories <code class="docutils literal notranslate"><span class="pre">base</span></code>, <code class="docutils literal notranslate"><span class="pre">base_tmp</span></code>,
<code class="docutils literal notranslate"><span class="pre">build</span></code>, and <code class="docutils literal notranslate"><span class="pre">modules</span></code>. The <code class="docutils literal notranslate"><span class="pre">base</span></code> directory contains dependencies for
cctbx, <code class="docutils literal notranslate"><span class="pre">base_tmp</span></code> is a temporary directory for compiling dependencies (can be
deleted), <code class="docutils literal notranslate"><span class="pre">build</span></code> contains the compiled cctbx code, and <code class="docutils literal notranslate"><span class="pre">modules</span></code> contains
the source code for cctbx. To keep <code class="docutils literal notranslate"><span class="pre">bootstrap.py</span></code> in your
<code class="docutils literal notranslate"><span class="pre"><installation</span> <span class="pre">directory></span></code> up-to-date with the version in <code class="docutils literal notranslate"><span class="pre">modules</span></code>, you
can create a symbolic link to that version:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o"><</span><span class="n">installation</span> <span class="n">directory</span><span class="o">></span>
<span class="n">rm</span> <span class="n">bootstrap</span><span class="o">.</span><span class="n">py</span>
<span class="n">ln</span> <span class="o">-</span><span class="n">s</span> <span class="o">./</span><span class="n">modules</span><span class="o">/</span><span class="n">cctbx_project</span><span class="o">/</span><span class="n">libtbx</span><span class="o">/</span><span class="n">auto_build</span><span class="o">/</span><span class="n">bootstrap</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>Within the <code class="docutils literal notranslate"><span class="pre">build</span></code> directory, cctbx creates a
file <code class="docutils literal notranslate"><span class="pre">setpaths.csh</span></code> (among others). This file must be used to
initialize a new shell or process with the cctbx settings:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">source</span> <span class="n">setpaths</span><span class="o">.</span><span class="n">csh</span>
</pre></div>
</div>
<p>There is also a <code class="docutils literal notranslate"><span class="pre">setpaths.sh</span></code> for <code class="docutils literal notranslate"><span class="pre">bash</span></code> users.</p>
<p>To update your cctbx installation to the latest version, you can just run:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="o">./</span><span class="n">bootstrap</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>again in the <code class="docutils literal notranslate"><span class="pre"><installation</span> <span class="pre">directory></span></code>. This will update the source code in
the <code class="docutils literal notranslate"><span class="pre">modules</span></code> directory and recompile the changes (if necessary) in
<code class="docutils literal notranslate"><span class="pre">build</span></code>. Occasionally, dependencies in <code class="docutils literal notranslate"><span class="pre">base</span></code> are updated. When this
happens, just delete the <code class="docutils literal notranslate"><span class="pre">base</span></code> and <code class="docutils literal notranslate"><span class="pre">base_tmp</span></code> directories and rerun
the <code class="docutils literal notranslate"><span class="pre">bootstrap.py</span></code> command.</p>
<p>To compile any local changes to the source code, enter the <code class="docutils literal notranslate"><span class="pre">build</span></code> directory
and run:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span>
</pre></div>
</div>
<p>This will actually run the <code class="docutils literal notranslate"><span class="pre">libtbx.scons</span></code> command using all
available CPUs. You can also manually specify the number of CPUs to
use, for example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">libtbx</span><span class="o">.</span><span class="n">scons</span> <span class="o">-</span><span class="n">j</span> <span class="mi">4</span>
</pre></div>
</div>
<p>Note that <code class="docutils literal notranslate"><span class="pre">libtbx.scons</span></code> is just a thin wrapper around <a class="reference external" href="http://www.scons.org/">SCons</a>. The
<a class="reference external" href="http://www.scons.org/doc/HTML/scons-man.html">SCons documentation</a> applies without modification.</p>
<p>To run scripts with cctbx imports use the command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">libtbx</span><span class="o">.</span><span class="n">python</span> <span class="n">your_script</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>(You can also use <code class="docutils literal notranslate"><span class="pre">scitbx.python</span></code>, <code class="docutils literal notranslate"><span class="pre">cctbx.python</span></code>, <code class="docutils literal notranslate"><span class="pre">iotbx.python</span></code>, etc.;
all these commands are equivalent.)</p>
<p>For example, to run some regression tests after the compilation is
finished enter:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>source build/setpaths_all.csh
libtbx.python $SCITBX_DIST/run_tests.py
libtbx.python $CCTBX_DIST/run_tests.py --Quick
</pre></div>
</div>
<p>The output should show many OK. A Python Traceback is an indicator
for problems.</p>
</section>
<section id="manually-building-from-sources-under-windows-2000-or-higher">
<h1><a class="toc-backref" href="#id3" role="doc-backlink">Manually building from sources under Windows 2000 or higher</a><a class="headerlink" href="#manually-building-from-sources-under-windows-2000-or-higher" title="Link to this heading">¶</a></h1>
<p>The cctbx installation requires Visual C++ 8.0 (Visual Studio .NET
2005) or higher.</p>
<p>To install Python under Windows it is best to use a binary
installer from the <a class="reference external" href="http://www.python.org/download/">Python download page</a>.
The default choices presented by the installation wizard are usually fine.</p>
<p>Recent self-contained cctbx sources are available in the
self-extracting file
<a class="reference external" href="http://cci.lbl.gov/cctbx_build/results/last_published/cctbx_bundle.exe">cctbx_bundle.exe</a>
published at the cctbx build page. To unpack this file in a new, empty
directory enter:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cctbx_bundle</span><span class="o">.</span><span class="n">exe</span>
</pre></div>
</div>
<p>This creates a subdirectory <code class="docutils literal notranslate"><span class="pre">cctbx_sources</span></code>. The installation
procedure should be executed in another directory, e.g.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mkdir</span> <span class="n">cctbx_build</span>
<span class="n">cd</span> <span class="n">cctbx_build</span>
<span class="n">C</span><span class="p">:</span>\<span class="n">python27</span>\<span class="n">python</span><span class="o">.</span><span class="n">exe</span> <span class="o">..</span>\<span class="n">cctbx_sources</span>\<span class="n">libtbx</span>\<span class="n">configure</span><span class="o">.</span><span class="n">py</span> <span class="n">mmtbx</span>
</pre></div>
</div>
<p>The last command initializes the <code class="docutils literal notranslate"><span class="pre">cctbx_build</span></code> directory and creates
a file <code class="docutils literal notranslate"><span class="pre">setpaths.bat</span></code> (among others). This file must be used to
initialize a new shell or process with the cctbx settings:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">setpaths</span><span class="o">.</span><span class="n">bat</span>
</pre></div>
</div>
<p>To compile enter:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">libtbx</span><span class="o">.</span><span class="n">scons</span>
</pre></div>
</div>
<p>On a machine with multiple CPUs enter:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">libtbx</span><span class="o">.</span><span class="n">scons</span> <span class="o">-</span><span class="n">j</span> <span class="n">N</span>
</pre></div>
</div>
<p>where N is the number of CPUs available.</p>
<p>Note that <code class="docutils literal notranslate"><span class="pre">libtbx.scons</span></code> is just a thin wrapper around <a class="reference external" href="http://www.scons.org/">SCons</a>. The
<a class="reference external" href="http://www.scons.org/doc/HTML/scons-man.html">SCons documentation</a> applies without modification.</p>
<p>To run scripts with cctbx imports use the command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">libtbx</span><span class="o">.</span><span class="n">python</span> <span class="n">your_script</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>(You can also use <code class="docutils literal notranslate"><span class="pre">scitbx.python</span></code>, <code class="docutils literal notranslate"><span class="pre">cctbx.python</span></code>, <code class="docutils literal notranslate"><span class="pre">iotbx.python</span></code>, etc.;
all these commands are equivalent.)</p>
<p>For example, to run some regression tests after the compilation is
finished enter:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">setpaths_all</span><span class="o">.</span><span class="n">bat</span>
<span class="n">libtbx</span><span class="o">.</span><span class="n">python</span> <span class="o">%</span><span class="n">SCITBX_DIST</span><span class="o">%</span>\<span class="n">run_tests</span><span class="o">.</span><span class="n">py</span>
<span class="n">libtbx</span><span class="o">.</span><span class="n">python</span> <span class="o">%</span><span class="n">CCTBX_DIST</span><span class="o">%</span>\<span class="n">run_tests</span><span class="o">.</span><span class="n">py</span> <span class="o">--</span><span class="n">Quick</span>
</pre></div>
</div>
<p>The output should show many OK. A Python Traceback is an indicator
for problems.</p>
<p><a class="reference external" href="introduction.html">Back</a></p>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Installation overview</a></li>
<li><a class="reference internal" href="#manually-building-from-sources-under-linux-and-macos">Manually building from sources under Linux and macOS</a></li>
<li><a class="reference internal" href="#manually-building-from-sources-under-windows-2000-or-higher">Manually building from sources under Windows 2000 or higher</a></li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Computational Crystallography Toolbox</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="tour.html"
title="next chapter">Tour of the cctbx</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/installation.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="tour.html" title="Tour of the cctbx"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="Computational Crystallography Toolbox"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">CCTBX Developer documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">Installation overview</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2014, University of California.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.4.7.
</div>
</body>
</html>