Take the 2-minute tour ×

I'm wondering if anyone has a 64-bit build of Octave? If so, do you know if it has full access to the 64 bit memory range -- i.e., can you create a matrix which uses up more than 4GB of memory?

share|improve this question
add comment

5 Answers

I realize the question is old but it's still quite relevant. On a Mac yes, I used homebrew and include an example of a matrix over 4GB below. Currently this procedure works:

Install homebrew and then run the following in a terminal window.

brew install hg
brew install --use-gcc --HEAD graphicsmagick
brew install gfortran
brew install --use-gcc gnuplot
brew install octave

Then add this to ~/.octaverc:

setenv GNUTERM 'x11'

Enjoy your 64-bit octave compile!

octave:1> a = zeros(500*2^10+1,2^10);
octave:2> whos
Variables in the current scope:

  Attr Name        Size                     Bytes  Class
        a      512001x1024              4194312192  double
        ans         1x50                       498  cell

Total is 524289074 elements using 4194312690 bytes
share|improve this answer
@Somealias is correct, the pointers are still 32-bit. It should be possible to work around some issues by emulating 8-bit int or uint arrays with larger ints and then masking. Since this is hardly ideal I'm following this up on the homebrew github page. –  thirdhaf Apr 18 '12 at 7:24
add comment

I don't know if that helps you but according to this: http://wiki.octave.org/wiki.pl?EnableLargeArrays, support over 2 GB of memory for array is experimental.

share|improve this answer
add comment

I installed a 64-bit version of Octave (octave-devel) using MacPorts. Installation instructions are available at http://shifteleven.com/articles/2011/11/06/installing-octave-on-osx-with-macports.

However, it appears that the octave-devel package still uses Octave's 32-bit default indexing so I can't load arrays of 'int8' greater than 2GB. (ref: http://www.gnu.org/software/octave/doc/interpreter/Compiling-Octave-with-64_002dbit-Indexing.html).

This may be caused by the octave-devel package not compiling 64-bit versions of the linear algebra packages that Octave depends on.

% Load a 3GB int8 vector (32-bit limits to 2GB)
octave:1> a = zeros(1024^3*3, 1, ‘int8′);
error: memory exhausted or requested size too large for range of Octave’s index type — trying to return to prompt

64bit everywhere's answer does not show a valid test because the default Octave's 32-bit indexing allows the creation of 'double' arrays up to 16GB.

share|improve this answer
add comment

There are two things that are relevant:

  • 64 bit pointers, allowing larger memory structures than 2 or 4GB

  • 64 bit integers for indexing arrays with more than 2^32 elements

For the first, compiling on a 64bit system should do. For the second, you need --enable64 in compiling octave, but more importantly, you need to link with 64bit integer indexing BLAS libraries. This is the hard part.

Back in 2008, I managed to compile a version of octave this way, using AMD blas libraries (the 64bit integer fortran version). However, since then, I have not been able to reproduce this, because the library updated and was not compatible with the Linux system we use (Ubunto 12.04). Compiling Octave and linking with a third party BLAS was simply too hard.

I work on 128 GB memory computers, but my octave scripts can still only tackle small problems. 2GB should be enough for anyone...

share|improve this answer
add comment

The Matlab/Octave package Psychtoolbox has a 64-bit MacOS version with 64-bit .mex files. As far as I know, any use of the .mex files will fail in 32-bit Octave, with messages like:

error: KbQueueReserve: /Applications/Psychtoolbox/PsychBasic/Octave3OSXFiles64/PsychHID.mex: failed to load: dlopen(/Applications/Psychtoolbox/PsychBasic/Octave3OSXFiles64/PsychHID.mex, 2): no suitable image found.  Did find: 
/Applications/Psychtoolbox/PsychBasic/Octave3OSXFiles64/PsychHID.mex: mach-o, but wrong architecture

Is there a version of Octave that can use 64-bit .mex files?

  • PsychHID.mex architecture is: x86_64
  • Octave 3.4.0 architectures are: i386 ppc
  • My system is: MacBook Pro 5,1 running MacOS 10.6.8

It is possible that this is a Psychtoolbox problem, since I see 3 architectures for Linux files (Octave3LinuxFiles,Octave3LinuxFiles64,Octave3LinuxFilesARM) in /Applications/Psychtoolbox/PsychBasic, but only one for MacOS (Octave3OSXFiles64).

share|improve this answer
add comment

Your Answer


