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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://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 6.2.0))</title>
<meta name="description" content="Compiling Octave with 64-bit Indexing (GNU Octave (version 6.2.0))">
<meta name="keywords" content="Compiling Octave with 64-bit Indexing (GNU Octave (version 6.2.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<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.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {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}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<span id="Compiling-Octave-with-64_002dbit-Indexing"></span><div class="header">
<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">Installation</a> [<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>
<span id="Compiling-Octave-with-64_002dbit-Indexing-1"></span><h3 class="section">E.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 uses 64-bit integers for indexing arrays
by default. If the configure script determines that your <small>BLAS</small>
library uses 32-bit integers, then operations using the following
libraries are limited to arrays with dimensions that are smaller than
<em>2^{31}</em> elements:
</p>
<ul>
<li> <small>BLAS</small>
</li><li> <small>LAPACK</small>
</li><li> QRUPDATE
</li><li> SuiteSparse
</li><li> <small>ARPACK</small>
</li></ul>
<p>Additionally, the following libraries use <code>int</code> internally, so
maximum problem sizes are always limited:
</p>
<ul>
<li> <small>GLPK</small>
</li><li> Qhull
</li></ul>
<p>Except for <small>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>BLAS</small> library used by Octave, the
following code can be executed:
</p>
<div class="example">
<pre class="example">clear all;
N = 2^31;
## The following line requires about 8 GB of RAM!
a = b = ones (N, 1, "single");
c = a' * b
</pre></div>
<p>If the <small>BLAS</small> library uses 32-bit integers, an error will be thrown:
</p>
<div class="example">
<pre class="example">error: integer dimension or index out of range for Fortran
INTEGER type
</pre></div>
<p>Otherwise, if the <small>BLAS</small> library uses 64-bit integers, the result is:
</p>
<div class="example">
<pre class="example">c = 2^31 = 2147483648
</pre></div>
<p>Note that the test case above usually requires twice the memory, if
<var>a</var> and <var>b</var> are not assigned by <code>a = b = …</code>.
Note further, that the data type <code>single</code> has a precision of
about 23 binary bits. In this particular example no rounding errors
occur.
</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>$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="http://www.netlib.org/">http://www.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="https://sourceforge.net/projects/qrupdate">https://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://faculty.cse.tamu.edu/davis/suitesparse.html">http://faculty.cse.tamu.edu/davis/suitesparse.html</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="long long"</code> instead.
</p>
<div class="example">
<pre class="example">CFLAGS='-DLONGBLAS=long'
CXXFLAGS='-DLONGBLAS=long'
</pre></div>
<p>The SuiteSparse makefiles don’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> <small>ARPACK</small> (<a href="https://forge.scilab.org/index.php/p/arpack-ng/">https://forge.scilab.org/index.php/p/arpack-ng/</a>)
<ul class="no-bullet">
<li>- Add <samp>-fdefault-integer-8</samp> to <code>FFLAGS</code> when running configure.
</li><li>- Run <code>make</code> to build the library.
</li><li>- Run <code>make install</code> to install the library.
</li></ul>
</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’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="$prefix64/lib" \
CPPFLAGS="-I$prefix64/include" LDFLAGS="-L$prefix64/lib" \
--enable-64
</pre></div>
<p>You must ensure that all Fortran sources except those in the
<samp>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><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/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="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" 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">Installation</a> [<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>
|