This file is indexed.

/usr/share/doc/libchemps2/html/sourcecode.html is in chemps2-doc 1.8.3-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>1. Installation &#8212; CheMPS2 1.8.3 (2016-11-15) documentation</title>
    
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '1.8.3 (2016-11-15)',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="/usr/share/javascript/jquery/jquery.js"></script>
    <script type="text/javascript" src="/usr/share/javascript/underscore/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="top" title="CheMPS2 1.8.3 (2016-11-15) documentation" href="index.html" />
    <link rel="next" title="2. Publications" href="publications.html" />
    <link rel="prev" title="CheMPS2 documentation" href="index.html" /> 
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <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="publications.html" title="2. Publications"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="CheMPS2 documentation"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">CheMPS2 1.8.3 (2016-11-15) documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <span class="target" id="index-0"></span><span class="target" id="index-1"></span><span class="target" id="index-2"></span><span class="target" id="index-3"></span><span class="target" id="index-4"></span><div class="section" id="installation">
<span id="index-5"></span><h1>1. Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h1>
<div class="section" id="dependencies">
<h2>1.1. Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline"></a></h2>
<p>CheMPS2 can be built with <a class="reference external" href="http://www.cmake.org/">CMake</a> and depends on</p>
<ul class="simple">
<li>BLAS</li>
<li>LAPACK</li>
<li>HDF5 (<a class="reference external" href="http://www.hdfgroup.org/HDF5/">Hierarchical Data Format Release 5</a>)</li>
</ul>
<p>It is parallelized for shared memory architectures with the Open Multi-Processing (<a class="reference external" href="http://openmp.org/wp/">OpenMP</a>) API and for distributed memory architectures with the Message Passing Interface (<a class="reference external" href="http://www.mpi-forum.org/">MPI</a>). A hybrid combination of both parallelization strategies is supported.</p>
</div>
<div class="section" id="download">
<h2>1.2. Download<a class="headerlink" href="#download" title="Permalink to this headline"></a></h2>
<p>It is advised to clone the CheMPS2 git repository from github. In your terminal, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /sourcefolder
$ git clone <span class="s1">&#39;https://github.com/sebwouters/chemps2&#39;</span>
$ <span class="nb">cd</span> chemps2
</pre></div>
</div>
<p>That way, future updates and bug fixes can be easily pulled in:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /sourcefolder/chemps2
$ git pull
</pre></div>
</div>
</div>
<div class="section" id="build-the-chemps2-library-and-binary">
<h2>1.3. Build the chemps2 library and binary<a class="headerlink" href="#build-the-chemps2-library-and-binary" title="Permalink to this headline"></a></h2>
<p>The files</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>/sourcefolder/chemps2/CMakeLists.txt
/sourcefolder/chemps2/CheMPS2/CMakeLists.txt
/sourcefolder/chemps2/tests/CMakeLists.txt
/sourcefolder/chemps2/sphinx/CMakeLists.txt
</pre></div>
</div>
<p>provide a minimal compilation. In your terminal, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /sourcefolder/chemps2
$ mkdir build
$ <span class="nb">cd</span> build
</pre></div>
</div>
<p>CMake generates makefiles based on the user&#8217;s specifications:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nv">CXX</span><span class="o">=</span>option1 cmake .. -DMKL<span class="o">=</span>option2 -DCMAKE_INSTALL_PREFIX<span class="o">=</span>/option3 -DWITH_MPI<span class="o">=</span>option4
</pre></div>
</div>
<ol class="arabic simple">
<li>Option1 is the <code class="docutils literal"><span class="pre">c++</span></code> compiler; typically <code class="docutils literal"><span class="pre">g++</span></code>, <code class="docutils literal"><span class="pre">icpc</span></code>, or <code class="docutils literal"><span class="pre">clang++</span></code> on Linux. It is advised to use the intel compiler if available.</li>
<li>Option2 can be <code class="docutils literal"><span class="pre">ON</span></code> or <code class="docutils literal"><span class="pre">OFF</span></code> and is used to switch on the intel math kernel library.</li>
<li>/option3 is the prefix of the installation directory; typically <code class="docutils literal"><span class="pre">/usr</span></code> or <code class="docutils literal"><span class="pre">/usr/local</span></code> on Linux. On my computer, libchemps2 is then installed in <code class="docutils literal"><span class="pre">/option3/lib/x86_64-linux-gnu/</span></code>, the headers in <code class="docutils literal"><span class="pre">/option3/include/chemps2/</span></code>, and the binary in <code class="docutils literal"><span class="pre">/option3/bin/chemps2</span></code>.</li>
<li>Option4 can be <code class="docutils literal"><span class="pre">ON</span></code> or <code class="docutils literal"><span class="pre">OFF</span></code> and is used to switch on the possibility to compile with MPI. Please note that the compiler should then provide <code class="docutils literal"><span class="pre">mpi.h</span></code>. Option1 should hence be the <code class="docutils literal"><span class="pre">mpic++</span></code> compiler; typically <code class="docutils literal"><span class="pre">mpic++</span></code> or <code class="docutils literal"><span class="pre">mpiicpc</span></code> on Linux. It is advised to use the intel compiler if available.</li>
</ol>
<p>If one or more of the required libraries are not found, use the command</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nv">CMAKE_INCLUDE_PATH</span><span class="o">=</span>option5 <span class="nv">CMAKE_LIBRARY_PATH</span><span class="o">=</span>option6 <span class="nv">CXX</span><span class="o">=</span>option1 cmake .. -DMKL<span class="o">=</span>option2 -DCMAKE_INSTALL_PREFIX<span class="o">=</span>/option3 -DWITH_MPI<span class="o">=</span>option4
</pre></div>
</div>
<p>instead, where option5 and option6 are respectively the missing colon-separated include and library paths:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nv">CMAKE_INCLUDE_PATH</span><span class="o">=</span>/my_libs/lib1/include:/my_libs/lib2/include
<span class="nv">CMAKE_LIBRARY_PATH</span><span class="o">=</span>/my_libs/lib1/lib:/my_libs/lib2/lib
</pre></div>
</div>
<p>For operating systems based on debian, the HDF5 headers are located in the folder <code class="docutils literal"><span class="pre">/usr/include/hdf5/serial/</span></code>. If CMake complains about the HDF5 headers, try to pass it with the option <code class="docutils literal"><span class="pre">-DHDF5_INCLUDE_DIRS=/usr/include/hdf5/serial</span></code>.</p>
<p>For building with GCC, errors involving unresolved symbols or a message <code class="docutils literal"><span class="pre">plugin</span> <span class="pre">needed</span> <span class="pre">to</span> <span class="pre">handle</span> <span class="pre">lto</span> <span class="pre">object</span></code> may indicate a failure of the interprocedural optimization. This can be resolved by passing full locations to gcc toolchain utilites to the <code class="docutils literal"><span class="pre">setup</span></code> command above: <code class="docutils literal"><span class="pre">-DCMAKE_RANLIB=/path/to/gcc-ranlib</span> <span class="pre">-DCMAKE_AR=/path/to/gcc-ar</span></code> .</p>
<p>To compile, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ make
</pre></div>
</div>
<p>To install, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ make install
</pre></div>
</div>
<p>For non-standard installation directories, please remember to append the library path to <code class="docutils literal"><span class="pre">LD_LIBRARY_PATH</span></code> in your <code class="docutils literal"><span class="pre">.bashrc</span></code>.</p>
</div>
<div class="section" id="test-libchemps2">
<h2>1.4. Test libchemps2<a class="headerlink" href="#test-libchemps2" title="Permalink to this headline"></a></h2>
<p>To test libchemps2 for compilation <strong>without MPI</strong>, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /sourcefolder/chemps2/build
$ make <span class="nb">test</span>
</pre></div>
</div>
<p>To test libchemps2 for compilation <strong>with MPI</strong>, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /sourcefolder/chemps2/build/tests
$ <span class="nv">OMP_NUM_THREADS</span><span class="o">=</span>YYY mpirun -np ZZZ ./test1
$ <span class="nv">OMP_NUM_THREADS</span><span class="o">=</span>YYY mpirun -np ZZZ ./test2
...
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">YYY</span></code> specifies the number of threads per process and <code class="docutils literal"><span class="pre">ZZZ</span></code> the number of processes. Note that the tests are too small to see (near) linear scaling with the number of cores, although improvement should still be noticeable.</p>
</div>
<div class="section" id="test-the-chemps2-binary">
<h2>1.5. Test the chemps2 binary<a class="headerlink" href="#test-the-chemps2-binary" title="Permalink to this headline"></a></h2>
<p>To test the chemps2 binary for compilation <strong>without MPI</strong>, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ man /sourcefolder/chemps2/chemps2.1
$ <span class="nb">cd</span> /sourcefolder/chemps2/build/CheMPS2
$ ./chemps2 --help
$ cp /sourcefolder/chemps2/tests/test14.input .
$ sed -i <span class="s2">&quot;s/path\/to/sourcefolder\/chemps2\/tests\/matrixelements/&quot;</span> test14.input
$ cat test14.input
$ ./chemps2 --file<span class="o">=</span>test14.input
</pre></div>
</div>
<p>Note that when you use the CASPT2 checkpoint, and want to restart a
calculation at a later point, you should</p>
<blockquote>
<div><ol class="arabic simple">
<li>switch the option <code class="docutils literal"><span class="pre">SCF_ACTIVE_SPACE</span></code> to <code class="docutils literal"><span class="pre">I</span></code></li>
<li>remove the <code class="docutils literal"><span class="pre">CheMPS2_DIIS.h5</span></code> checkpoint</li>
</ol>
</div></blockquote>
<p>in order to ensure that <strong>exactly</strong> the same orbitals are used in the different runs.</p>
<p>To test the chemps2 binary for compilation <strong>with MPI</strong>, prepend the binary with:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nv">OMP_NUM_THREADS</span><span class="o">=</span>YYY mpirun -np ZZZ ./chemps2 --file<span class="o">=</span>test14.input
</pre></div>
</div>
</div>
<div class="section" id="build-pychemps2">
<h2>1.6. Build PyCheMPS2<a class="headerlink" href="#build-pychemps2" title="Permalink to this headline"></a></h2>
<p>PyCheMPS2 is a python interface to libchemps2, for compilation <strong>without MPI</strong>. It can be built with <a class="reference external" href="http://cython.org/">Cython</a>. The installation is independent of CMake and assumes that you have installed the CheMPS2 library with <code class="docutils literal"><span class="pre">make</span> <span class="pre">install</span></code>. For non-standard installation directories of CheMPS2, please remember to append the library path to <code class="docutils literal"><span class="pre">LD_LIBRARY_PATH</span></code> in your <code class="docutils literal"><span class="pre">.bashrc</span></code>. In addition, the include path should be appended to <code class="docutils literal"><span class="pre">CPATH</span></code>:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">export</span> <span class="nv">CPATH</span><span class="o">=</span><span class="si">${</span><span class="nv">CPATH</span><span class="si">}</span>:/option3/include
</pre></div>
</div>
<p>where <code class="docutils literal"><span class="pre">/option3</span></code> is the option provided to CMake with <code class="docutils literal"><span class="pre">-DCMAKE_INSTALL_PREFIX=/option3</span></code> above. For operating systems based on debian, the HDF5 headers are located in the folder <code class="docutils literal"><span class="pre">/usr/include/hdf5/serial/</span></code>. If it was explicitly passed to CMake, it should also be appended to <code class="docutils literal"><span class="pre">CPATH</span></code>:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">export</span> <span class="nv">CPATH</span><span class="o">=</span><span class="si">${</span><span class="nv">CPATH</span><span class="si">}</span>:/option3/include:/usr/include/hdf5/serial
</pre></div>
</div>
<p>The python wrapper can be installed with:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /sourcefolder/chemps2/PyCheMPS2
$ python setup.py build_ext -L <span class="si">${</span><span class="nv">LD_LIBRARY_PATH</span><span class="si">}</span>
$ python setup.py install --prefix<span class="o">=</span>/option3
</pre></div>
</div>
<p>On my machine, the python wrapper is installed to the folder <code class="docutils literal"><span class="pre">/option3/lib/python2.7/site-packages</span></code>, but the folder <code class="docutils literal"><span class="pre">lib</span></code> and the distribution of python can vary.</p>
<p>Compilation of PyCheMPS2 occurs by linking to the <code class="docutils literal"><span class="pre">c++</span></code> library in the installation directory. The installation of PyCheMPS2 will fail if that library is not properly installed. If you have pulled a newer version of CheMPS2, please remember to reinstall the <code class="docutils literal"><span class="pre">c++</span></code> library first, before reinstalling PyCheMPS2!</p>
</div>
<div class="section" id="test-pychemps2">
<h2>1.7. Test PyCheMPS2<a class="headerlink" href="#test-pychemps2" title="Permalink to this headline"></a></h2>
<p>When libchemps2 has been compiled <strong>without MPI</strong>, PyCheMPS2 can be tested by running (remember that the python site-packages folder can vary):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /sourcefolder/chemps2/PyCheMPS2/tests
$ <span class="nb">export</span> <span class="nv">PYTHONPATH</span><span class="o">=</span><span class="si">${</span><span class="nv">PYTHONPATH</span><span class="si">}</span>:/option3/lib/python2.7/site-packages
$ python test1.py
$ python test2.py
...
</pre></div>
</div>
<p>If you compiled the <code class="docutils literal"><span class="pre">c++</span></code> library with <code class="docutils literal"><span class="pre">-DMKL=ON</span></code>, you might get the error</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>Intel MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so.
</pre></div>
</div>
<p>This issue of using Intel&#8217;s MKL inside python is known and reported. To get the python tests to run, you can set the variable <code class="docutils literal"><span class="pre">LD_PRELOAD</span></code> in order to preload libmkl_rt.so. On my system, this is done with</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">export</span> <span class="nv">LD_PRELOAD</span><span class="o">=</span>/opt/intel/mkl/lib/intel64/libmkl_rt.so
</pre></div>
</div>
<p>The python tests do exactly the same thing as the <code class="docutils literal"><span class="pre">c++</span></code> tests above, and illustrate the usage of the python interface to libchemps2. The tests should end with a line stating whether or not they succeeded. Note that the tests are too small to see (near) linear scaling with the number of cores, although improvement should still be noticeable.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="index.html">
              <img class="logo" src="_static/CheMPS2logo.png" alt="Logo"/>
            </a></p>
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">1. Installation</a><ul>
<li><a class="reference internal" href="#dependencies">1.1. Dependencies</a></li>
<li><a class="reference internal" href="#download">1.2. Download</a></li>
<li><a class="reference internal" href="#build-the-chemps2-library-and-binary">1.3. Build the chemps2 library and binary</a></li>
<li><a class="reference internal" href="#test-libchemps2">1.4. Test libchemps2</a></li>
<li><a class="reference internal" href="#test-the-chemps2-binary">1.5. Test the chemps2 binary</a></li>
<li><a class="reference internal" href="#build-pychemps2">1.6. Build PyCheMPS2</a></li>
<li><a class="reference internal" href="#test-pychemps2">1.7. Test PyCheMPS2</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">CheMPS2 documentation</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="publications.html"
                        title="next chapter">2. Publications</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/sourcecode.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <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="publications.html" title="2. Publications"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="CheMPS2 documentation"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">CheMPS2 1.8.3 (2016-11-15) documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2013-2016, Sebastian Wouters.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
    </div>
  </body>
</html>