Browse code

bump required Python version to 3.6 and update dependencies

It has been > 6 months since the release of Ubuntu 18.04 LTS.

Joseph Weston authored on 09/09/2019 10:32:59
Showing 1 changed files
... ...
@@ -29,10 +29,10 @@ Prerequisites
29 29
 =============
30 30
 
31 31
 Building Kwant requires
32
- * `Python <https://www.python.org/>`_ 3.5 or above (Kwant 1.1 is the last
32
+ * `Python <https://www.python.org/>`_ 3.6 or above (Kwant 1.1 is the last
33 33
    version to support Python 2),
34
- * `NumPy <http://numpy.org/>`_ 1.11.0 or newer,
35
- * `SciPy <https://www.scipy.org/>`_ 0.17.0 or newer,
34
+ * `NumPy <http://numpy.org/>`_ 1.13.3 or newer,
35
+ * `SciPy <https://www.scipy.org/>`_ 0.19.1 or newer,
36 36
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
37 37
    (For best performance we recommend the free `OpenBLAS
38 38
    <http://www.openblas.net/>`_ or the nonfree `MKL
... ...
@@ -43,19 +43,19 @@ a NumPy-like Python package optimized for very small arrays,
43 43
    C++.
44 44
 
45 45
 The following software is highly recommended though not strictly required:
46
- * `matplotlib <http://matplotlib.org/>`_ 1.5.1 or newer, for the module `kwant.plotter` and the tutorial,
47
- * `SymPy <http://sympy.org/>`_ 0.7.6 or newer, for the subpackage `kwant.continuum`.
46
+ * `matplotlib <http://matplotlib.org/>`_ 2.1.1 or newer, for the module `kwant.plotter` and the tutorial,
47
+ * `SymPy <http://sympy.org/>`_ 1.1.1 or newer, for the subpackage `kwant.continuum`.
48 48
  * `Qsymm <https://pypi.org/project/qsymm/>`_ 1.2.6 or newer, for the subpackage `kwant.qsymm`.
49 49
  * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
50 50
    that will in many cases speed up Kwant several times and reduce the memory
51 51
    footprint.  (Kwant uses only the sequential, single core version
52 52
    of MUMPS.  The advantages due to MUMPS as used by Kwant are thus independent
53 53
    of the number of CPU cores of the machine on which Kwant runs.)
54
- * The `py.test testing framework <http://pytest.org/>`_ 2.8 or newer for running the
54
+ * The `py.test testing framework <http://pytest.org/>`_ 3.3.2 or newer for running the
55 55
    tests included with Kwant.
56 56
 
57 57
 In addition, to build a copy of Kwant that has been checked-out directly from
58
-version control, you will also need `Cython <http://cython.org/>`_ 0.22 or
58
+version control, you will also need `Cython <http://cython.org/>`_ 0.26.1 or
59 59
 newer.  You do not need Cython to build Kwant that has been unpacked from a
60 60
 source .tar.gz-file.
61 61
 
Browse code

Merge branch 'stable'

Joseph Weston authored on 13/11/2019 11:41:47
Showing 0 changed files
Browse code

update qsymm version requirement

Joseph Weston authored on 01/11/2019 14:39:14
Showing 1 changed files
... ...
@@ -45,7 +45,7 @@ a NumPy-like Python package optimized for very small arrays,
45 45
 The following software is highly recommended though not strictly required:
46 46
  * `matplotlib <http://matplotlib.org/>`_ 1.5.1 or newer, for the module `kwant.plotter` and the tutorial,
47 47
  * `SymPy <http://sympy.org/>`_ 0.7.6 or newer, for the subpackage `kwant.continuum`.
48
- * `Qsymm <https://pypi.org/project/qsymm/>`_ 1.2.4 or newer, for the subpackage `kwant.qsymm`.
48
+ * `Qsymm <https://pypi.org/project/qsymm/>`_ 1.2.6 or newer, for the subpackage `kwant.qsymm`.
49 49
  * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
50 50
    that will in many cases speed up Kwant several times and reduce the memory
51 51
    footprint.  (Kwant uses only the sequential, single core version
Browse code

bump qsymm requirement to 1.2.4

The test suite uses features from the 1.2 release of qsymm.

Joseph Weston authored on 19/10/2019 18:24:50
Showing 1 changed files
... ...
@@ -45,7 +45,7 @@ a NumPy-like Python package optimized for very small arrays,
45 45
 The following software is highly recommended though not strictly required:
46 46
  * `matplotlib <http://matplotlib.org/>`_ 1.5.1 or newer, for the module `kwant.plotter` and the tutorial,
47 47
  * `SymPy <http://sympy.org/>`_ 0.7.6 or newer, for the subpackage `kwant.continuum`.
48
- * `Qsymm <https://pypi.org/project/qsymm/>`_ 1.1.0 or newer, for the subpackage `kwant.qsymm`.
48
+ * `Qsymm <https://pypi.org/project/qsymm/>`_ 1.2.4 or newer, for the subpackage `kwant.qsymm`.
49 49
  * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
50 50
    that will in many cases speed up Kwant several times and reduce the memory
51 51
    footprint.  (Kwant uses only the sequential, single core version
Browse code

mention that sphinxcontrib-svg2pdfconverter is needed to build PDF docs

Closes issue #300

Anton Akhmerov authored on 02/06/2019 10:41:18
Showing 1 changed files
... ...
@@ -147,8 +147,9 @@ To build the documentation, the `Sphinx documentation generator
147 147
 (version 0.5 or newer), as well as ``jupyter-sphinx`` (version 0.2 or newer).
148 148
 If PDF documentation is to be built, the tools
149 149
 from the `libRSVG <https://wiki.gnome.org/action/show/Projects/LibRsvg>`_
150
-(Debian/Ubuntu package ``librsvg2-bin``) are needed to convert SVG drawings
151
-into the PDF format.
150
+(Debian/Ubuntu package ``librsvg2-bin``) and a Sphinx extension
151
+``sphinxcontrib-svg2pdfconverter`` are needed to convert SVG drawings into the
152
+PDF format.
152 153
 
153 154
 As a prerequisite for building the documentation, Kwant must have been built
154 155
 successfully using ``python3 setup.py build`` as described above (or Kwant must
Browse code

update INSTALL.rst to remove references to outdated doc build machinery

Joseph Weston authored on 14/05/2019 11:38:15
Showing 1 changed files
... ...
@@ -144,9 +144,11 @@ Building the documentation
144 144
 
145 145
 To build the documentation, the `Sphinx documentation generator
146 146
 <http://www.sphinx-doc.org/en/stable/>`_ is required with ``numpydoc`` extension
147
-(version 0.5 or newer).  If PDF documentation is to be built, the tools
148
-from the `libRSVG <https://wiki.gnome.org/action/show/Projects/LibRsvg>`_ (Debian/Ubuntu package
149
-``librsvg2-bin``) are needed to convert SVG drawings into the PDF format.
147
+(version 0.5 or newer), as well as ``jupyter-sphinx`` (version 0.2 or newer).
148
+If PDF documentation is to be built, the tools
149
+from the `libRSVG <https://wiki.gnome.org/action/show/Projects/LibRsvg>`_
150
+(Debian/Ubuntu package ``librsvg2-bin``) are needed to convert SVG drawings
151
+into the PDF format.
150 152
 
151 153
 As a prerequisite for building the documentation, Kwant must have been built
152 154
 successfully using ``python3 setup.py build`` as described above (or Kwant must
... ...
@@ -160,25 +162,6 @@ Because of some quirks of how Sphinx works, it might be necessary to execute
160 162
 done, Sphinx may mistakenly use PNG files for PDF output or other problems may
161 163
 appear.
162 164
 
163
-When ``make html`` is run, modified tutorial example scripts are executed to
164
-update any figures that might have changed.  The machinery behind this works as
165
-follows.  The canonical source for a tutorial script, say ``graphene.py`` is
166
-the file ``doc/source/images/graphene.py.diff``.  This diff file contains the
167
-information to recreate two versions of ``graphene.py``: a version that is
168
-presented in the documentation (``doc/source/tutorial/graphene.py``), and a
169
-version that is used to generate the figures for the documentation
170
-(``doc/source/images/graphene.py``).  Both versions are related but differ
171
-e.g. in the details of the plotting.  When ``make html`` is run, both versions
172
-are extracted form the diff file.
173
-
174
-The diff file may be modified directly.  Another possible way of working is to
175
-directly modify either the tutorial script or the figure generation script.
176
-Then ``make html`` will use the command line tool `wiggle
177
-<https://github.com/neilbrown/wiggle>`_ to propagate the modifications accordingly.
178
-This will often just work, but may sometimes result in conflicts, in which case
179
-a message will be printed.  The conflicts then have to be resolved much like
180
-with a version control system.
181
-
182 165
 ****************************
183 166
 Hints for specific platforms
184 167
 ****************************
Browse code

Merge branch 'stable'

Christoph Groth authored on 12/02/2019 11:13:21
Showing 0 changed files
Browse code

add Qsymm to optional prerequisites in INSTALL.rst

Joseph Weston authored on 11/02/2019 11:33:48
Showing 1 changed files
... ...
@@ -41,6 +41,7 @@ a NumPy-like Python package optimized for very small arrays,
41 41
 The following software is highly recommended though not strictly required:
42 42
  * `matplotlib <http://matplotlib.org/>`_ 1.5.1 or newer, for the module `kwant.plotter` and the tutorial,
43 43
  * `SymPy <http://sympy.org/>`_ 0.7.6 or newer, for the subpackage `kwant.continuum`.
44
+ * `Qsymm <https://pypi.org/project/qsymm/>`_ 1.1.0 or newer, for the subpackage `kwant.qsymm`.
44 45
  * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
45 46
    that will in many cases speed up Kwant several times and reduce the memory
46 47
    footprint.  (Kwant uses only the sequential, single core version
Browse code

fix external links

Fixes the 'linkcheck' test. the scipy.org SSL certificate is
issued for '*.scipy.org', so sphinx reports a bad certificate
for 'scipy.org'. The 'wiggle' homepage has been down for a while,
so we point to the GitHub page instead.

Joseph Weston authored on 23/10/2018 09:52:17
Showing 1 changed files
... ...
@@ -32,7 +32,7 @@ Building Kwant requires
32 32
  * `Python <https://www.python.org/>`_ 3.4 or above (Kwant 1.1 is the last
33 33
    version to support Python 2),
34 34
  * `NumPy <http://numpy.org/>`_ 1.8.1 or newer,
35
- * `SciPy <https://scipy.org/>`_ 0.14 or newer,
35
+ * `SciPy <https://www.scipy.org/>`_ 0.14 or newer,
36 36
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
37 37
    (For best performance we recommend the free `OpenBLAS
38 38
    <http://www.openblas.net/>`_ or the nonfree `MKL
... ...
@@ -185,7 +185,7 @@ are extracted form the diff file.
185 185
 The diff file may be modified directly.  Another possible way of working is to
186 186
 directly modify either the tutorial script or the figure generation script.
187 187
 Then ``make html`` will use the command line tool `wiggle
188
-<http://neil.brown.name/wiggle/>`_ to propagate the modifications accordingly.
188
+<https://github.com/neilbrown/wiggle>`_ to propagate the modifications accordingly.
189 189
 This will often just work, but may sometimes result in conflicts, in which case
190 190
 a message will be printed.  The conflicts then have to be resolved much like
191 191
 with a version control system.
Browse code

remove all references to the 'lapack' build.conf section

Kwant no longer needs linking against Lapack directly, as
we use the Lapack provided by Scipy.

Joseph Weston authored on 15/11/2017 15:45:32
Showing 1 changed files
... ...
@@ -33,10 +33,6 @@ Building Kwant requires
33 33
    version to support Python 2),
34 34
  * `NumPy <http://numpy.org/>`_ 1.11.0 or newer,
35 35
  * `SciPy <https://scipy.org/>`_ 0.17.0 or newer,
36
- * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
37
-   (For best performance we recommend the free `OpenBLAS
38
-   <http://www.openblas.net/>`_ or the nonfree `MKL
39
-   <https://software.intel.com/en-us/intel-mkl>`_.)
40 36
  * `Tinyarray <https://gitlab.kwant-project.org/kwant/tinyarray>`_ 1.2 or newer,
41 37
 a NumPy-like Python package optimized for very small arrays,
42 38
  * An environment which allows to compile Python extensions written in C and
... ...
@@ -100,7 +96,7 @@ sections, one for each extension module that is contained in Kwant, led by a
100 96
 ``[section name]`` header and followed by ``key = value`` lines.
101 97
 
102 98
 The sections bear the names of the extension modules, for example
103
-``[kwant.operator]`` or ``[kwant.linalg.lapack]``.  There can be also a
99
+``[kwant.operator]``.  There can be also a
104 100
 ``[DEFAULT]`` section that provides default values for all extensions, also
105 101
 those not explicitly present in the file.
106 102
 
... ...
@@ -116,20 +112,15 @@ trace feature::
116 112
     undef_macros = NDEBUG
117 113
     define_macros = CYTHON_TRACE=1
118 114
 
119
-Kwant must be linked against LAPACK & BLAS, and, optionally, MUMPS.  The main
115
+Kwant can optionally be linked against MUMPS.  The main
120 116
 application of build configuration is adopting the build process to the various
121
-(deployment) variants of these libraries.  By default ``setup.py`` assumes that
122
-LAPACK and BLAS can be found under their usual names.  MUMPS will be not linked
117
+deployments of MUMPS. MUMPS will be not linked
123 118
 against by default, except on Debian-based systems when the package
124 119
 ``libmumps-scotch-dev`` is installed.
125 120
 
126
-The sections ``[kwant.linalg.lapack]`` and ``[kwant.linalg._mumps]`` may be
127
-used to adapt the build process.  (For simplicity and backwards compatibility,
128
-``[lapack]`` and ``[mumps]`` are aliases for the above.)
121
+The section ``[kwant.linalg._mumps]`` may be used to adapt the build process.
122
+(For simplicity and backwards compatibility, ``[mumps]`` is an aliases for the above.)
129 123
 
130
-The section ``[lapack]`` configures the linking against LAPACK _AND_ BLAS, the
131
-section ``[mumps]`` against MUMPS.  The contents of ``[lapack]`` are
132
-appended to the configuration for MUMPS itself needs LAPACK and BLAS as well.
133 124
 
134 125
 Example ``build.conf`` for linking Kwant against a self-compiled MUMPS, `SCOTCH
135 126
 <http://www.labri.fr/perso/pelegrin/scotch/>`_ and `METIS
... ...
@@ -138,13 +129,6 @@ Example ``build.conf`` for linking Kwant against a self-compiled MUMPS, `SCOTCH
138 129
     [mumps]
139 130
     libraries = zmumps mumps_common pord metis esmumps scotch scotcherr mpiseq gfortran
140 131
 
141
-Example ``build.conf`` for linking Kwant with Intel MKL.::
142
-
143
-    [lapack]
144
-    libraries = mkl_intel_lp64 mkl_sequential mkl_core mkl_def
145
-    library_dirs = /opt/intel/mkl/lib/intel64
146
-    extra_link_args = -Wl,-rpath=/opt/intel/mkl/lib/intel64
147
-
148 132
 The detailed syntax of ``build.conf`` is explained in the `documentation of
149 133
 Python's configparser module
150 134
 <https://docs.python.org/3/library/configparser.html#supported-ini-file-structure>`_.
... ...
@@ -206,7 +190,7 @@ root.
206 190
 1. Install the required packages.  On Debian-based systems like Ubuntu this can
207 191
    be done by running the command ::
208 192
 
209
-       sudo apt-get install python3-dev python3-setuptools python3-scipy python3-matplotlib python3-pytest python3-sympy g++ gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
193
+       sudo apt-get install python3-dev python3-setuptools python3-scipy python3-matplotlib python3-pytest python3-sympy g++ gfortran libmumps-scotch-dev
210 194
 
211 195
 2. Unpack Tinyarray, enter its directory. To build and install, run ::
212 196
 
... ...
@@ -248,8 +232,6 @@ below.
248 232
 
249 233
 4. Unpack Kwant, go to the Kwant directory, and edit ``build.conf`` to read::
250 234
 
251
-       [lapack]
252
-       extra_link_args = -Wl,-framework -Wl,Accelerate
253 235
        [mumps]
254 236
        include_dirs = /opt/local/include
255 237
        library_dirs = /opt/local/lib
Browse code

Merge branch 'stable'

Christoph Groth authored on 25/07/2017 15:56:02
Showing 0 changed files
Browse code

Merge branch 'stable_py2' into stable

Christoph Groth authored on 25/07/2017 15:55:01
Showing 0 changed files
Browse code

improve the tutorial script and image buiding machinery

The basic idea remains the same, but should work much better now. The
difference is that images/example.py.diff is now a patch with complete
context and becomes the authoritative source for both the visible flavor
of an example as well as for its figure-generating variant. Both
tutorial/example.py and images/example.py are extracted from this file
by 'make html'. Thanks to the complete context the diffs are quite
readable and may be modified directly.

Alternatively, one may also modify the generated scripts. When
tutorial/example.py has been modified, it will be patched and saved as
images/example.py. The patching is done using the tool 'wiggle' that
works much better than 'patch'. If a conflict occurs, conflict markers
are added to the output file and its dated back to the dawn of time
(i.e. 1970) in order to mark the conflicts as not yet resolved. After
resolving, 'make html' is simply run again.

Upon a successful execution of the figure-generating script the diff
gets recreated automatically, 'generate-diffs' no longer exists.

Christoph Groth authored on 19/07/2017 17:49:01
Showing 1 changed files
... ...
@@ -171,6 +171,24 @@ Because of some quirks of how Sphinx works, it might be necessary to execute
171 171
 done, Sphinx may mistakenly use PNG files for PDF output or other problems may
172 172
 appear.
173 173
 
174
+When ``make html`` is run, modified tutorial example scripts are executed to
175
+update any figures that might have changed.  The machinery behind this works as
176
+follows.  The canonical source for a tutorial script, say ``graphene.py`` is
177
+the file ``doc/source/images/graphene.py.diff``.  This diff file contains the
178
+information to recreate two versions of ``graphene.py``: a version that is
179
+presented in the documentation (``doc/source/tutorial/graphene.py``), and a
180
+version that is used to generate the figures for the documentation
181
+(``doc/source/images/graphene.py``).  Both versions are related but differ
182
+e.g. in the details of the plotting.  When ``make html`` is run, both versions
183
+are extracted form the diff file.
184
+
185
+The diff file may be modified directly.  Another possible way of working is to
186
+directly modify either the tutorial script or the figure generation script.
187
+Then ``make html`` will use the command line tool `wiggle
188
+<http://neil.brown.name/wiggle/>`_ to propagate the modifications accordingly.
189
+This will often just work, but may sometimes result in conflicts, in which case
190
+a message will be printed.  The conflicts then have to be resolved much like
191
+with a version control system.
174 192
 
175 193
 ****************************
176 194
 Hints for specific platforms
Browse code

documentation: correct numbering of a list

Christoph Groth authored on 25/07/2017 11:45:49
Showing 1 changed files
... ...
@@ -193,7 +193,7 @@ below.
193 193
        python setup.py build
194 194
        sudo python setup.py install
195 195
 
196
-5. Unpack Kwant, go to the Kwant directory, and edit ``build.conf`` to read::
196
+4. Unpack Kwant, go to the Kwant directory, and edit ``build.conf`` to read::
197 197
 
198 198
        [lapack]
199 199
        extra_link_args = -Wl,-framework -Wl,Accelerate
... ...
@@ -202,7 +202,7 @@ below.
202 202
        library_dirs = /opt/local/lib
203 203
        libraries = zmumps_seq mumps_common_seq pord_seq esmumps scotch scotcherr mpiseq gfortran
204 204
 
205
-6. Then, build and install Kwant. ::
205
+5. Then, build and install Kwant. ::
206 206
 
207 207
        CC=gcc-mp-4.7 LDSHARED='gcc-mp-4.7 -shared -undefined dynamic_lookup' python setup.py build
208 208
        sudo python setup.py install
Browse code

INSTALL.rst: add missing Debian dependency

Christoph Groth authored on 30/06/2017 12:47:05
Showing 1 changed files
... ...
@@ -188,7 +188,7 @@ root.
188 188
 1. Install the required packages.  On Debian-based systems like Ubuntu this can
189 189
    be done by running the command ::
190 190
 
191
-       sudo apt-get install python3-dev python3-scipy python3-matplotlib python3-pytest python3-sympy g++ gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
191
+       sudo apt-get install python3-dev python3-setuptools python3-scipy python3-matplotlib python3-pytest python3-sympy g++ gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
192 192
 
193 193
 2. Unpack Tinyarray, enter its directory. To build and install, run ::
194 194
 
Browse code

bump required Python version to 3.5

Add check for this in setup.py to avoid potentially confusing
tracebacks later.

Joseph Weston authored on 20/06/2017 14:17:32
Showing 1 changed files
... ...
@@ -29,7 +29,7 @@ Prerequisites
29 29
 =============
30 30
 
31 31
 Building Kwant requires
32
- * `Python <https://www.python.org/>`_ 3.4 or above (Kwant 1.1 is the last
32
+ * `Python <https://www.python.org/>`_ 3.5 or above (Kwant 1.1 is the last
33 33
    version to support Python 2),
34 34
  * `NumPy <http://numpy.org/>`_ 1.11.0 or newer,
35 35
  * `SciPy <https://scipy.org/>`_ 0.17.0 or newer,
Browse code

bump numpy, scipy and matplotlib to newest supported versions

Remove fixes for unsupported versions of numpy, scipy and matplotlib.

Joseph Weston authored on 19/06/2017 12:00:53
Showing 1 changed files
... ...
@@ -31,8 +31,8 @@ Prerequisites
31 31
 Building Kwant requires
32 32
  * `Python <https://www.python.org/>`_ 3.4 or above (Kwant 1.1 is the last
33 33
    version to support Python 2),
34
- * `NumPy <http://numpy.org/>`_ 1.8.1 or newer,
35
- * `SciPy <https://scipy.org/>`_ 0.14 or newer,
34
+ * `NumPy <http://numpy.org/>`_ 1.11.0 or newer,
35
+ * `SciPy <https://scipy.org/>`_ 0.17.0 or newer,
36 36
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
37 37
    (For best performance we recommend the free `OpenBLAS
38 38
    <http://www.openblas.net/>`_ or the nonfree `MKL
... ...
@@ -43,7 +43,7 @@ a NumPy-like Python package optimized for very small arrays,
43 43
    C++.
44 44
 
45 45
 The following software is highly recommended though not strictly required:
46
- * `matplotlib <http://matplotlib.org/>`_ 1.4.2 or newer, for the module `kwant.plotter` and the tutorial,
46
+ * `matplotlib <http://matplotlib.org/>`_ 1.5.1 or newer, for the module `kwant.plotter` and the tutorial,
47 47
  * `SymPy <http://sympy.org/>`_ 0.7.6 or newer, for the subpackage `kwant.continuum`.
48 48
  * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
49 49
    that will in many cases speed up Kwant several times and reduce the memory
Browse code

add python3-sympy to the list of DEBs kwant depends on

Christoph Groth authored on 16/06/2017 17:04:06
Showing 1 changed files
... ...
@@ -188,7 +188,7 @@ root.
188 188
 1. Install the required packages.  On Debian-based systems like Ubuntu this can
189 189
    be done by running the command ::
190 190
 
191
-       sudo apt-get install python3-dev python3-scipy python3-matplotlib python3-pytest g++ gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
191
+       sudo apt-get install python3-dev python3-scipy python3-matplotlib python3-pytest python3-sympy g++ gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
192 192
 
193 193
 2. Unpack Tinyarray, enter its directory. To build and install, run ::
194 194
 
Browse code

mention that we require pytest >= 2.8

Older pytest does not have 'warns'.

Christoph Groth authored on 16/06/2017 17:01:33
Showing 1 changed files
... ...
@@ -50,7 +50,7 @@ The following software is highly recommended though not strictly required:
50 50
    footprint.  (Kwant uses only the sequential, single core version
51 51
    of MUMPS.  The advantages due to MUMPS as used by Kwant are thus independent
52 52
    of the number of CPU cores of the machine on which Kwant runs.)
53
- * The `py.test testing framework <http://pytest.org/>`_ for running the
53
+ * The `py.test testing framework <http://pytest.org/>`_ 2.8 or newer for running the
54 54
    tests included with Kwant.
55 55
 
56 56
 In addition, to build a copy of Kwant that has been checked-out directly from
Browse code

bump versions of dependencies also in INSTALL.rst

Christoph Groth authored on 19/05/2017 17:56:36
Showing 1 changed files
... ...
@@ -32,18 +32,18 @@ Building Kwant requires
32 32
  * `Python <https://www.python.org/>`_ 3.4 or above (Kwant 1.1 is the last
33 33
    version to support Python 2),
34 34
  * `NumPy <http://numpy.org/>`_ 1.8.1 or newer,
35
- * `SciPy <https://scipy.org/>`_ 0.13.3 or newer,
35
+ * `SciPy <https://scipy.org/>`_ 0.14 or newer,
36 36
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
37 37
    (For best performance we recommend the free `OpenBLAS
38 38
    <http://www.openblas.net/>`_ or the nonfree `MKL
39 39
    <https://software.intel.com/en-us/intel-mkl>`_.)
40
- * `Tinyarray <https://gitlab.kwant-project.org/kwant/tinyarray>`_, a NumPy-like
41
-   Python package optimized for very small arrays,
40
+ * `Tinyarray <https://gitlab.kwant-project.org/kwant/tinyarray>`_ 1.2 or newer,
41
+a NumPy-like Python package optimized for very small arrays,
42 42
  * An environment which allows to compile Python extensions written in C and
43 43
    C++.
44 44
 
45 45
 The following software is highly recommended though not strictly required:
46
- * `matplotlib <http://matplotlib.org/>`_ 1.3.1 or newer, for the module `kwant.plotter` and the tutorial,
46
+ * `matplotlib <http://matplotlib.org/>`_ 1.4.2 or newer, for the module `kwant.plotter` and the tutorial,
47 47
  * `SymPy <http://sympy.org/>`_ 0.7.6 or newer, for the subpackage `kwant.continuum`.
48 48
  * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
49 49
    that will in many cases speed up Kwant several times and reduce the memory
Browse code

update links in documentation

In addition to basic updates to skip permanent redirect, remove an
obsolete reference to macports installation instructions on the main
website.

Anton Akhmerov authored on 18/05/2017 15:44:44
Showing 1 changed files
... ...
@@ -32,7 +32,7 @@ Building Kwant requires
32 32
  * `Python <https://www.python.org/>`_ 3.4 or above (Kwant 1.1 is the last
33 33
    version to support Python 2),
34 34
  * `NumPy <http://numpy.org/>`_ 1.8.1 or newer,
35
- * `SciPy <http://scipy.org/>`_ 0.13.3 or newer,
35
+ * `SciPy <https://scipy.org/>`_ 0.13.3 or newer,
36 36
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
37 37
    (For best performance we recommend the free `OpenBLAS
38 38
    <http://www.openblas.net/>`_ or the nonfree `MKL
... ...
@@ -156,7 +156,7 @@ Building the documentation
156 156
 To build the documentation, the `Sphinx documentation generator
157 157
 <http://www.sphinx-doc.org/en/stable/>`_ is required with ``numpydoc`` extension
158 158
 (version 0.5 or newer).  If PDF documentation is to be built, the tools
159
-from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu package
159
+from the `libRSVG <https://wiki.gnome.org/action/show/Projects/LibRsvg>`_ (Debian/Ubuntu package
160 160
 ``librsvg2-bin``) are needed to convert SVG drawings into the PDF format.
161 161
 
162 162
 As a prerequisite for building the documentation, Kwant must have been built
... ...
@@ -216,11 +216,7 @@ systems. Here we only consider the case of `MacPorts
216 216
 below.
217 217
 
218 218
 1. Install a recent version of MacPorts, as explained in the `installation
219
-   instructions of MacPorts <https://www.macports.org/install.php>`_.  `The
220
-   MacPorts section of the Kwant website
221
-   <https://kwant-project.org/install#mac-os-x-macports>`_ may be also of
222
-   interest.  (Note that it describes how to install Kwant using a ports file,
223
-   while the aim here is to install from source manually.)
219
+   instructions of MacPorts <https://www.macports.org/install.php>`_.
224 220
 
225 221
 2. Install the required dependencies::
226 222
 
Browse code

INSTALL.rst: tell where to obtain the source code

Christoph Groth authored on 14/05/2017 16:19:14
Showing 1 changed files
... ...
@@ -15,6 +15,16 @@ information is mostly of interest to contributors and packagers.
15 15
 Generic instructions
16 16
 ********************
17 17
 
18
+Obtaining the source code
19
+=========================
20
+
21
+Source distributions of Kwant (and Tinyarray) are available at the `downloads
22
+section of the Kwant website <https://downloads.kwant-project.org/kwant/>`_ as well
23
+as `PyPI <https://pypi.python.org/pypi/kwant>`_.  The sources may be also
24
+cloned directly from the `official Kwant git repository
25
+<https://gitlab.kwant-project.org/kwant/kwant>`_.
26
+
27
+
18 28
 Prerequisites
19 29
 =============
20 30
 
Browse code

bump versions of dependencies up to Debian jessie and Ubuntu 14.04

Christoph Groth authored on 25/04/2017 14:10:02
Showing 1 changed files
... ...
@@ -19,9 +19,10 @@ Prerequisites
19 19
 =============
20 20
 
21 21
 Building Kwant requires
22
- * `Python <https://www.python.org>`_ 3.4 or above (Kwant 1.1 is the last
22
+ * `Python <https://www.python.org/>`_ 3.4 or above (Kwant 1.1 is the last
23 23
    version to support Python 2),
24
- * `SciPy <http://scipy.org>`_ 0.11 or newer,
24
+ * `NumPy <http://numpy.org/>`_ 1.8.1 or newer,
25
+ * `SciPy <http://scipy.org/>`_ 0.13.3 or newer,
25 26
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
26 27
    (For best performance we recommend the free `OpenBLAS
27 28
    <http://www.openblas.net/>`_ or the nonfree `MKL
... ...
@@ -32,8 +33,8 @@ Building Kwant requires
32 33
    C++.
33 34
 
34 35
 The following software is highly recommended though not strictly required:
35
- * `matplotlib <http://matplotlib.org/>`_ 1.2 or newer, for Kwant's
36
-   plotting module and the tutorial,
36
+ * `matplotlib <http://matplotlib.org/>`_ 1.3.1 or newer, for the module `kwant.plotter` and the tutorial,
37
+ * `SymPy <http://sympy.org/>`_ 0.7.6 or newer, for the subpackage `kwant.continuum`.
37 38
  * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
38 39
    that will in many cases speed up Kwant several times and reduce the memory
39 40
    footprint.  (Kwant uses only the sequential, single core version
Browse code

INSTALL.rst: update required versions

Christoph Groth authored on 09/11/2016 17:48:44
Showing 1 changed files
... ...
@@ -21,7 +21,7 @@ Prerequisites
21 21
 Building Kwant requires
22 22
  * `Python <https://www.python.org>`_ 3.4 or above (Kwant 1.1 is the last
23 23
    version to support Python 2),
24
- * `SciPy <http://scipy.org>`_ 0.9 or newer,
24
+ * `SciPy <http://scipy.org>`_ 0.11 or newer,
25 25
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
26 26
    (For best performance we recommend the free `OpenBLAS
27 27
    <http://www.openblas.net/>`_ or the nonfree `MKL
... ...
@@ -32,7 +32,7 @@ Building Kwant requires
32 32
    C++.
33 33
 
34 34
 The following software is highly recommended though not strictly required:
35
- * `matplotlib <http://matplotlib.org/>`_ 1.1 or newer, for Kwant's
35
+ * `matplotlib <http://matplotlib.org/>`_ 1.2 or newer, for Kwant's
36 36
    plotting module and the tutorial,
37 37
  * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
38 38
    that will in many cases speed up Kwant several times and reduce the memory
Browse code

provide a "what's new" entry for the recent changes to setup.py

Christoph Groth authored on 26/10/2016 13:07:08
Showing 1 changed files
... ...
@@ -74,6 +74,8 @@ cythonization is disabled when building not from git.  If ever necessary, this
74 74
 default can be overridden by giving the ``--cython`` option to setup.py.)
75 75
 
76 76
 
77
+.. _build-configuration:
78
+
77 79
 Build configuration
78 80
 ===================
79 81
 
Browse code

INSTALL.rst: fix typo

Christoph Groth authored on 26/10/2016 12:35:38
Showing 1 changed files
... ...
@@ -83,7 +83,7 @@ this file is ``build.conf`` in the root directory of the Kwant distribution.  A
83 83
 different path may be provided using the ``--configfile=PATH`` option.
84 84
 
85 85
 This configuration file consists of
86
-sections, one for each extension modules that is contained in Kwant, led by a
86
+sections, one for each extension module that is contained in Kwant, led by a
87 87
 ``[section name]`` header and followed by ``key = value`` lines.
88 88
 
89 89
 The sections bear the names of the extension modules, for example
Browse code

setup.py: add --configfile option

Christoph Groth authored on 21/09/2016 12:03:10
Showing 1 changed files
... ...
@@ -77,8 +77,12 @@ default can be overridden by giving the ``--cython`` option to setup.py.)
77 77
 Build configuration
78 78
 ===================
79 79
 
80
-Kwant contains several extension modules.  The compilation and linking of these modules can be configured by editing a build configuration file ``build.conf`` in the
81
-root directory of the Kwant distribution.  This configuration file consists of
80
+Kwant contains several extension modules.  The compilation and linking of these
81
+modules can be configured by editing a build configuration file.  By default,
82
+this file is ``build.conf`` in the root directory of the Kwant distribution.  A
83
+different path may be provided using the ``--configfile=PATH`` option.
84
+
85
+This configuration file consists of
82 86
 sections, one for each extension modules that is contained in Kwant, led by a
83 87
 ``[section name]`` header and followed by ``key = value`` lines.
84 88
 
Browse code

setup.py: remove obsolete --cython-trace option

The CYTHON_TRACE macro can be now set in the build.conf file.

Christoph Groth authored on 21/09/2016 11:09:27
Showing 1 changed files
... ...
@@ -92,10 +92,12 @@ complete list, see its `documentation
92 92
 <https://docs.python.org/3/distutils/apiref.html#distutils.core.Extension>`_).
93 93
 The corresponding values are whitespace-separated lists of strings.
94 94
 
95
-Example ``build.conf`` for compiling Kwant with enabled C assertions::
95
+Example ``build.conf`` for compiling Kwant with C assertions and Cython's line
96
+trace feature::
96 97
 
97 98
     [DEFAULT]
98 99
     undef_macros = NDEBUG
100
+    define_macros = CYTHON_TRACE=1
99 101
 
100 102
 Kwant must be linked against LAPACK & BLAS, and, optionally, MUMPS.  The main
101 103
 application of build configuration is adopting the build process to the various
Browse code

setup.py: make build.conf more powerful

All C extensions are now treated on equal footing and can be configured
in "build.conf". All the options known by Extension may be set now for
any extension individually and for all of them together (using the
[DEFAULT] section).

Christoph Groth authored on 20/09/2016 23:30:20
Showing 1 changed files
... ...
@@ -77,23 +77,40 @@ default can be overridden by giving the ``--cython`` option to setup.py.)
77 77
 Build configuration
78 78
 ===================
79 79
 
80
-The setup script of Kwant has to know how to link against LAPACK & BLAS, and,
81
-optionally, MUMPS.  By default it will assume that LAPACK and BLAS can be found
82
-under their usual names.  MUMPS will be not linked against by default, except
83
-on Debian-based systems when the package ``libmumps-scotch-dev`` is installed.
84
-
85
-All these settings can be configured by creating/editing the file
86
-``build.conf`` in the root directory of the Kwant distribution.  This
87
-configuration file consists of sections, one for each dependency, led by a
88
-[dependency-name] header and followed by name = value entries.  Possible names
89
-are keyword arguments for ``distutils.core.Extension`` (For a complete list,
90
-see its `documentation
80
+Kwant contains several extension modules.  The compilation and linking of these modules can be configured by editing a build configuration file ``build.conf`` in the
81
+root directory of the Kwant distribution.  This configuration file consists of
82
+sections, one for each extension modules that is contained in Kwant, led by a
83
+``[section name]`` header and followed by ``key = value`` lines.
84
+
85
+The sections bear the names of the extension modules, for example
86
+``[kwant.operator]`` or ``[kwant.linalg.lapack]``.  There can be also a
87
+``[DEFAULT]`` section that provides default values for all extensions, also
88
+those not explicitly present in the file.
89
+
90
+Possible keys are the keyword arguments for ``distutils.core.Extension`` (For a
91
+complete list, see its `documentation
91 92
 <https://docs.python.org/3/distutils/apiref.html#distutils.core.Extension>`_).
92 93
 The corresponding values are whitespace-separated lists of strings.
93 94
 
94
-The two currently possible sections are [lapack] and [mumps].  The former
95
-configures the linking against LAPACK _AND_ BLAS, the latter against MUMPS
96
-(without LAPACK and BLAS).
95
+Example ``build.conf`` for compiling Kwant with enabled C assertions::
96
+
97
+    [DEFAULT]
98
+    undef_macros = NDEBUG
99
+
100
+Kwant must be linked against LAPACK & BLAS, and, optionally, MUMPS.  The main
101
+application of build configuration is adopting the build process to the various
102
+(deployment) variants of these libraries.  By default ``setup.py`` assumes that
103
+LAPACK and BLAS can be found under their usual names.  MUMPS will be not linked
104
+against by default, except on Debian-based systems when the package
105
+``libmumps-scotch-dev`` is installed.
106
+
107
+The sections ``[kwant.linalg.lapack]`` and ``[kwant.linalg._mumps]`` may be
108
+used to adapt the build process.  (For simplicity and backwards compatibility,
109
+``[lapack]`` and ``[mumps]`` are aliases for the above.)
110
+
111
+The section ``[lapack]`` configures the linking against LAPACK _AND_ BLAS, the
112
+section ``[mumps]`` against MUMPS.  The contents of ``[lapack]`` are
113
+appended to the configuration for MUMPS itself needs LAPACK and BLAS as well.
97 114
 
98 115
 Example ``build.conf`` for linking Kwant against a self-compiled MUMPS, `SCOTCH
99 116
 <http://www.labri.fr/perso/pelegrin/scotch/>`_ and `METIS
Browse code

prepare a more detailed test suit, fix minor typos

Summary of changes:
* Add a test for trailing whitespace, remove all trailling whitespace
* Add a test for broken URLs in docs, fix all broken URLs and permanent redirects
* Switch sphinx doc build to strict (warnings to errors) and nitpicky (broken links to warnings). Fix all sphinx warnings.
* Deploy docs from any commit to [kwant/kwant](https://gitlab.kwant-project.org/kwant/kwant) to https://test.kwant-project.org/doc/dev
* Deploy docs from any commit to master at kwant/kwant to https://kwant-project.org/doc/dev
* Deploy docs from any tag release tag (so anything that is vX.Y.Z) at kwant/kwant to https://kwant-project.org/doc/X.Y

Anton Akhmerov authored on 05/08/2016 22:57:01
Showing 1 changed files
... ...
@@ -4,7 +4,7 @@ Installation of Kwant
4 4
 
5 5
 Ready-to-use Kwant packages are available for many platforms (like GNU/Linux,
6 6
 Mac OS X, Microsoft Windows).  See the `installation page of the Kwant website
7
-<http://kwant-project.org/install>`_ for instructions on how to install Kwant
7
+<https://kwant-project.org/install>`_ for instructions on how to install Kwant
8 8
 on your platform.  This is the recommended way for new users.
9 9
 
10 10
 The remainder of this section documents how to build Kwant from source.  This
... ...
@@ -19,27 +19,27 @@ Prerequisites
19 19
 =============
20 20
 
21 21
 Building Kwant requires
22
- * `Python <http://python.org>`_ 3.4 or above (Kwant 1.1 is the last version to
23
-   support Python 2),
22
+ * `Python <https://www.python.org>`_ 3.4 or above (Kwant 1.1 is the last
23
+   version to support Python 2),
24 24
  * `SciPy <http://scipy.org>`_ 0.9 or newer,
25 25
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
26 26
    (For best performance we recommend the free `OpenBLAS
27
-   <http://xianyi.github.com/OpenBLAS/>`_ or the nonfree `MKL
28
-   <http://software.intel.com/en-us/intel-mkl>`_.)
27
+   <http://www.openblas.net/>`_ or the nonfree `MKL
28
+   <https://software.intel.com/en-us/intel-mkl>`_.)
29 29
  * `Tinyarray <https://gitlab.kwant-project.org/kwant/tinyarray>`_, a NumPy-like
30 30
    Python package optimized for very small arrays,
31 31
  * An environment which allows to compile Python extensions written in C and
32 32
    C++.
33 33
 
34 34
 The following software is highly recommended though not strictly required:
35
- * `matplotlib <http://matplotlib.sourceforge.net/>`_ 1.1 or newer, for Kwant's
35
+ * `matplotlib <http://matplotlib.org/>`_ 1.1 or newer, for Kwant's
36 36
    plotting module and the tutorial,
37 37
  * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
38 38
    that will in many cases speed up Kwant several times and reduce the memory
39 39
    footprint.  (Kwant uses only the sequential, single core version
40 40
    of MUMPS.  The advantages due to MUMPS as used by Kwant are thus independent
41 41
    of the number of CPU cores of the machine on which Kwant runs.)
42
- * The `py.test testing framework <http://http://pytest.org/>`_ for running the
42
+ * The `py.test testing framework <http://pytest.org/>`_ for running the
43 43
    tests included with Kwant.
44 44
 
45 45
 In addition, to build a copy of Kwant that has been checked-out directly from
... ...
@@ -52,8 +52,8 @@ Building and installing Kwant
52 52
 =============================
53 53
 
54 54
 Kwant can be built and installed following the `usual Python conventions
55
-<http://docs.python.org/install/index.html>`_ by running the following commands
56
-in the root directory of the Kwant distribution. ::
55
+<https://docs.python.org/3/install/index.html>`_ by running the following
56
+commands in the root directory of the Kwant distribution. ::
57 57
 
58 58
     python3 setup.py build
59 59
     python3 setup.py install
... ...
@@ -88,7 +88,7 @@ configuration file consists of sections, one for each dependency, led by a
88 88
 [dependency-name] header and followed by name = value entries.  Possible names
89 89
 are keyword arguments for ``distutils.core.Extension`` (For a complete list,
90 90
 see its `documentation
91
-<http://docs.python.org/3/distutils/apiref.html#distutils.core.Extension>`_).
91
+<https://docs.python.org/3/distutils/apiref.html#distutils.core.Extension>`_).
92 92
 The corresponding values are whitespace-separated lists of strings.
93 93
 
94 94
 The two currently possible sections are [lapack] and [mumps].  The former
... ...
@@ -111,14 +111,14 @@ Example ``build.conf`` for linking Kwant with Intel MKL.::
111 111
 
112 112
 The detailed syntax of ``build.conf`` is explained in the `documentation of
113 113
 Python's configparser module
114
-<http://docs.python.org/3/library/configparser.html#supported-ini-file-structure>`_.
114
+<https://docs.python.org/3/library/configparser.html#supported-ini-file-structure>`_.
115 115
 
116 116
 
117 117
 Building the documentation
118 118
 ==========================
119 119
 
120 120
 To build the documentation, the `Sphinx documentation generator
121
-<http://sphinx.pocoo.org/>`_ is required with ``numpydoc`` extension
121
+<http://www.sphinx-doc.org/en/stable/>`_ is required with ``numpydoc`` extension
122 122
 (version 0.5 or newer).  If PDF documentation is to be built, the tools
123 123
 from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu package
124 124
 ``librsvg2-bin``) are needed to convert SVG drawings into the PDF format.
... ...
@@ -176,13 +176,13 @@ to be updated for Kwant 1.2.  (Help is welcome.)
176 176
 
177 177
 The required dependencies of Kwant are best installed with one of the packaging
178 178
 systems. Here we only consider the case of `MacPorts
179
-<http://www.macports.org>`_ in detail. Some remarks for homebrew are given
179
+<https://www.macports.org>`_ in detail. Some remarks for homebrew are given
180 180
 below.
181 181
 
182 182
 1. Install a recent version of MacPorts, as explained in the `installation
183
-   instructions of MacPorts <http://www.macports.org/install.php>`_.  `The
183
+   instructions of MacPorts <https://www.macports.org/install.php>`_.  `The
184 184
    MacPorts section of the Kwant website
185
-   <http://kwant-project.org/install#mac-os-x-macports>`_ may be also of
185
+   <https://kwant-project.org/install#mac-os-x-macports>`_ may be also of
186 186
    interest.  (Note that it describes how to install Kwant using a ports file,
187 187
    while the aim here is to install from source manually.)
188 188
 
Browse code

use py.test; ci unchecked yet

Anton Akhmerov authored on 09/03/2016 01:26:17
Showing 1 changed files
... ...
@@ -39,7 +39,7 @@ The following software is highly recommended though not strictly required:
39 39
    footprint.  (Kwant uses only the sequential, single core version
40 40
    of MUMPS.  The advantages due to MUMPS as used by Kwant are thus independent
41 41
    of the number of CPU cores of the machine on which Kwant runs.)
42
- * The `nose testing framework <http://nose.readthedocs.org/>`_ for running the
42
+ * The `py.test testing framework <http://http://pytest.org/>`_ for running the
43 43
    tests included with Kwant.
44 44
 
45 45
 In addition, to build a copy of Kwant that has been checked-out directly from
... ...
@@ -152,7 +152,7 @@ root.
152 152
 1. Install the required packages.  On Debian-based systems like Ubuntu this can
153 153
    be done by running the command ::
154 154
 
155
-       sudo apt-get install python-dev python-scipy python-matplotlib python-nose g++ gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
155
+       sudo apt-get install python3-dev python3-scipy python3-matplotlib python3-pytest g++ gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
156 156
 
157 157
 2. Unpack Tinyarray, enter its directory. To build and install, run ::
158 158
 
... ...
@@ -231,7 +231,7 @@ installed as ::
231 231
     brew tap homebrew/science
232 232
     brew tap homebrew/python
233 233
     brew tap kwant-project/kwant
234
-    pip install nose six
234
+    pip install pytest pytest-runner six
235 235
     brew install numpy scipy matplotlib
236 236
 
237 237
 Note that during the installation you will be told which paths to add when you
Browse code

update the previous commit for python 3

Christoph Groth authored on 08/12/2015 16:38:36
Showing 1 changed files
... ...
@@ -19,8 +19,8 @@ Prerequisites
19 19
 =============
20 20
 
21 21
 Building Kwant requires
22
- * `Python <http://python.org>`_ 2.6 or 2.7 (Python 3 is supported by
23
-   Kwant 1.2 and above),
22
+ * `Python <http://python.org>`_ 3.4 or above (Kwant 1.1 is the last version to
23
+   support Python 2),
24 24
  * `SciPy <http://scipy.org>`_ 0.9 or newer,
25 25
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
26 26
    (For best performance we recommend the free `OpenBLAS
... ...
@@ -55,15 +55,15 @@ Kwant can be built and installed following the `usual Python conventions
55 55
 <http://docs.python.org/install/index.html>`_ by running the following commands
56 56
 in the root directory of the Kwant distribution. ::
57 57
 
58
-    python setup.py build
59
-    python setup.py install
58
+    python3 setup.py build
59
+    python3 setup.py install
60 60
 
61 61
 Depending on your system, you might have to run the second command with
62 62
 administrator privileges (e.g. prefixing it with ``sudo``).
63 63
 
64 64
 After installation, tests can be run with::
65 65
 
66
-    python -c 'import kwant; kwant.test()'
66
+    python3 -c 'import kwant; kwant.test()'
67 67
 
68 68
 The tutorial examples can be found in the directory ``tutorial`` inside the root
69 69
 directory of the Kwant source distribution.
... ...
@@ -88,7 +88,7 @@ configuration file consists of sections, one for each dependency, led by a
88 88
 [dependency-name] header and followed by name = value entries.  Possible names
89 89
 are keyword arguments for ``distutils.core.Extension`` (For a complete list,
90 90
 see its `documentation
91
-<http://docs.python.org/2/distutils/apiref.html#distutils.core.Extension>`_).
91
+<http://docs.python.org/3/distutils/apiref.html#distutils.core.Extension>`_).
92 92
 The corresponding values are whitespace-separated lists of strings.
93 93
 
94 94
 The two currently possible sections are [lapack] and [mumps].  The former
... ...
@@ -124,7 +124,7 @@ from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu package
124 124
 ``librsvg2-bin``) are needed to convert SVG drawings into the PDF format.
125 125
 
126 126
 As a prerequisite for building the documentation, Kwant must have been built
127
-successfully using ``python setup.py build`` as described above (or Kwant must
127
+successfully using ``python3 setup.py build`` as described above (or Kwant must
128 128
 be already installed in Python's search path).  HTML documentation is built by
129 129
 entering the ``doc`` subdirectory of the Kwant package and executing ``make
130 130
 html``.  PDF documentation is generated by executing ``make latex`` followed
... ...
@@ -156,21 +156,24 @@ root.
156 156
 
157 157
 2. Unpack Tinyarray, enter its directory. To build and install, run ::
158 158
 
159
-       python setup.py build
160
-       sudo python setup.py install
159
+       python3 setup.py build
160
+       sudo python3 setup.py install
161 161
 
162 162
 3. Inside the Kwant source distribution's root directory run ::
163 163
 
164
-       python setup.py build
165
-       sudo python setup.py install
164
+       python3 setup.py build
165
+       sudo python3 setup.py install
166 166
 
167
-By default the package will be installed under ``/usr/local``.  Run ``python
167
+By default the package will be installed under ``/usr/local``.  Run ``python3
168 168
 setup.py --help install`` for installation options.
169 169
 
170 170
 
171 171
 Mac OS X: MacPorts
172 172
 ==================
173 173
 
174
+The following instructions are valid for Kwant 1.1 with Python 2.7.  They need
175
+to be updated for Kwant 1.2.  (Help is welcome.)
176
+
174 177
 The required dependencies of Kwant are best installed with one of the packaging
175 178
 systems. Here we only consider the case of `MacPorts
176 179
 <http://www.macports.org>`_ in detail. Some remarks for homebrew are given
... ...
@@ -193,7 +196,7 @@ below.
193 196
        python setup.py build
194 197
        sudo python setup.py install
195 198
 
196
-5. Unpack Kwant, go to the Kwant directory, and edit ``build.conf`` to read::
199
+p5. Unpack Kwant, go to the Kwant directory, and edit ``build.conf`` to read::
197 200
 
198 201
        [lapack]
199 202
        extra_link_args = -Wl,-framework -Wl,Accelerate
... ...
@@ -218,6 +221,9 @@ with the environment variables ``CC`` and ``LDSHARED`` as shown above.
218 221
 Mac OS X: homebrew
219 222
 ==================
220 223
 
224
+The following instructions are valid for Kwant 1.1 with Python 2.7.  They need
225
+to be updated for Kwant 1.2.  (Help is welcome.)
226
+
221 227
 It is also possible to build Kwant using homebrew. The dependencies can be
222 228
 installed as ::
223 229
 
Browse code

update link text in installation instructions

Christoph Groth authored on 08/12/2015 15:49:13
Showing 1 changed files
... ...
@@ -39,7 +39,7 @@ The following software is highly recommended though not strictly required:
39 39
    footprint.  (Kwant uses only the sequential, single core version
40 40
    of MUMPS.  The advantages due to MUMPS as used by Kwant are thus independent
41 41
    of the number of CPU cores of the machine on which Kwant runs.)
42
- * The `nose <http://nose.readthedocs.org/>`_ testing framework for running the
42
+ * The `nose testing framework <http://nose.readthedocs.org/>`_ for running the
43 43
    tests included with Kwant.
44 44
 
45 45
 In addition, to build a copy of Kwant that has been checked-out directly from
Browse code

update links to gitlab

Christoph Groth authored on 08/12/2015 15:44:09
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ Building Kwant requires
26 26
    (For best performance we recommend the free `OpenBLAS
27 27
    <http://xianyi.github.com/OpenBLAS/>`_ or the nonfree `MKL
28 28
    <http://software.intel.com/en-us/intel-mkl>`_.)
29
- * `Tinyarray <http://git.kwant-project.org/tinyarray/about/>`_, a NumPy-like
29
+ * `Tinyarray <https://gitlab.kwant-project.org/kwant/tinyarray>`_, a NumPy-like
30 30
    Python package optimized for very small arrays,
31 31
  * An environment which allows to compile Python extensions written in C and
32 32
    C++.
... ...
@@ -43,9 +43,9 @@ The following software is highly recommended though not strictly required:
43 43
    tests included with Kwant.
44 44
 
45 45
 In addition, to build a copy of Kwant that has been checked-out directly from
46
-`its Git repository <http://git.kwant-project.org/kwant>`_, you will also need
47
-`Cython <http://cython.org/>`_ 0.22 or newer.  You do not need Cython to build
48
-Kwant that has been unpacked from a source .tar.gz-file.
46
+version control, you will also need `Cython <http://cython.org/>`_ 0.22 or
47
+newer.  You do not need Cython to build Kwant that has been unpacked from a
48
+source .tar.gz-file.
49 49
 
50 50
 
51 51
 Building and installing Kwant
Browse code

revise installation and contribution instructions

I try to cleanly separate between information that should be part of the
Kwant source distribution (that is tied to a particular version of
Kwant), and generic information that is best presented on the website.

Christoph Groth authored on 03/12/2015 18:53:19
Showing 1 changed files
... ...
@@ -1,307 +1,26 @@
1
-=========================
2
-Installation instructions
3
-=========================
1
+=====================
2
+Installation of Kwant
3
+=====================
4 4
 
5
-Kwant can be installed either using prepared packages (Debian, Ubuntu, and Arch
6
-variants of GNU/Linux, Mac OS X, Microsoft Windows), or it can be built and
7
-installed from source.
5
+Ready-to-use Kwant packages are available for many platforms (like GNU/Linux,
6
+Mac OS X, Microsoft Windows).  See the `installation page of the Kwant website
7
+<http://kwant-project.org/install>`_ for instructions on how to install Kwant
8
+on your platform.  This is the recommended way for new users.
8 9
 
9
-In general, installation from packages is advisable, especially for novice
10
-users.  Expert users may find it helpful to build Kwant from source, as this
11
-will also allow them to customize Kwant to use certain optimized versions of
12
-libraries.
10
+The remainder of this section documents how to build Kwant from source.  This
11
+information is mostly of interest to contributors and packagers.
13 12
 
14
-************************
15
-Installing from packages
16
-************************
17 13
 
18
-
19
-Debian and derivatives
20
-======================
21
-
22
-The easiest way to install Kwant on a Debian system is using the pre-built
23
-packages we provide.  Our packages are known to work with Debian "wheezy" and
24
-Debian "jessie", but they may also work on many other recent Debian-derived
25
-sytems as well.  (For example, the following works with recent Ubuntu versions.)
26
-
27
-The lines prefixed with ``sudo`` have to be run as root.
28
-
29
-1. Add the following lines to ``/etc/apt/sources.list``::
30
-
31
-       deb http://downloads.kwant-project.org/debian/ stable main
32
-       deb-src http://downloads.kwant-project.org/debian/ stable main
33
-
34
-2. (Optional) Add the OpenPGP key used to sign the repositories by executing::
35
-
36
-       sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key C3F147F5980F3535
37
-
38
-   The fingerprint of the key is 5229 9057 FAD7 9965 3C4F 088A C3F1 47F5 980F
39
-   3535.
40
-
41
-3. Update the package data, and install Kwant::
42
-
43
-       sudo apt-get update
44
-       sudo apt-get install python-kwant python-kwant-doc
45
-
46
-   The ``python-kwant-doc`` package is optional and installs the HTML
47
-   documentation of Kwant in the directory ``/usr/share/doc/python-kwant-doc``.
48
-
49
-Should the last command (``apt-get install``) fail due to unresolved
50
-dependencies, you can try to build and install your own packages, which is
51
-surprisingly easy::
52
-
53
-    cd /tmp
54
-
55
-    sudo apt-get build-dep tinyarray
56
-    apt-get source --compile tinyarray
57
-    sudo dpkg -i python-tinyarray_*.deb
58
-
59
-    sudo apt-get build-dep kwant
60
-    apt-get source --compile kwant
61
-    sudo dpkg -i python-kwant_*.deb python-kwant-doc_*.deb
62
-
63
-This method should work for virtually all Debian-derived systems, even on exotic
64
-architectures.
65
-
66
-
67
-Ubuntu and derivatives
68
-======================
69
-
70
-Execute the following commands::
71
-
72
-    sudo apt-add-repository ppa:kwant-project/ppa
73
-    sudo apt-get update
74
-    sudo apt-get install python-kwant python-kwant-doc
75
-
76
-This should provide Kwant for all versions of Ubuntu >= 12.04.  The HTML
77
-documentation will be installed locally in the directory
78
-``/usr/share/doc/python-kwant-doc``.
79
-
80
-
81
-Arch Linux
82
-==========
83
-
84
-`Arch install scripts for Kwant
85
-<https://aur.archlinux.org/packages/python2-kwant/>`_ are kindly provided by
86
-Jörg Behrmann (formerly by Max Schlemmer).  To install, follow the `Arch User
87
-Repository installation instructions
88
-<https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages>`_.
89
-Note that for checking the validity of the package you need to add the key
90
-used for signing to your user's keyring via::
91
-
92
-    gpg --keyserver pool.sks-keyservers.net --recv-key C3F147F5980F3535
93
-
94
-The fingerprint of the key is 5229 9057 FAD7 9965 3C4F 088A C3F1 47F5 980F
95
-3535.
96
-
97
-
98
-Mac OS X
99
-========
100
-
101
-There is a number of different package managers for bringing software from the
102
-Unix/Linux world to Mac OS X. Since the community is quite split, we provide
103
-Kwant and its dependencies both via the `homebrew <http://brew.sh>`_ and the
104
-`MacPorts <http://www.macports.org>`_ systems.
105
-
106
-
107
-Mac OS X: homebrew
108
-==================
109
-
110
-homebrew is a recent addition to the package managers on Mac OS X. It is
111
-lightweight, tries to be as minimalistic as possible and give the user
112
-freedom than Macports. We recommend this option if you have no preferences.
113
-
114
-1. Open a terminal and install homebrew as described on the `homebrew
115
-   homepage <http://brew.sh>`_ (instructions are towards the end of
116
-   the page)
117
-
118
-2. Run ::
119
-
120
-       brew doctor
121
-
122
-   and follow its directions. It will ask for a few prerequisites to be
123
-   installed, in particular
124
-
125
-  * the Xcode developer tools (compiler suite for Mac OS X) from
126
-    `<http://developer.apple.com/downloads>`_. You will need an Apple ID to
127
-    download. Note that if you have one already from using the App store on the
128
-    Mac/Ipad/Iphone/... you can use that one. Downloading the command line
129
-    tools (not the full Xcode suite) is sufficient. If you have the full Xcode
130
-    suite installed, you might need to download the command line tools manually
131
-    if you have version 4 or higher. In this case go to `Xcode->Preferences`,
132
-    click on `Download`, go to `Components`, select `Command Line Tools` and
133
-    click on `Install`.
134
-  * although `brew doctor` might not complain about it right away, while we're
135
-    at it, you should also install the X11 server from the `XQuartz project
136
-    <http://xquartz.macosforge.org>`_ if you have Mac OS X 10.8 or higher.
137
-
138
-3. Add permanently ``/usr/local/bin`` before ``/usr/bin/`` in the ``$PATH$``
139
-   environment variable of your shell, for example by adding ::
140
-
141
-       export PATH=/usr/local/bin:$PATH
142
-
143
-   at the end of your ``.bash_profile`` or ``.profile``. Then close
144
-   the terminal and reopen it again.
145
-
146
-4. Install a few prerequisites ::
147
-
148
-       brew install gfortran python
149
-
150
-5. Add additional repositories ::
151
-
152
-       brew tap homebrew/science
153
-       brew tap samueljohn/python
154
-       brew tap michaelwimmer/kwant
155
-
156
-6. Install Kwant and its prerequisites ::
157
-
158
-       pip install nose
159
-       brew install numpy scipy matplotlib
160
-       brew install kwant
161
-
162
-Notes:
163
-
164
-- If something does not work as expected, use ``brew doctor`` for
165
-  instructions (it will find conflicts and things like that).
166
-- As mentioned, homebrew allows for quite some freedom. In particular,
167
-  if you are an expert, you don't need necessarily to install
168
-  numpy/scipy/matplotlib from homebrew, but can use your own installation.
169
-  The only prerequisite is that they are importable from python. (the
170
-  Kwant installation will in any case complain if they are not)
171
-- In principle, you need not install the homebrew python, but could use
172
-  Apple's already installed python. Homebrew's python is more up-to-date,
173
-  though.
174
-
175
-
176
-Mac OS X: MacPorts
177
-==================
178
-
179
-MacPorts is a full-fledged package manager that recreates a whole Linux-like
180
-environment on your Mac.
181
-
182
-In order to install Kwant using MacPorts, you have to
183
-
184
-1. Install a recent version of MacPorts, as explained in the
185
-   `installation instructions of MacPorts
186
-   <http://www.macports.org/install.php>`_.
187
-   In particular, as explained there, you will have to install also a
188
-   few prerequisites, namely
189
-
190
-  * the Xcode developer tools (compiler suite for Mac OS X) from
191
-    `<http://developer.apple.com/downloads>`_. You will need an Apple ID to
192
-    download. Note that if you have one already from using the App store
193
-    on the Mac/Ipad/Iphone/... you can use that one. You will also need the
194
-    command line tools: Within Xcode 4, you have to download them by going to
195
-    `Xcode->Preferences`, click on `Download`, go to `Components`,
196
-    select `Command Line Tools` and click on `Install`. Alternatively, you can
197
-    also directly download the command line tools from the
198
-    Apple developer website.
199
-  * if you have Mac OS X 10.8 or higher, the X11 server from the
200
-    `XQuartz project <http://xquartz.macosforge.org>`_.
201
-
202
-2. After the installation, open a terminal and execute ::
203
-
204
-       echo http://downloads.kwant-project.org/macports/ports.tar |\
205
-       sudo tee -a /opt/local/etc/macports/sources.conf >/dev/null
206
-
207
-   (this adds the Kwant MacPorts download link
208
-   `<http://downloads.kwant-project.org/macports/ports.tar>`_ at the end of the
209
-   ``sources.conf`` file.)
210
-
211
-3. Execute ::
212
-
213
-       sudo port selfupdate
214
-
215
-4. Now, install Kwant and its prerequisites ::
216
-
217
-       sudo port install py27-kwant
218
-
219
-5. Finally, we choose python 2.7 to be the default python ::
220
-
221
-       sudo port select --set python python27
222
-
223
-   After that, you will need to close and reopen the terminal to
224
-   have all changes in effect.
225
-
226
-Notes:
227
-
228
-* If you have problems with macports because your institution's firewall
229
-  blocks macports (more precisely, the `rsync` port), resulting in
230
-  errors from ``sudo port selfupdate``, follow
231
-  `these instructions <https://trac.macports.org/wiki/howto/PortTreeTarball>`_.
232
-* Of course, if you already have macports installed, you can skip step 1
233
-  and continue with step 2.
234
-
235
-
236
-Microsoft Windows
237
-=================
238
-
239
-There are multiple distributions of scientific Python software for Windows that
240
-provide the prerequisites for Kwant.  We recommend to use the packages kindly
241
-provided by Christoph Gohlke.  To install Kwant on Windows
242
-
243
-1. Determine whether you have a 32-bit or 64-bit Windows installation by
244
-   following these `instructions <http://support.microsoft.com/kb/827218>`_.
245
-
246
-2. Download and install Python 2.7 for the appropriate architecture (32-bit or
247
-   64-bit) from the official `Python download site
248
-   <http://www.python.org/download/>`_.
249
-
250
-3. Open a command prompt, as described in "How do I get a command prompt" at
251
-   the `Microsoft Windows website
252
-   <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
253
-
254
-4. In the command prompt window, execute::
255
-
256
-        C:\Python27\python.exe C:\Python27\Tools\Scripts\win_add2path.py
257
-
258
-   (Instead of typing this command, you can also just copy it from here and
259
-   paste it into the command prompt window). If you did not use the default
260
-   location to install Python in step 2, then replace ``C:\Python27`` by the
261
-   actual location where Python is installed.
262
-
263
-5. Reboot your computer.
264
-
265
-6. Download the necessary packages (with the ending ``.whl``) for your
266
-   operating system (32 or 64 bit) and Python version (e.g. ``cp27`` for Python
267
-   2.7) from the `website of Christoph Gohlke
268
-   <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_.  For Kwant, we recommend to
269
-   download at least `NumPy
270
-   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy>`__, `SciPy
271
-   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy>`__, `Matplotlib
272
-   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib>`__, `Nose
273
-   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#nose>`__, `Tinyarray
274
-   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#tinyarray>`__, and `Kwant
275
-   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#kwant>`__ itself.
276
-
277
-7. Now open a command prompt with administrator rights, as described in "How do
278
-   I run a command with elevated permissions" at the `Microsoft Windows website
279
-   <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
280
-
281
-   In this new command prompt window, execute ::
282
-
283
-       pip install <filename>
284
-
285
-   for each of the downloaded files (replacing ``<filename>`` with it).
286
-
287
-   Now you are done, you can ``import kwant`` from within Python scripts.
288
-
289
-(Note that many other userful scientific packages are available in Gohlke’s
290
-repository.  For example, you might want to install `IPython
291
-<http://www.lfd.uci.edu/~gohlke/pythonlibs/#ipython>`_ and its various
292
-dependencies so that you can use the `IPython notebook
293
-<http://ipython.org/notebook.html>`_.)
294
-
295
-
296
-***********************************
297
-Building and installing from source
298
-***********************************
14
+********************
15
+Generic instructions
16
+********************
299 17
 
300 18
 Prerequisites
301 19
 =============
302 20
 
303 21
 Building Kwant requires
304
- * `Python <http://python.org>`_ 2.6 or 2.7 (Python 3 is not supported yet),
22
+ * `Python <http://python.org>`_ 2.6 or 2.7 (Python 3 is supported by
23
+   Kwant 1.2 and above),
305 24
  * `SciPy <http://scipy.org>`_ 0.9 or newer,
306 25
  * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
307 26
    (For best performance we recommend the free `OpenBLAS
... ...
@@ -329,18 +48,18 @@ In addition, to build a copy of Kwant that has been checked-out directly from
329 48
 Kwant that has been unpacked from a source .tar.gz-file.
330 49
 
331 50
 
332
-Generic instructions
333
-====================
51
+Building and installing Kwant
52
+=============================
334 53
 
335 54
 Kwant can be built and installed following the `usual Python conventions
336 55
 <http://docs.python.org/install/index.html>`_ by running the following commands
337 56
 in the root directory of the Kwant distribution. ::
338 57
 
339
-    pip install .
58
+    python setup.py build
59
+    python setup.py install
340 60
 
341 61
 Depending on your system, you might have to run the second command with
342
-administrator privileges (e.g. prefixing it with ``sudo``). If you use Python
343
-older than 2.7.9, see `pip installation instructions <https://docs.python.org/2/installing/#install-pip-in-versions-of-python-prior-to-python-2-7-9>`_.
62
+administrator privileges (e.g. prefixing it with ``sudo``).
344 63
 
345 64
 After installation, tests can be run with::
346 65
 
... ...
@@ -349,12 +68,83 @@ After installation, tests can be run with::
349 68
 The tutorial examples can be found in the directory ``tutorial`` inside the root
350 69
 directory of the Kwant source distribution.
351 70
 
71
+(Cython will be run automatically when the source tree has been checked out of
72
+version control.  Kwant tarballs include the Cython-generated files, and
73
+cythonization is disabled when building not from git.  If ever necessary, this
74
+default can be overridden by giving the ``--cython`` option to setup.py.)
75
+
76
+
77
+Build configuration
78
+===================
79
+
80
+The setup script of Kwant has to know how to link against LAPACK & BLAS, and,
81
+optionally, MUMPS.  By default it will assume that LAPACK and BLAS can be found
82
+under their usual names.  MUMPS will be not linked against by default, except
83
+on Debian-based systems when the package ``libmumps-scotch-dev`` is installed.
84
+
85
+All these settings can be configured by creating/editing the file
86
+``build.conf`` in the root directory of the Kwant distribution.  This
87
+configuration file consists of sections, one for each dependency, led by a
88
+[dependency-name] header and followed by name = value entries.  Possible names
89
+are keyword arguments for ``distutils.core.Extension`` (For a complete list,
90
+see its `documentation
91
+<http://docs.python.org/2/distutils/apiref.html#distutils.core.Extension>`_).
92
+The corresponding values are whitespace-separated lists of strings.
93
+
94
+The two currently possible sections are [lapack] and [mumps].  The former
95
+configures the linking against LAPACK _AND_ BLAS, the latter against MUMPS
96
+(without LAPACK and BLAS).
97
+
98
+Example ``build.conf`` for linking Kwant against a self-compiled MUMPS, `SCOTCH
99
+<http://www.labri.fr/perso/pelegrin/scotch/>`_ and `METIS
100
+<http://glaros.dtc.umn.edu/gkhome/metis/metis/overview>`_::
101
+
102
+    [mumps]
103
+    libraries = zmumps mumps_common pord metis esmumps scotch scotcherr mpiseq gfortran
104
+
105
+Example ``build.conf`` for linking Kwant with Intel MKL.::
106
+
107
+    [lapack]
108
+    libraries = mkl_intel_lp64 mkl_sequential mkl_core mkl_def
109
+    library_dirs = /opt/intel/mkl/lib/intel64
110
+    extra_link_args = -Wl,-rpath=/opt/intel/mkl/lib/intel64
111
+
112
+The detailed syntax of ``build.conf`` is explained in the `documentation of
113
+Python's configparser module
114
+<http://docs.python.org/3/library/configparser.html#supported-ini-file-structure>`_.
115
+
116
+
117
+Building the documentation
118
+==========================
119
+
120
+To build the documentation, the `Sphinx documentation generator
121
+<http://sphinx.pocoo.org/>`_ is required with ``numpydoc`` extension
122
+(version 0.5 or newer).  If PDF documentation is to be built, the tools
123
+from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu package
124
+``librsvg2-bin``) are needed to convert SVG drawings into the PDF format.
125
+
126
+As a prerequisite for building the documentation, Kwant must have been built
127
+successfully using ``python setup.py build`` as described above (or Kwant must
128
+be already installed in Python's search path).  HTML documentation is built by
129
+entering the ``doc`` subdirectory of the Kwant package and executing ``make
130
+html``.  PDF documentation is generated by executing ``make latex`` followed
131
+by ``make all-pdf`` in ``doc/build/latex``.
132
+
133
+Because of some quirks of how Sphinx works, it might be necessary to execute
134
+``make clean`` between building HTML and PDF documentation.  If this is not
135
+done, Sphinx may mistakenly use PNG files for PDF output or other problems may
136
+appear.
137
+
138
+
139
+****************************
140
+Hints for specific platforms
141
+****************************
352 142
 
353 143
 Unix-like systems (GNU/Linux)
354 144
 =============================
355 145
 
356 146
 Kwant should run on all recent Unix-like systems.  The following instructions
357
-have been verified to work on Debian 7 (Wheezy) or newer, and on Ubuntu 12.04 or
147
+have been verified to work on Debian 8 (Jessie) or newer, and on Ubuntu 14.04 or
358 148
 newer.  For other distributions step 1 will likely have to be adapted.  If
359 149
 Ubuntu-style ``sudo`` is not available, the respective command must be run as
360 150
 root.
... ...
@@ -366,15 +156,16 @@ root.
366 156
 
367 157
 2. Unpack Tinyarray, enter its directory. To build and install, run ::
368 158
 
369
-       sudo pip install .
159
+       python setup.py build
160
+       sudo python setup.py install
370 161
 
371 162
 3. Inside the Kwant source distribution's root directory run ::
372 163
 
373
-       sudo pip install .
164
+       python setup.py build
165
+       sudo python setup.py install
374 166
 
375
-By default the package will be installed under ``/usr/local``.  Type ``pip help
376
-install`` for installation options and see `pip documentation
377
-<https://pip.readthedocs.org>`_ for a detailed description of ``pip``.
167
+By default the package will be installed under ``/usr/local``.  Run ``python
168
+setup.py --help install`` for installation options.
378 169
 
379 170
 
380 171
 Mac OS X: MacPorts
... ...
@@ -385,8 +176,12 @@ systems. Here we only consider the case of `MacPorts
385 176
 <http://www.macports.org>`_ in detail. Some remarks for homebrew are given
386 177
 below.
387 178
 
388
-1. In order to set up MacPorts or homebrew, follow steps 1 - 3 of
389
-   the respective instructions of `MacPorts`_
179
+1. Install a recent version of MacPorts, as explained in the `installation
180
+   instructions of MacPorts <http://www.macports.org/install.php>`_.  `The
181
+   MacPorts section of the Kwant website
182
+   <http://kwant-project.org/install#mac-os-x-macports>`_ may be also of
183
+   interest.  (Note that it describes how to install Kwant using a ports file,
184
+   while the aim here is to install from source manually.)
390 185
 
391 186
 2. Install the required dependencies::
392 187
 
... ...
@@ -429,18 +224,18 @@ installed as ::
429 224
     brew install gcc python
430 225
     brew tap homebrew/science
431 226
     brew tap homebrew/python
432
-    brew tap michaelwimmer/kwant
227
+    brew tap kwant-project/kwant
433 228
     pip install nose six
434 229
     brew install numpy scipy matplotlib
435 230
 
436 231
 Note that during the installation you will be told which paths to add when you
437 232
 want to compile/link against scotch/metis/mumps; you need to add these to the
438
-build.conf file. Also, when linking against mumps, one needs also to link
439
-against metis (in addition to the libraries needed for MacPorts).
233
+build.conf file. Also, when linking against MUMPS, one needs also to link
234
+against METIS (in addition to the libraries needed for MacPorts).
440 235
 
441 236
 
442
-Windows
443
-=======
237
+Microsoft Windows
238
+=================
444 239
 
445 240
 Our efforts to compile Kwant on Windows using only free software (MinGW) were
446 241
 only moderately successful.  At the end of a very complicated process we
... ...
@@ -452,66 +247,3 @@ It is possible to compile Kwant on Windows using non-free compilers, however we
452 247
 (the authors of Kwant) have no experience with this.  The existing Windows
453 248
 binary installers of Kwant and Tinyarray were kindly prepared by Christoph
454 249
 Gohlke.
455
-
456
-
457
-Build configuration
458
-===================
459
-
460
-The setup script of Kwant has to know how to link against LAPACK & BLAS, and,
461
-optionally, MUMPS.  By default it will assume that LAPACK and BLAS can be found
462
-under their usual names.  MUMPS will be not linked against by default, except
463
-on Debian-based systems when the package ``libmumps-scotch-dev`` is installed.
464
-
465
-All these settings can be configured by creating/editing the file
466
-``build.conf`` in the root directory of the Kwant distribution.  This
467
-configuration file consists of sections, one for each dependency, led by a
468
-[dependency-name] header and followed by name = value entries.  Possible names
469
-are keyword arguments for ``distutils.core.Extension`` (For a complete list,
470
-see its `documentation
471
-<http://docs.python.org/2/distutils/apiref.html#distutils.core.Extension>`_).
472
-The corresponding values are whitespace-separated lists of strings.
473
-
474
-The two currently possible sections are [lapack] and [mumps].  The former
475
-configures the linking against LAPACK _AND_ BLAS, the latter against MUMPS
476
-(without LAPACK and BLAS).
477
-
478
-Example ``build.conf`` for linking Kwant against a self-compiled MUMPS, `SCOTCH
479
-<http://www.labri.fr/perso/pelegrin/scotch/>`_ and `METIS
480
-<http://glaros.dtc.umn.edu/gkhome/metis/metis/overview>`_::
481
-
482
-    [mumps]
483
-    libraries = zmumps mumps_common pord metis esmumps scotch scotcherr mpiseq
484
-        gfortran
485
-
486
-Example ``build.conf`` for linking Kwant with Intel MKL.::
487
-
488
-    [lapack]
489
-    libraries = mkl_intel_lp64 mkl_sequential mkl_core mkl_def
490
-    library_dirs = /opt/intel/mkl/lib/intel64
491
-    extra_link_args = -Wl,-rpath=/opt/intel/mkl/lib/intel64
492
-
493
-The detailed syntax of ``build.conf`` is explained in the `documentation of
494
-Python's configparser module
495
-<http://docs.python.org/3/library/configparser.html#supported-ini-file-structure>`_.
496
-
497
-
498
-Building the documentation
499
-==========================
500
-
501
-To build the documentation, the `Sphinx documentation generator
502
-<http://sphinx.pocoo.org/>`_ is required with ``numpydoc`` extension
503
-(version 0.5 or newer).  If PDF documentation is to be built, the tools
504
-from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu package
505
-``librsvg2-bin``) are needed to convert SVG drawings into the PDF format.
506
-
507
-As a prerequisite for building the documentation, Kwant must have been built
508
-successfully using ``./setup.py build`` as described above (or Kwant must be
509
-already installed in Python's search path).  HTML documentation is built by
510
-entering the ``doc`` subdirectory of the Kwant package and executing ``make
511
-html``.  PDF documentation is generated by executing ``make latex`` followed by
512
-``make all-pdf`` in ``doc/build/latex``.
513
-
514
-Because of some quirks of how Sphinx works, it might be necessary to execute
515
-``make clean`` between building HTML and PDF documentation.  If this is not
516
-done, Sphinx may mistakenly use PNG files for PDF output or other problems may
517
-appear.
Browse code

instruct to use pip for linux source builds

Anton Akhmerov authored on 14/10/2015 15:48:51 • Christoph Groth committed on 20/10/2015 23:09:47
Showing 1 changed files
... ...
@@ -336,11 +336,11 @@ Kwant can be built and installed following the `usual Python conventions
336 336
 <http://docs.python.org/install/index.html>`_ by running the following commands
337 337
 in the root directory of the Kwant distribution. ::
338 338
 
339
-    python setup.py build
340
-    python setup.py install
339
+    pip install .
341 340
 
342 341
 Depending on your system, you might have to run the second command with
343
-administrator privileges (e.g. prefixing it with ``sudo``).
342
+administrator privileges (e.g. prefixing it with ``sudo``). If you use Python
343
+older than 2.7.9, see `pip installation instructions <https://docs.python.org/2/installing/#install-pip-in-versions-of-python-prior-to-python-2-7-9>`_.
344 344
 
345 345
 After installation, tests can be run with::
346 346
 
... ...
@@ -366,31 +366,15 @@ root.
366 366
 
367 367
 2. Unpack Tinyarray, enter its directory. To build and install, run ::
368 368
 
369
-       python setup.py build
370
-       sudo python setup.py install
369
+       sudo pip install .
371 370
 
372 371
 3. Inside the Kwant source distribution's root directory run ::
373 372
 
374
-       python setup.py build
375
-       sudo python setup.py install
376
-
377
-By default the package will be installed under ``/usr/local``.  You can
378
-change this using the ``--prefix`` option, e.g.::
379
-
380
-    sudo python setup.py install --prefix=/opt
381
-
382
-If you would like to install Kwant into your home directory only you can use ::
383
-
384
-    python setup.py install --home=~
385
-
386
-This does not require root privileges.  If you install Kwant in this way
387
-be sure to tell python where to find it.  This can be done by setting the
388
-``PYTHONPATH`` environment variable::
389
-
390
-    export PYTHONPATH=$HOME/lib/python
373
+       sudo pip install .
391 374
 
392
-You can make this setting permanent by adding this line to the file
393
-``.bashrc`` (or equivalent) in your home directory.
375
+By default the package will be installed under ``/usr/local``.  Type ``pip help
376
+install`` for installation options and see `pip documentation
377
+<https://pip.readthedocs.org>`_ for a detailed description of ``pip``.
394 378
 
395 379
 
396 380
 Mac OS X: MacPorts
Browse code

fill INSTALL.rst

Christoph Groth authored on 09/10/2015 13:31:57
Showing 1 changed files
... ...
@@ -2,7 +2,9 @@
2 2
 Installation instructions
3 3
 =========================
4 4
 
5
-Kwant can be installed either using prepared packages (Debian, Ubuntu, and Arch variants of GNU/Linux, Mac OS X, Microsoft Windows), or it can be built and installed from source.
5
+Kwant can be installed either using prepared packages (Debian, Ubuntu, and Arch
6
+variants of GNU/Linux, Mac OS X, Microsoft Windows), or it can be built and
7
+installed from source.
6 8
 
7 9
 In general, installation from packages is advisable, especially for novice
8 10
 users.  Expert users may find it helpful to build Kwant from source, as this
... ...
@@ -246,7 +248,8 @@ provided by Christoph Gohlke.  To install Kwant on Windows
246 248
    <http://www.python.org/download/>`_.
247 249
 
248 250
 3. Open a command prompt, as described in "How do I get a command prompt" at
249
-   the `Microsoft Windows website <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
251
+   the `Microsoft Windows website
252
+   <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
250 253
 
251 254
 4. In the command prompt window, execute::
252 255
 
... ...
@@ -262,11 +265,18 @@ provided by Christoph Gohlke.  To install Kwant on Windows
262 265
 6. Download the necessary packages (with the ending ``.whl``) for your
263 266
    operating system (32 or 64 bit) and Python version (e.g. ``cp27`` for Python
264 267
    2.7) from the `website of Christoph Gohlke
265
-   <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_.  For Kwant, we recommend to download at least `NumPy <http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy>`__, `SciPy <http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy>`__, `Matplotlib <http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib>`__, `Nose <http://www.lfd.uci.edu/~gohlke/pythonlibs/#nose>`__, `Tinyarray <http://www.lfd.uci.edu/~gohlke/pythonlibs/#tinyarray>`__, and `Kwant <http://www.lfd.uci.edu/~gohlke/pythonlibs/#kwant>`__ itself.
266
-
267
-7. Now open a command prompt with administrator rights, as described in
268
-   "How do I run a command with elevated permissions" at the
269
-   `Microsoft Windows website <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
268
+   <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_.  For Kwant, we recommend to
269
+   download at least `NumPy
270
+   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy>`__, `SciPy
271
+   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy>`__, `Matplotlib
272
+   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib>`__, `Nose
273
+   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#nose>`__, `Tinyarray
274
+   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#tinyarray>`__, and `Kwant
275
+   <http://www.lfd.uci.edu/~gohlke/pythonlibs/#kwant>`__ itself.
276
+
277
+7. Now open a command prompt with administrator rights, as described in "How do
278
+   I run a command with elevated permissions" at the `Microsoft Windows website
279
+   <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
270 280
 
271 281
    In this new command prompt window, execute ::
272 282
 
... ...
@@ -279,7 +289,8 @@ provided by Christoph Gohlke.  To install Kwant on Windows
279 289
 (Note that many other userful scientific packages are available in Gohlke’s
280 290
 repository.  For example, you might want to install `IPython
281 291
 <http://www.lfd.uci.edu/~gohlke/pythonlibs/#ipython>`_ and its various
282
-dependencies so that you can use the `IPython notebook <http://ipython.org/notebook.html>`_.)
292
+dependencies so that you can use the `IPython notebook
293
+<http://ipython.org/notebook.html>`_.)
283 294
 
284 295
 
285 296
 ***********************************
Browse code

update installation instructions (include Arch)

Christoph Groth authored on 16/09/2015 16:57:22
Showing 1 changed files
... ...
@@ -2,23 +2,20 @@
2 2
 Installation instructions
3 3
 =========================
4 4
 
5
-Kwant can be installed either using prepared packages (Debian and Ubuntu
6
-variants of GNU/Linux, Mac OS X, and Microsoft Windows), or it can be built
7
-and installed from source.
5
+Kwant can be installed either using prepared packages (Debian, Ubuntu, and Arch variants of GNU/Linux, Mac OS X, Microsoft Windows), or it can be built and installed from source.
8 6
 
9 7
 In general, installation from packages is advisable, especially for novice
10 8
 users.  Expert users may find it helpful to build Kwant from source, as this
11 9
 will also allow them to customize Kwant to use certain optimized versions of
12 10
 libraries.
13 11
 
14
-
15 12
 ************************
16 13
 Installing from packages
17 14
 ************************
18 15
 
19 16
 
20
-Debian (and derivatives)
21
-========================
17
+Debian and derivatives
18
+======================
22 19
 
23 20
 The easiest way to install Kwant on a Debian system is using the pre-built
24 21
 packages we provide.  Our packages are known to work with Debian "wheezy" and
... ...
@@ -34,7 +31,10 @@ The lines prefixed with ``sudo`` have to be run as root.
34 31
 
35 32
 2. (Optional) Add the OpenPGP key used to sign the repositories by executing::
36 33
 
37
-       sudo apt-key adv --keyserver pgp.mit.edu --recv-key C3F147F5980F3535
34
+       sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key C3F147F5980F3535
35
+
36
+   The fingerprint of the key is 5229 9057 FAD7 9965 3C4F 088A C3F1 47F5 980F
37
+   3535.
38 38
 
39 39
 3. Update the package data, and install Kwant::
40 40
 
... ...
@@ -62,8 +62,8 @@ This method should work for virtually all Debian-derived systems, even on exotic
62 62
 architectures.
63 63
 
64 64
 
65
-Ubuntu (and derivatives)
66
-========================
65
+Ubuntu and derivatives
66
+======================
67 67
 
68 68
 Execute the following commands::
69 69
 
... ...
@@ -76,6 +76,23 @@ documentation will be installed locally in the directory
76 76
 ``/usr/share/doc/python-kwant-doc``.
77 77
 
78 78
 
79
+Arch Linux
80
+==========
81
+
82
+`Arch install scripts for Kwant
83
+<https://aur.archlinux.org/packages/python2-kwant/>`_ are kindly provided by
84
+Jörg Behrmann (formerly by Max Schlemmer).  To install, follow the `Arch User
85
+Repository installation instructions
86
+<https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages>`_.
87
+Note that for checking the validity of the package you need to add the key
88
+used for signing to your user's keyring via::
89
+
90
+    gpg --keyserver pool.sks-keyservers.net --recv-key C3F147F5980F3535
91
+
92
+The fingerprint of the key is 5229 9057 FAD7 9965 3C4F 088A C3F1 47F5 980F
93
+3535.
94
+
95
+
79 96
 Mac OS X
80 97
 ========
81 98
 
Browse code

Merge branch 'stable'

Christoph Groth authored on 11/09/2015 22:00:52
Showing 0 changed files
Browse code

update installation instructions for windows

Christoph Groth authored on 11/09/2015 15:39:01
Showing 1 changed files
... ...
@@ -3,8 +3,8 @@ Installation instructions
3 3
 =========================
4 4
 
5 5
 Kwant can be installed either using prepared packages (Debian and Ubuntu
6
-variants of GNU/Linux, Mac OS X, and Windows), or it can be built and installed
7
-from source.
6
+variants of GNU/Linux, Mac OS X, and Microsoft Windows), or it can be built
7
+and installed from source.
8 8
 
9 9
 In general, installation from packages is advisable, especially for novice
10 10
 users.  Expert users may find it helpful to build Kwant from source, as this
... ...
@@ -16,19 +16,6 @@ libraries.
16 16
 Installing from packages
17 17
 ************************
18 18
 
19
-Ubuntu (and derivatives)
20
-========================
21
-
22
-Execute the following commands::
23
-
24
-    sudo apt-add-repository ppa:kwant-project/ppa
25
-    sudo apt-get update
26
-    sudo apt-get install python-kwant python-kwant-doc
27
-
28
-This should provide Kwant for all versions of Ubuntu >= 12.04.  The HTML
29
-documentation will be installed locally in the directory
30
-``/usr/share/doc/python-kwant-doc``.
31
-
32 19
 
33 20
 Debian (and derivatives)
34 21
 ========================
... ...
@@ -75,30 +62,18 @@ This method should work for virtually all Debian-derived systems, even on exotic
75 62
 architectures.
76 63
 
77 64
 
78
-Windows
79
-=======
80
-
81
-There are multiple distributions of scientific Python software for Windows that
82
-provide the prerequisites for Kwant.  We recommend to use the packages kindly
83
-provided by Christoph Gohlke.  To install Kwant on Windows
84
-
85
-1. Determine whether you have a 32-bit or 64-bit Windows installation by
86
-   following these `instructions <http://support.microsoft.com/kb/827218>`_.
65
+Ubuntu (and derivatives)
66
+========================
87 67
 
88
-2. Download and install Python 2.7 for the appropriate architecture (32-bit or
89
-   64-bit) from the official `Python download site
90
-   <http://www.python.org/download/>`_.
68
+Execute the following commands::
91 69
 
92
-3. Download and install ``scipy-stack``, ``tinyarray``, and ``kwant`` for Python
93
-   2.7 from `Christoph Gohlke's page
94
-   <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_.  Once again you should choose
95
-   the architecture that is appropriate for your system.  ("win32" means 32-bit,
96
-   "amd64" means 64-bit -- even if you have a processor from Intel.)  If the
97
-   download from Gohlke's site is slow, try to download from `our mirror
98
-   <http://downloads.kwant-project.org/gohlke-mirror/>`_.
70
+    sudo apt-add-repository ppa:kwant-project/ppa
71
+    sudo apt-get update
72
+    sudo apt-get install python-kwant python-kwant-doc
99 73
 
100
-   You may see a warning that says "The publisher could not be verified. Do you
101
-   want to run this software?". Select "Run".
74
+This should provide Kwant for all versions of Ubuntu >= 12.04.  The HTML
75
+documentation will be installed locally in the directory
76
+``/usr/share/doc/python-kwant-doc``.
102 77
 
103 78
 
104 79
 Mac OS X
... ...
@@ -239,6 +214,57 @@ Notes:
239 214
   and continue with step 2.
240 215
 
241 216
 
217
+Microsoft Windows
218
+=================
219
+
220
+There are multiple distributions of scientific Python software for Windows that
221
+provide the prerequisites for Kwant.  We recommend to use the packages kindly
222
+provided by Christoph Gohlke.  To install Kwant on Windows
223
+
224
+1. Determine whether you have a 32-bit or 64-bit Windows installation by
225
+   following these `instructions <http://support.microsoft.com/kb/827218>`_.
226
+
227
+2. Download and install Python 2.7 for the appropriate architecture (32-bit or
228
+   64-bit) from the official `Python download site
229
+   <http://www.python.org/download/>`_.
230
+
231
+3. Open a command prompt, as described in "How do I get a command prompt" at
232
+   the `Microsoft Windows website <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
233
+
234
+4. In the command prompt window, execute::
235
+
236
+        C:\Python27\python.exe C:\Python27\Tools\Scripts\win_add2path.py
237
+
238
+   (Instead of typing this command, you can also just copy it from here and
239
+   paste it into the command prompt window). If you did not use the default
240
+   location to install Python in step 2, then replace ``C:\Python27`` by the
241
+   actual location where Python is installed.
242
+
243
+5. Reboot your computer.
244
+
245
+6. Download the necessary packages (with the ending ``.whl``) for your
246
+   operating system (32 or 64 bit) and Python version (e.g. ``cp27`` for Python
247
+   2.7) from the `website of Christoph Gohlke
248
+   <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_.  For Kwant, we recommend to download at least `NumPy <http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy>`__, `SciPy <http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy>`__, `Matplotlib <http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib>`__, `Nose <http://www.lfd.uci.edu/~gohlke/pythonlibs/#nose>`__, `Tinyarray <http://www.lfd.uci.edu/~gohlke/pythonlibs/#tinyarray>`__, and `Kwant <http://www.lfd.uci.edu/~gohlke/pythonlibs/#kwant>`__ itself.
249
+
250
+7. Now open a command prompt with administrator rights, as described in
251
+   "How do I run a command with elevated permissions" at the
252
+   `Microsoft Windows website <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
253
+
254
+   In this new command prompt window, execute ::
255
+
256
+       pip install <filename>
257
+
258
+   for each of the downloaded files (replacing ``<filename>`` with it).
259
+
260
+   Now you are done, you can ``import kwant`` from within Python scripts.
261
+
262
+(Note that many other userful scientific packages are available in Gohlke’s
263
+repository.  For example, you might want to install `IPython
264
+<http://www.lfd.uci.edu/~gohlke/pythonlibs/#ipython>`_ and its various
265
+dependencies so that you can use the `IPython notebook <http://ipython.org/notebook.html>`_.)
266
+
267
+
242 268
 ***********************************
243 269
 Building and installing from source
244 270
 ***********************************
Browse code

bump required cython version

Christoph Groth authored on 04/08/2015 21:20:49
Showing 1 changed files
... ...
@@ -271,7 +271,7 @@ The following software is highly recommended though not strictly required:
271 271
 
272 272
 In addition, to build a copy of Kwant that has been checked-out directly from
273 273
 `its Git repository <http://git.kwant-project.org/kwant>`_, you will also need
274
-`Cython <http://cython.org/>`_ 0.17.1 or newer.  You do not need Cython to build
274
+`Cython <http://cython.org/>`_ 0.22 or newer.  You do not need Cython to build
275 275
 Kwant that has been unpacked from a source .tar.gz-file.
276 276
 
277 277
 
Browse code

remove numpydoc (it is on pypi)

Anton Akhmerov authored on 23/07/2015 01:33:32 • Christoph Groth committed on 27/07/2015 11:54:30
Showing 1 changed files
... ...
@@ -461,10 +461,10 @@ Building the documentation
461 461
 ==========================
462 462
 
463 463
 To build the documentation, the `Sphinx documentation generator
464
-<http://sphinx.pocoo.org/>`_ is required.  If PDF documentation is to be built,
465
-the tools from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu
466
-package ``librsvg2-bin``) are needed to convert SVG drawings into the PDF
467
-format.
464
+<http://sphinx.pocoo.org/>`_ is required with ``numpydoc`` extension
465
+(version 0.5 or newer).  If PDF documentation is to be built, the tools
466
+from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu package
467
+``librsvg2-bin``) are needed to convert SVG drawings into the PDF format.
468 468
 
469 469
 As a prerequisite for building the documentation, Kwant must have been built
470 470
 successfully using ``./setup.py build`` as described above (or Kwant must be
Browse code

doc: fix typo reported by Benoit Gaury

Christoph Groth authored on 14/04/2015 11:37:54
Showing 1 changed files
... ...
@@ -420,7 +420,7 @@ Build configuration
420 420
 ===================
421 421
 
422 422
 The setup script of Kwant has to know how to link against LAPACK & BLAS, and,
423
-optionally, MUMPS.  Be default it will assume that LAPACK and BLAS can be found
423
+optionally, MUMPS.  By default it will assume that LAPACK and BLAS can be found
424 424
 under their usual names.  MUMPS will be not linked against by default, except
425 425
 on Debian-based systems when the package ``libmumps-scotch-dev`` is installed.
426 426
 
Browse code

Merge branch 'stable'

Conflicts:
README

Christoph Groth authored on 04/02/2015 23:08:46
Showing 0 changed files
Browse code

add rst-extension to README (and similar files), expand README.rst into a PyPI-"homepage"

Christoph Groth authored on 03/02/2015 17:47:59
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,479 @@
1
+=========================
2
+Installation instructions
3
+=========================
4
+
5
+Kwant can be installed either using prepared packages (Debian and Ubuntu
6
+variants of GNU/Linux, Mac OS X, and Windows), or it can be built and installed
7
+from source.
8
+
9
+In general, installation from packages is advisable, especially for novice
10
+users.  Expert users may find it helpful to build Kwant from source, as this
11
+will also allow them to customize Kwant to use certain optimized versions of
12
+libraries.
13
+
14
+
15
+************************
16
+Installing from packages
17
+************************
18
+
19
+Ubuntu (and derivatives)
20
+========================
21
+
22
+Execute the following commands::
23
+
24
+    sudo apt-add-repository ppa:kwant-project/ppa
25
+    sudo apt-get update
26
+    sudo apt-get install python-kwant python-kwant-doc
27
+
28
+This should provide Kwant for all versions of Ubuntu >= 12.04.  The HTML
29
+documentation will be installed locally in the directory
30
+``/usr/share/doc/python-kwant-doc``.
31
+
32
+
33
+Debian (and derivatives)
34
+========================
35
+
36
+The easiest way to install Kwant on a Debian system is using the pre-built
37
+packages we provide.  Our packages are known to work with Debian "wheezy" and
38
+Debian "jessie", but they may also work on many other recent Debian-derived
39
+sytems as well.  (For example, the following works with recent Ubuntu versions.)
40
+
41
+The lines prefixed with ``sudo`` have to be run as root.
42
+
43
+1. Add the following lines to ``/etc/apt/sources.list``::
44
+
45
+       deb http://downloads.kwant-project.org/debian/ stable main
46
+       deb-src http://downloads.kwant-project.org/debian/ stable main
47
+
48
+2. (Optional) Add the OpenPGP key used to sign the repositories by executing::
49
+
50
+       sudo apt-key adv --keyserver pgp.mit.edu --recv-key C3F147F5980F3535
51
+
52
+3. Update the package data, and install Kwant::
53
+
54
+       sudo apt-get update
55
+       sudo apt-get install python-kwant python-kwant-doc
56
+
57
+   The ``python-kwant-doc`` package is optional and installs the HTML
58
+   documentation of Kwant in the directory ``/usr/share/doc/python-kwant-doc``.
59
+
60
+Should the last command (``apt-get install``) fail due to unresolved
61
+dependencies, you can try to build and install your own packages, which is
62
+surprisingly easy::
63
+
64
+    cd /tmp
65
+
66
+    sudo apt-get build-dep tinyarray
67
+    apt-get source --compile tinyarray
68
+    sudo dpkg -i python-tinyarray_*.deb
69
+
70
+    sudo apt-get build-dep kwant
71
+    apt-get source --compile kwant
72
+    sudo dpkg -i python-kwant_*.deb python-kwant-doc_*.deb
73
+
74
+This method should work for virtually all Debian-derived systems, even on exotic
75
+architectures.
76
+
77
+
78
+Windows
79
+=======
80
+
81
+There are multiple distributions of scientific Python software for Windows that
82
+provide the prerequisites for Kwant.  We recommend to use the packages kindly
83
+provided by Christoph Gohlke.  To install Kwant on Windows
84
+
85
+1. Determine whether you have a 32-bit or 64-bit Windows installation by
86
+   following these `instructions <http://support.microsoft.com/kb/827218>`_.
87
+
88
+2. Download and install Python 2.7 for the appropriate architecture (32-bit or
89
+   64-bit) from the official `Python download site
90
+   <http://www.python.org/download/>`_.
91
+
92
+3. Download and install ``scipy-stack``, ``tinyarray``, and ``kwant`` for Python
93
+   2.7 from `Christoph Gohlke's page
94
+   <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_.  Once again you should choose
95
+   the architecture that is appropriate for your system.  ("win32" means 32-bit,
96
+   "amd64" means 64-bit -- even if you have a processor from Intel.)  If the
97
+   download from Gohlke's site is slow, try to download from `our mirror
98
+   <http://downloads.kwant-project.org/gohlke-mirror/>`_.
99
+
100
+   You may see a warning that says "The publisher could not be verified. Do you
101
+   want to run this software?". Select "Run".
102
+
103
+
104
+Mac OS X
105
+========
106
+
107
+There is a number of different package managers for bringing software from the
108
+Unix/Linux world to Mac OS X. Since the community is quite split, we provide
109
+Kwant and its dependencies both via the `homebrew <http://brew.sh>`_ and the
110
+`MacPorts <http://www.macports.org>`_ systems.
111
+
112
+
113
+Mac OS X: homebrew
114
+==================
115
+
116
+homebrew is a recent addition to the package managers on Mac OS X. It is
117
+lightweight, tries to be as minimalistic as possible and give the user
118
+freedom than Macports. We recommend this option if you have no preferences.
119
+
120
+1. Open a terminal and install homebrew as described on the `homebrew
121
+   homepage <http://brew.sh>`_ (instructions are towards the end of
122
+   the page)
123
+
124
+2. Run ::
125
+
126
+       brew doctor
127
+
128
+   and follow its directions. It will ask for a few prerequisites to be
129
+   installed, in particular
130
+
131
+  * the Xcode developer tools (compiler suite for Mac OS X) from
132
+    `<http://developer.apple.com/downloads>`_. You will need an Apple ID to
133
+    download. Note that if you have one already from using the App store on the
134
+    Mac/Ipad/Iphone/... you can use that one. Downloading the command line
135
+    tools (not the full Xcode suite) is sufficient. If you have the full Xcode
136
+    suite installed, you might need to download the command line tools manually
137
+    if you have version 4 or higher. In this case go to `Xcode->Preferences`,
138
+    click on `Download`, go to `Components`, select `Command Line Tools` and
139
+    click on `Install`.
140
+  * although `brew doctor` might not complain about it right away, while we're
141
+    at it, you should also install the X11 server from the `XQuartz project
142
+    <http://xquartz.macosforge.org>`_ if you have Mac OS X 10.8 or higher.
143
+
144
+3. Add permanently ``/usr/local/bin`` before ``/usr/bin/`` in the ``$PATH$``
145
+   environment variable of your shell, for example by adding ::
146
+
147
+       export PATH=/usr/local/bin:$PATH
148
+
149
+   at the end of your ``.bash_profile`` or ``.profile``. Then close
150
+   the terminal and reopen it again.
151
+
152
+4. Install a few prerequisites ::
153
+
154
+       brew install gfortran python
155
+
156
+5. Add additional repositories ::
157
+
158
+       brew tap homebrew/science
159
+       brew tap samueljohn/python
160
+       brew tap michaelwimmer/kwant
161
+
162
+6. Install Kwant and its prerequisites ::
163
+
164
+       pip install nose
165
+       brew install numpy scipy matplotlib
166
+       brew install kwant
167
+
168
+Notes:
169
+
170
+- If something does not work as expected, use ``brew doctor`` for
171
+  instructions (it will find conflicts and things like that).
172
+- As mentioned, homebrew allows for quite some freedom. In particular,
173
+  if you are an expert, you don't need necessarily to install
174
+  numpy/scipy/matplotlib from homebrew, but can use your own installation.
175
+  The only prerequisite is that they are importable from python. (the
176
+  Kwant installation will in any case complain if they are not)
177
+- In principle, you need not install the homebrew python, but could use
178
+  Apple's already installed python. Homebrew's python is more up-to-date,
179
+  though.
180
+
181
+
182
+Mac OS X: MacPorts
183
+==================
184
+
185
+MacPorts is a full-fledged package manager that recreates a whole Linux-like
186
+environment on your Mac.
187
+
188
+In order to install Kwant using MacPorts, you have to
189
+
190
+1. Install a recent version of MacPorts, as explained in the
191
+   `installation instructions of MacPorts
192
+   <http://www.macports.org/install.php>`_.
193
+   In particular, as explained there, you will have to install also a
194
+   few prerequisites, namely
195
+
196
+  * the Xcode developer tools (compiler suite for Mac OS X) from
197
+    `<http://developer.apple.com/downloads>`_. You will need an Apple ID to
198
+    download. Note that if you have one already from using the App store
199
+    on the Mac/Ipad/Iphone/... you can use that one. You will also need the
200
+    command line tools: Within Xcode 4, you have to download them by going to
201
+    `Xcode->Preferences`, click on `Download`, go to `Components`,
202
+    select `Command Line Tools` and click on `Install`. Alternatively, you can
203
+    also directly download the command line tools from the
204
+    Apple developer website.
205
+  * if you have Mac OS X 10.8 or higher, the X11 server from the
206
+    `XQuartz project <http://xquartz.macosforge.org>`_.
207
+
208
+2. After the installation, open a terminal and execute ::
209
+
210
+       echo http://downloads.kwant-project.org/macports/ports.tar |\
211
+       sudo tee -a /opt/local/etc/macports/sources.conf >/dev/null
212
+
213
+   (this adds the Kwant MacPorts download link
214
+   `<http://downloads.kwant-project.org/macports/ports.tar>`_ at the end of the
215
+   ``sources.conf`` file.)
216
+
217
+3. Execute ::
218
+
219
+       sudo port selfupdate
220
+
221
+4. Now, install Kwant and its prerequisites ::
222
+
223
+       sudo port install py27-kwant
224
+
225
+5. Finally, we choose python 2.7 to be the default python ::
226
+
227
+       sudo port select --set python python27
228
+
229
+   After that, you will need to close and reopen the terminal to
230
+   have all changes in effect.
231
+
232
+Notes:
233
+
234
+* If you have problems with macports because your institution's firewall
235
+  blocks macports (more precisely, the `rsync` port), resulting in
236
+  errors from ``sudo port selfupdate``, follow
237
+  `these instructions <https://trac.macports.org/wiki/howto/PortTreeTarball>`_.
238
+* Of course, if you already have macports installed, you can skip step 1
239
+  and continue with step 2.
240
+
241
+
242
+***********************************
243
+Building and installing from source
244
+***********************************
245
+
246
+Prerequisites
247
+=============
248
+
249
+Building Kwant requires
250
+ * `Python <http://python.org>`_ 2.6 or 2.7 (Python 3 is not supported yet),
251
+ * `SciPy <http://scipy.org>`_ 0.9 or newer,
252
+ * `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
253
+   (For best performance we recommend the free `OpenBLAS
254
+   <http://xianyi.github.com/OpenBLAS/>`_ or the nonfree `MKL
255
+   <http://software.intel.com/en-us/intel-mkl>`_.)
256
+ * `Tinyarray <http://kwant-project.org/tinyarray/>`_, a NumPy-like Python
257
+   package optimized for very small arrays,
258
+ * An environment which allows to compile Python extensions written in C and
259
+   C++.
260
+
261
+The following software is highly recommended though not strictly required:
262
+ * `matplotlib <http://matplotlib.sourceforge.net/>`_ 1.1 or newer, for Kwant's
263
+   plotting module and the tutorial,
264
+ * `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
265
+   that will in many cases speed up Kwant several times and reduce the memory
266
+   footprint.  (Kwant uses only the sequential, single core version
267
+   of MUMPS.  The advantages due to MUMPS as used by Kwant are thus independent
268
+   of the number of CPU cores of the machine on which Kwant runs.)
269
+ * The `nose <http://nose.readthedocs.org/>`_ testing framework for running the
270
+   tests included with Kwant.
271
+
272
+In addition, to build a copy of Kwant that has been checked-out directly from
273
+`its Git repository <http://git.kwant-project.org/kwant>`_, you will also need
274
+`Cython <http://cython.org/>`_ 0.17.1 or newer.  You do not need Cython to build
275
+Kwant that has been unpacked from a source .tar.gz-file.
276
+
277
+
278
+Generic instructions
279
+====================
280
+
281
+Kwant can be built and installed following the `usual Python conventions
282
+<http://docs.python.org/install/index.html>`_ by running the following commands
283
+in the root directory of the Kwant distribution. ::
284
+
285
+    python setup.py build
286
+    python setup.py install
287
+
288
+Depending on your system, you might have to run the second command with
289
+administrator privileges (e.g. prefixing it with ``sudo``).
290
+
291
+After installation, tests can be run with::
292
+
293
+    python -c 'import kwant; kwant.test()'
294
+
295
+The tutorial examples can be found in the directory ``tutorial`` inside the root
296
+directory of the Kwant source distribution.
297
+
298
+
299
+Unix-like systems (GNU/Linux)
300
+=============================
301
+
302
+Kwant should run on all recent Unix-like systems.  The following instructions
303
+have been verified to work on Debian 7 (Wheezy) or newer, and on Ubuntu 12.04 or
304
+newer.  For other distributions step 1 will likely have to be adapted.  If
305
+Ubuntu-style ``sudo`` is not available, the respective command must be run as
306
+root.
307
+
308
+1. Install the required packages.  On Debian-based systems like Ubuntu this can
309
+   be done by running the command ::
310
+
311
+       sudo apt-get install python-dev python-scipy python-matplotlib python-nose g++ gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
312
+
313
+2. Unpack Tinyarray, enter its directory. To build and install, run ::
314
+
315
+       python setup.py build
316
+       sudo python setup.py install
317
+
318
+3. Inside the Kwant source distribution's root directory run ::
319
+
320
+       python setup.py build
321
+       sudo python setup.py install
322
+
323
+By default the package will be installed under ``/usr/local``.  You can
324
+change this using the ``--prefix`` option, e.g.::
325
+
326
+    sudo python setup.py install --prefix=/opt
327
+
328
+If you would like to install Kwant into your home directory only you can use ::
329
+
330
+    python setup.py install --home=~
331
+
332
+This does not require root privileges.  If you install Kwant in this way
333
+be sure to tell python where to find it.  This can be done by setting the
334
+``PYTHONPATH`` environment variable::
335
+
336
+    export PYTHONPATH=$HOME/lib/python
337
+
338
+You can make this setting permanent by adding this line to the file
339
+``.bashrc`` (or equivalent) in your home directory.
340
+
341
+
342
+Mac OS X: MacPorts
343
+==================
344
+
345
+The required dependencies of Kwant are best installed with one of the packaging
346
+systems. Here we only consider the case of `MacPorts
347
+<http://www.macports.org>`_ in detail. Some remarks for homebrew are given
348
+below.
349
+
350
+1. In order to set up MacPorts or homebrew, follow steps 1 - 3 of
351
+   the respective instructions of `MacPorts`_
352
+
353
+2. Install the required dependencies::
354
+
355
+       sudo port install gcc47 python27 py27-numpy py27-scipy py27-matplotlib mumps_seq
356
+       sudo port select --set python python27
357
+
358
+3. Unpack Tinyarray, enter its directory, build and install::
359
+
360
+       python setup.py build
361
+       sudo python setup.py install
362
+
363
+5. Unpack Kwant, go to the Kwant directory, and edit ``build.conf`` to read::
364
+
365
+       [lapack]
366
+       extra_link_args = -Wl,-framework -Wl,Accelerate
367
+       [mumps]
368
+       include_dirs = /opt/local/include
369
+       library_dirs = /opt/local/lib
370
+       libraries = zmumps_seq mumps_common_seq pord_seq esmumps scotch scotcherr mpiseq gfortran
371
+
372
+6. Then, build and install Kwant. ::
373
+
374
+       CC=gcc-mp-4.7 LDSHARED='gcc-mp-4.7 -shared -undefined dynamic_lookup' python setup.py build
375
+       sudo python setup.py install
376
+
377
+You might note that installing Kwant on Mac OS X is somewhat more involved than
378
+installing on Linux. Part of the reason is that we need to mix Fortran and C
379
+code in Kwant: While C code is usually compiled using Apple compilers,
380
+Fortran code must be compiled with the Gnu Fortran compiler (there is
381
+no Apple Fortran compiler). For this reason we force the Gnu compiler suite
382
+with the environment variables ``CC`` and ``LDSHARED`` as shown above.
383
+
384
+
385
+Mac OS X: homebrew
386
+==================
387
+
388
+It is also possible to build Kwant using homebrew. The dependencies can be
389
+installed as ::
390
+
391
+    brew install gcc python
392
+    brew tap homebrew/science
393
+    brew tap homebrew/python
394
+    brew tap michaelwimmer/kwant
395
+    pip install nose six
396
+    brew install numpy scipy matplotlib
397
+
398
+Note that during the installation you will be told which paths to add when you
399
+want to compile/link against scotch/metis/mumps; you need to add these to the
400
+build.conf file. Also, when linking against mumps, one needs also to link
401
+against metis (in addition to the libraries needed for MacPorts).
402
+
403
+
404
+Windows
405
+=======
406
+
407
+Our efforts to compile Kwant on Windows using only free software (MinGW) were
408
+only moderately successful.  At the end of a very complicated process we
409
+obtained packages that worked, albeit unreliably.  As the only recommended way
410
+to compile Python extensions on Windows is using Visual C++, it may well be that
411
+there exists no easy solution.
412
+
413
+It is possible to compile Kwant on Windows using non-free compilers, however we
414
+(the authors of Kwant) have no experience with this.  The existing Windows
415
+binary installers of Kwant and Tinyarray were kindly prepared by Christoph
416
+Gohlke.
417
+
418
+
419
+Build configuration
420
+===================
421
+
422
+The setup script of Kwant has to know how to link against LAPACK & BLAS, and,
423
+optionally, MUMPS.  Be default it will assume that LAPACK and BLAS can be found
424
+under their usual names.  MUMPS will be not linked against by default, except
425
+on Debian-based systems when the package ``libmumps-scotch-dev`` is installed.
426
+
427
+All these settings can be configured by creating/editing the file
428
+``build.conf`` in the root directory of the Kwant distribution.  This
429
+configuration file consists of sections, one for each dependency, led by a
430
+[dependency-name] header and followed by name = value entries.  Possible names
431
+are keyword arguments for ``distutils.core.Extension`` (For a complete list,
432
+see its `documentation
433
+<http://docs.python.org/2/distutils/apiref.html#distutils.core.Extension>`_).
434
+The corresponding values are whitespace-separated lists of strings.
435
+
436
+The two currently possible sections are [lapack] and [mumps].  The former
437
+configures the linking against LAPACK _AND_ BLAS, the latter against MUMPS
438
+(without LAPACK and BLAS).
439
+
440
+Example ``build.conf`` for linking Kwant against a self-compiled MUMPS, `SCOTCH
441
+<http://www.labri.fr/perso/pelegrin/scotch/>`_ and `METIS
442
+<http://glaros.dtc.umn.edu/gkhome/metis/metis/overview>`_::
443
+
444
+    [mumps]
445
+    libraries = zmumps mumps_common pord metis esmumps scotch scotcherr mpiseq
446
+        gfortran
447
+
448
+Example ``build.conf`` for linking Kwant with Intel MKL.::
449
+
450
+    [lapack]
451
+    libraries = mkl_intel_lp64 mkl_sequential mkl_core mkl_def
452
+    library_dirs = /opt/intel/mkl/lib/intel64
453
+    extra_link_args = -Wl,-rpath=/opt/intel/mkl/lib/intel64
454
+
455
+The detailed syntax of ``build.conf`` is explained in the `documentation of
456
+Python's configparser module
457
+<http://docs.python.org/3/library/configparser.html#supported-ini-file-structure>`_.
458
+
459
+
460
+Building the documentation
461
+==========================
462
+
463
+To build the documentation, the `Sphinx documentation generator
464
+<http://sphinx.pocoo.org/>`_ is required.  If PDF documentation is to be built,
465
+the tools from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu
466
+package ``librsvg2-bin``) are needed to convert SVG drawings into the PDF
467
+format.
468
+
469
+As a prerequisite for building the documentation, Kwant must have been built
470
+successfully using ``./setup.py build`` as described above (or Kwant must be
471
+already installed in Python's search path).  HTML documentation is built by
472
+entering the ``doc`` subdirectory of the Kwant package and executing ``make
473
+html``.  PDF documentation is generated by executing ``make latex`` followed by
474
+``make all-pdf`` in ``doc/build/latex``.
475
+
476
+Because of some quirks of how Sphinx works, it might be necessary to execute
477
+``make clean`` between building HTML and PDF documentation.  If this is not
478
+done, Sphinx may mistakenly use PNG files for PDF output or other problems may
479
+appear.