Enable large arrays: Build octave such that it can use arrays larger than 2Gb.: Difference between revisions

m (Improve text and example.)
Line 37: Line 37:


===Versions prior to Octave 4.4===
===Versions prior to Octave 4.4===
On previous versions of Octave, the default is that the size of a single Octave array cannot exceed 2 GB of memory. Trying to create one will produce the following error:
On previous versions of Octave, the default is that the size of a single Octave array cannot have more than approximately 2^31 elements, even on systems that use 64-bit pointers. This is because array indices were limited to 32-bit signed integers by default.  Trying to create one will produce the following error:


<pre>
<pre>
Line 44: Line 44:
</pre>
</pre>


You will obtain this error even if your system has enough RAM to create this array (4 GB in the above case).
You will obtain this error even if your system has enough RAM to create this array (3 GB in the above case).


To use arrays with more than (approximately) <math>2^{31}</math> elements, Octave has to be configured with the option <code>--enable-64</code>. This option is experimental and you are (as always) encouraged to submit bug reports if you find a problem.  
To use arrays with more than (approximately) <math>2^{31}</math> elements, Octave has to be configured with the option <code>--enable-64</code>. This option is experimental and you are (as always) encouraged to submit bug reports if you find a problem.