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

package info (click to toggle)
octave 10.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 145,388 kB
  • sloc: cpp: 335,976; ansic: 82,241; fortran: 20,963; objc: 9,402; sh: 8,756; yacc: 4,392; lex: 4,333; perl: 1,544; java: 1,366; awk: 1,259; makefile: 660; xml: 192
file content (280 lines) | stat: -rw-r--r-- 11,502 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Compiling Octave with 64-bit Indexing (GNU Octave (version 10.3.0))</title>

<meta name="description" content="Compiling Octave with 64-bit Indexing (GNU Octave (version 10.3.0))">
<meta name="keywords" content="Compiling Octave with 64-bit Indexing (GNU Octave (version 10.3.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Installation.html" rel="up" title="Installation">
<link href="Installation-Problems.html" rel="next" title="Installation Problems">
<link href="Running-Configure-and-Make.html" rel="prev" title="Running Configure and Make">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
ul.mark-bullet {list-style-type: disc}
ul.mark-minus {list-style-type: "\2212"}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<div class="section-level-extent" id="Compiling-Octave-with-64_002dbit-Indexing">
<div class="nav-panel">
<p>
Next: <a href="Installation-Problems.html" accesskey="n" rel="next">Installation Problems</a>, Previous: <a href="Running-Configure-and-Make.html" accesskey="p" rel="prev">Running Configure and Make</a>, Up: <a href="Installation.html" accesskey="u" rel="up">Installing Octave</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="Compiling-Octave-with-64_002dbit-Indexing-1"><span>E.3 Compiling Octave with 64-bit Indexing<a class="copiable-link" href="#Compiling-Octave-with-64_002dbit-Indexing-1"> &para;</a></span></h3>

<p>Note: the following only applies to systems that have 64-bit pointers.
Configuring Octave with <samp class="option">--enable-64</samp> cannot magically make a
32-bit system have a 64-bit address space.
</p>
<p>On 64-bit systems, Octave uses 64-bit integers for indexing arrays
by default.  If the configure script determines that your <small class="sc">BLAS</small>
library uses 32-bit integers, then operations using the following
libraries are limited to arrays with dimensions that are smaller than
<em class="math">2^{31}</em> elements:
</p>
<ul class="itemize mark-bullet">
<li><small class="sc">BLAS</small>

</li><li><small class="sc">LAPACK</small>

</li><li>QRUPDATE

</li><li>SuiteSparse

</li><li><small class="sc">SUNDIALS IDA</small>

</li><li><small class="sc">ARPACK</small>
</li></ul>

<p>Additionally, the following libraries use <code class="code">int</code> internally, so
maximum problem sizes are always limited:
</p>
<ul class="itemize mark-bullet">
<li><small class="sc">GLPK</small>

</li><li>Qhull
</li></ul>

<p>Except for <small class="sc">GLPK</small> and Qhull, these libraries may also be configured
to use 64-bit integers, but most systems do not provide packages built
this way.  If you wish to experiment with large arrays, the following
information may be helpful.
</p>
<p>To determine the integer size of the <small class="sc">BLAS</small> library used by Octave, the
following code can be executed:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">clear all;
N = 2^31;
## The following line requires about 8 GB of RAM!
a = b = ones (N, 1, &quot;single&quot;);
c = a' * b
</pre></div></div>

<p>If the <small class="sc">BLAS</small> library uses 32-bit integers, an error will be thrown:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">error: integer dimension or index out of range for Fortran
INTEGER type
</pre></div></div>

<p>Otherwise, if the <small class="sc">BLAS</small> library uses 64-bit integers, the result is:
</p>
<div class="example">
<pre class="example-preformatted">c = 2^31 = 2147483648
</pre></div>

<p>Note that the test case above usually requires twice the memory, if
<var class="var">a</var> and <var class="var">b</var> are not assigned by <code class="code">a = b = &hellip;</code>.
Note further, that the data type <code class="code">single</code> has a precision of
about 23 binary bits.  In this particular example no rounding errors
occur.
</p>
<p>Generally, it is best to have all of these libraries in versions that
support 32-bit indexing, or all of these libraries must support 64-bit
indexing.  Mixing libraries with 64-bit indexing with libraries with
32-bit indexing can cause unpredictable behavior including program
crashes with possible loss of data.
</p>
<p>The following instructions were tested with the development version of
Octave and GCC 4.3.4 on an x86_64 Debian system and may be out of date
now.  Please report any problems or corrections on the Octave bug
tracker.
</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 class="code">$prefix64</code> (you must choose the location of this directory).
</p>
<ul class="itemize mark-bullet">
<li><small class="sc">BLAS</small> and <small class="sc">LAPACK</small> (<a class="url" href="http://www.netlib.org/lapack">http://www.netlib.org/lapack</a>)

<p>Reference versions for both libraries are included in the reference
<small class="sc">LAPACK</small> 3.2.1 distribution from <a class="url" href="http://www.netlib.org/">http://www.netlib.org/</a>.
</p>
<ul class="itemize mark-minus">
<li>Copy the file <samp class="file">make.inc.example</samp> and name it <samp class="file">make.inc</samp>.
The options <samp class="option">-fdefault-integer-8</samp> and <samp class="option">-fPIC</samp> (on 64-bit
CPU) have to be added to the variable <code class="code">OPTS</code> and <code class="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 class="sc">LAPACK</small> library as $prefix64/lib/liblapack.a.
</li></ul>

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

<p>In the <samp class="file">Makeconf</samp> file:
</p>
<ul class="itemize mark-minus">
<li>Add <samp class="option">-fdefault-integer-8</samp> to <code class="env">FFLAGS</code>.

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

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

</li><li>Run <code class="code">make solib</code> to make a shared library.

</li><li>Run <code class="code">make install</code> to install the library.
</li></ul>

</li><li>SuiteSparse (<a class="url" href="http://faculty.cse.tamu.edu/davis/suitesparse.html">http://faculty.cse.tamu.edu/davis/suitesparse.html</a>)

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

<p>Other systems may require a different solution.
</p>
</li><li><small class="sc">SUNDIALS IDA</small>
(<a class="url" href="https://computing.llnl.gov/projects/sundials/ida">https://computing.llnl.gov/projects/sundials/ida</a>)

<p>When configuring with <code class="code">cmake</code> add the flag
<samp class="option">-DSUNDIALS_INDEX_SIZE=64</samp>.
</p>
</li><li><small class="sc">ARPACK</small> (<a class="url" href="https://forge.scilab.org/index.php/p/arpack-ng/">https://forge.scilab.org/index.php/p/arpack-ng/</a>)

<ul class="itemize mark-minus">
<li>Add <samp class="option">-fdefault-integer-8</samp> to <code class="env">FFLAGS</code> when running configure.

</li><li>Run <code class="code">make</code> to build the library.

</li><li>Run <code class="code">make install</code> to install the library.
</li></ul>

</li><li>ATLAS instead of reference <small class="sc">BLAS</small> and <small class="sc">LAPACK</small>

<p>Suggestions on how to compile ATLAS would be most welcome.
</p>
</li><li><small class="sc">GLPK</small>

</li><li>Qhull (<a class="url" href="http://www.qhull.org">http://www.qhull.org</a>)

<p>Both <small class="sc">GLPK</small> and Qhull use <code class="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 class="option">--enable-64</samp>.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">./configure \
  LD_LIBRARY_PATH=&quot;$prefix64/lib&quot; \
  CPPFLAGS=&quot;-I$prefix64/include&quot; LDFLAGS=&quot;-L$prefix64/lib&quot; \
  --enable-64
</pre></div></div>

<p>You must ensure that all Fortran sources, except those in the
<samp class="file">liboctave/external/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 class="env">F77_INTEGER_8_FLAG</code><!-- /@w -->&nbsp;to
<samp class="option">-fdefault-integer-8</samp>.  If you are using another compiler, you
must set this variable yourself.  You should NOT set this flag in
<code class="env">FFLAGS</code>, otherwise the files in <samp class="file">liboctave/external/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="itemize mark-minus">
<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>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Installation-Problems.html">Installation Problems</a>, Previous: <a href="Running-Configure-and-Make.html">Running Configure and Make</a>, Up: <a href="Installation.html">Installing Octave</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>