Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 140 lines (94 sloc) 4.731 kb
d409225 @cournape Start working on a INSTALL.txt document for building/installing numpy.
cournape authored
1 .. -*- rest -*-
2 .. vim:syntax=rest
3 .. NB! Keep this document a valid restructured document.
4
5 Building and installing NumPy
6 +++++++++++++++++++++++++++++
7
8 :Authors: Numpy Developers <numpy-discussion@scipy.org>
9 :Discussions to: numpy-discussion@scipy.org
10
11 .. Contents::
12
13 PREREQUISITES
14 =============
15
16 Building NumPy requires the following software installed:
17
18 1) Python__ 2.4.x or newer
19
20 On Debian and derivative (Ubuntu): python python-dev
21
22 On Windows: the official python installer on Python__ is enough
23
24 Make sure that the Python package distutils is installed before
25 continuing. For example, in Debian GNU/Linux, distutils is included
26 in the python-dev package.
27
28 Python must also be compiled with the zlib module enabled.
29
5aa65d9 TYP: Fix typo.
zed authored
30 2) nose__ (optional) 0.10.3 or later
7097f5a @cournape Mention nose for requirements.
cournape authored
31
32 This is required for testing numpy, but not for using it.
33
34 Python__ http://www.python.org
5aa65d9 TYP: Fix typo.
zed authored
35 nose__ http://somethingaboutorange.com/mrl/projects/nose/
5c08ef9 @cournape Mention which packages to install for atlas on Ubuntu (Pre intrepid and ...
cournape authored
36
5e62187 @cournape Add mention of g77 vs gfortran in INSTALL notes.
cournape authored
37 Fortran ABI mismatch
38 ====================
39
40 The two most popular open source fortran compilers are g77 and gfortran.
41 Unfortunately, they are not ABI compatible, which means that concretely you
42 should avoid mixing libraries built with one with another. In particular, if
43 your blas/lapack/atlas is built with g77, you *must* use g77 when building
44 numpy and scipy; on the contrary, if your atlas is built with gfortran, you
45 *must* build numpy/scipy with gfortran.
46
47 Choosing the fortran compiler
48 -----------------------------
49
50 To build with g77:
51
52 python setup.py build --fcompiler=gnu
53
54 To build with gfortran:
55
56 python setup.py build --fcompiler=gnu95
57
58 How to check the ABI of blas/lapack/atlas
59 -----------------------------------------
60
61 One relatively simple and reliable way to check for the compiler used to build
62 a library is to use ldd on the library. If libg2c.so is a dependency, this
63 means that g77 has been used. If libgfortran.so is a a dependency, gfortran has
64 been used. If both are dependencies, this means both have been used, which is
65 almost always a very bad idea.
66
5c08ef9 @cournape Mention which packages to install for atlas on Ubuntu (Pre intrepid and ...
cournape authored
67 Building with ATLAS support
68 ===========================
69
70 Ubuntu 8.10 (Intrepid)
71 ----------------------
72
73 You can install the necessary packages for optimized ATLAS with this command:
74
75 sudo apt-get install libatlas-base-dev
76
77 If you have a recent CPU with SIMD suppport (SSE, SSE2, etc...), you should
78 also install the corresponding package for optimal performances. For example,
79 for SSE2:
80
81 sudo apt-get install libatlas3gf-sse2
82
419cd5b @cournape Disable looking for 3gf libraries; it causes more problem than it solves...
cournape authored
83 *NOTE*: if you build your own atlas, Intrepid changed its default fortran
84 compiler to gfortran. So you should rebuild everything from scratch, including
85 lapack, to use it on Intrepid.
86
5c08ef9 @cournape Mention which packages to install for atlas on Ubuntu (Pre intrepid and ...
cournape authored
87 Ubuntu 8.04 and lower
88 ---------------------
89
90 You can install the necessary packages for optimized ATLAS with this command:
91
92 sudo apt-get install atlas3-base-dev
93
94 If you have a recent CPU with SIMD suppport (SSE, SSE2, etc...), you should
95 also install the corresponding package for optimal performances. For example,
96 for SSE2:
97
98 sudo apt-get install atlas3-sse2
f169313 @cournape Add notes on Windows for AMD64.
cournape authored
99
100 Windows 64 bits notes
101 =====================
102
103 Note: only AMD64 is supported (IA64 is not) - AMD64 is the version most people
104 want.
105
106 Free compilers (mingw-w64)
107 --------------------------
108
109 http://mingw-w64.sourceforge.net/
110
111 To use the free compilers (mingw-w64), you need to build your own toolchain, as
112 the mingw project only distribute cross-compilers (cross-compilation is not
113 supported by numpy). Since this toolchain is still being worked on, serious
114 compilers bugs can be expected. binutil 2.19 + gcc 4.3.3 + mingw-w64 runtime
115 gives you a working C compiler (but the C++ is broken). gcc 4.4 will hopefully
116 be able to run natively.
117
118 This is the only tested way to get a numpy with a FULL blas/lapack (scipy does
119 not work because of C++).
120
121 MS compilers
122 ------------
123
124 If you are familiar with MS tools, that's obviously the easiest path, and the
125 compilers are hopefully more mature (although in my experience, they are quite
126 fragile, and often segfault on invalid C code). The main drawback is that no
127 fortran compiler + MS compiler combination has been tested - mingw-w64 gfortran
128 + MS compiler does not work at all (it is unclear whether it ever will).
129
130 For python 2.5, you need VS 2005 (MS compiler version 14) targetting
131 AMD64 bits, or the Platform SDK v6.0 or below (which gives command
132 line versions of 64 bits target compilers). The PSDK is free.
133
134 For python 2.6, you need VS 2008. The freely available version does not
135 contains 64 bits compilers (you also need the PSDK, v6.1).
136
137 It is *crucial* to use the right version: python 2.5 -> version 14, python 2.6,
138 version 15. You can check the compiler version with cl.exe /?. Note also that
139 for python 2.5, 64 bits and 32 bits versions use a different compiler version.
Something went wrong with that request. Please try again.