File: Compiling-Octave-with-64_002dbit-Indexing.html

package info (click to toggle)
octave 3.8.2-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 84,396 kB
  • ctags: 45,547
  • sloc: cpp: 293,356; ansic: 42,041; fortran: 23,669; sh: 13,629; objc: 7,890; yacc: 7,093; lex: 3,442; java: 2,125; makefile: 1,589; perl: 1,009; awk: 974; xml: 34
file content (247 lines) | stat: -rw-r--r-- 9,929 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Octave: Compiling Octave with 64-bit Indexing</title>

<meta name="description" content="GNU Octave: Compiling Octave with 64-bit Indexing">
<meta name="keywords" content="GNU Octave: Compiling Octave with 64-bit Indexing">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Installation.html#Installation" rel="up" title="Installation">
<link href="Installation-Problems.html#Installation-Problems" rel="next" title="Installation Problems">
<link href="Running-Configure-and-Make.html#Running-Configure-and-Make" rel="prev" title="Running Configure and Make">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Compiling-Octave-with-64_002dbit-Indexing"></a>
<div class="header">
<p>
Next: <a href="Installation-Problems.html#Installation-Problems" accesskey="n" rel="next">Installation Problems</a>, Previous: <a href="Running-Configure-and-Make.html#Running-Configure-and-Make" accesskey="p" rel="prev">Running Configure and Make</a>, Up: <a href="Installation.html#Installation" accesskey="u" rel="up">Installation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Compiling-Octave-with-64_002dbit-Indexing-1"></a>
<h3 class="section">G.3 Compiling Octave with 64-bit Indexing</h3>

<p>Note: the following only applies to systems that have 64-bit pointers.
Configuring Octave with <samp>--enable-64</samp> cannot magically make a
32-bit system have a 64-bit address space.
</p>
<p>On 64-bit systems, Octave is limited to (approximately) the following
array sizes when using the default 32-bit indexing mode:
</p>
<div class="example">
<pre class="example">double:         16GB
single:          8GB 
uint64, int64:  16GB
uint32, int32:   8GB
uint16, int16:   4GB
uint8, int8:     2GB
</pre></div>

<p>In each case, the limit is really (approximately) <em>2^{31}</em> elements
because of the default type of the value used for indexing arrays
(signed 32-bit integer, corresponding to the size of a Fortran INTEGER
value).
</p>
<p>Trying to create larger arrays will produce the following error:
</p>
<div class="example">
<pre class="example">octave:1&gt; a = zeros (1024*1024*1024*3, 1, 'int8');
error: memory exhausted or requested size too large
       for range of Octave's index type --
       trying to return to prompt
</pre></div>

<p>You will obtain this error even if your system has enough memory to
create this array (4 GB in the above case).
</p>
<p>To use arrays larger than 2 GB, Octave has to be configured with the
option <samp>--enable-64</samp>.  This option is experimental and you are
encouraged to submit bug reports if you find a problem.  With this
option, Octave will use 64-bit integers internally for array dimensions
and indexing.  However, all numerical libraries used by Octave will
<strong>also</strong> need to use 64-bit integers for array dimensions and
indexing.  In most cases, this means they will need to be compiled from
source since most (all?) distributions which package these libraries
compile them with the default Fortran integer size, which is normally
32-bits wide.
</p>
<p>The following instructions were tested with the development version of
Octave and GCC 4.3.4 on an x86_64 Debian system.
</p>
<p>The versions listed below are the versions used for testing.  If newer
versions of these packages are available, you should try to use them,
although there may be some differences.
</p>
<p>All libraries and header files will be installed in subdirectories of
<code>$prefix64</code> (you must choose the location of this directory).
</p>
<ul>
<li> <small>BLAS</small> and <small>LAPACK</small> (<a href="http://www.netlib.org/lapack">http://www.netlib.org/lapack</a>)

<p>Reference versions for both libraries are included in the reference
<small>LAPACK</small> 3.2.1 distribution from <a href="netlib.org">netlib.org</a>.
</p>
<ul class="no-bullet">
<li>- Copy the file <samp>make.inc.example</samp> and name it <samp>make.inc</samp>.
The options <samp>-fdefault-integer-8</samp> and <samp>-fPIC</samp> (on 64-bit
CPU) have to be added to the variable <code>OPTS</code> and <code>NOOPT</code>.

</li><li>- Once you have compiled this library make sure that you use it for
compiling Suite Sparse and Octave.  In the following we assume that
you installed the <small>LAPACK</small> library as $prefix64/lib/liblapack.a.
</li></ul>

</li><li> QRUPDATE (<a href="http://sourceforge.net/projects/qrupdate">http://sourceforge.net/projects/qrupdate</a>)

<p>In the <samp>Makeconf</samp> file:
</p>
<ul class="no-bullet">
<li>- Add <samp>-fdefault-integer-8</samp> to <code>FFLAGS</code>.

</li><li>- Adjust the <small>BLAS</small> and <small>LAPACK</small> variables as needed if your 64-bit
aware <small>BLAS</small> and <small>LAPACK</small> libraries are in a non-standard
location.

</li><li>- Set <code>PREFIX</code> to the top-level directory of your install tree.

</li><li>- Run <code>make solib</code> to make a shared library.

</li><li>- Run <code>make install</code> to install the library.
</li></ul>

</li><li> SuiteSparse (<a href="http://www.cise.ufl.edu/research/sparse/SuiteSparse">http://www.cise.ufl.edu/research/sparse/SuiteSparse</a>)

<p>Pass the following options to <code>make</code> to enable 64-bit integers
for <small>BLAS</small> library calls.  On 64-bit Windows systems, use
<code>-DLONGBLAS=&quot;long long&quot;</code> instead.
</p>
<div class="example">
<pre class="example">CFLAGS='-DLONGBLAS=long'
CXXFLAGS='-DLONGBLAS=long'
</pre></div>

<p>The SuiteSparse makefiles don&rsquo;t generate shared libraries.  On some
systems, you can generate them by doing something as simple as
</p>
<div class="example">
<pre class="example">top=$(pwd)
for f in *.a; do
  mkdir tmp
  cd tmp
  ar vx ../$f
  gcc -shared -o ../${f%%.a}.so *.o
  cd $top
  rm -rf tmp
done
</pre></div>

<p>Other systems may require a different solution.
</p>
</li><li> ATLAS instead of reference <small>BLAS</small> and <small>LAPACK</small>

<p>Suggestions on how to compile ATLAS would be most welcome.
</p>
</li><li> <small>GLPK</small>
</li><li> Qhull (<a href="http://www.qhull.org">http://www.qhull.org</a>)

<p>Both <small>GLPK</small> and Qhull use <code>int</code> internally so maximum problem
sizes may be limited.
</p>
</li><li> Octave

<p>Octave&rsquo;s 64-bit index support is activated with the configure option
<samp>--enable-64</samp>.
</p>
<div class="example">
<pre class="example">./configure \
  LD_LIBRARY_PATH=&quot;$prefix64/lib&quot; \
  CPPFLAGS=&quot;-I$prefix64/include&quot; LDFLAGS=&quot;-L$prefix64/lib&quot; \
  --enable-64
</pre></div>

<p>You must ensure that all Fortran sources except those in the
<samp>liboctave/cruft/ranlib</samp> directory are compiled such that INTEGERS are
8-bytes wide.  If you are using gfortran, the configure script should
automatically set the Makefile variable <code><span class="nolinebreak">F77_INTEGER_8_FLAG</span></code><!-- /@w --> to 
<samp>-fdefault-integer-8</samp>.  If you are using another compiler, you
must set this variable yourself.  You should NOT set this flag in
<code>FFLAGS</code>, otherwise the files in <samp>liboctave/cruft/ranlib</samp> will be
miscompiled.
</p>
</li><li> Other dependencies

<p>Probably nothing special needs to be done for the following
dependencies.  If you discover that something does need to be done,
please submit a bug report.
</p>
<ul class="no-bullet">
<li>- pcre

</li><li>- zlib

</li><li>- hdf5

</li><li>- fftw3

</li><li>- cURL

</li><li>- GraphicsMagick++

</li><li>- OpenGL

</li><li>- freetype

</li><li>- fontconfig

</li><li>- fltk
</li></ul>

</li></ul>

<hr>
<div class="header">
<p>
Next: <a href="Installation-Problems.html#Installation-Problems" accesskey="n" rel="next">Installation Problems</a>, Previous: <a href="Running-Configure-and-Make.html#Running-Configure-and-Make" accesskey="p" rel="prev">Running Configure and Make</a>, Up: <a href="Installation.html#Installation" accesskey="u" rel="up">Installation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>