<html lang="en"> <head> <title>Compiling Octave with 64-bit Indexing - GNU Octave</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="GNU Octave"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Installation.html#Installation" title="Installation"> <link rel="prev" href="Running-Configure-and-Make.html#Running-Configure-and-Make" title="Running Configure and Make"> <link rel="next" href="Installation-Problems.html#Installation-Problems" title="Installation Problems"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Compiling-Octave-with-64-bit-Indexing"></a> <a name="Compiling-Octave-with-64_002dbit-Indexing"></a> <p> Next: <a rel="next" accesskey="n" href="Installation-Problems.html#Installation-Problems">Installation Problems</a>, Previous: <a rel="previous" accesskey="p" href="Running-Configure-and-Make.html#Running-Configure-and-Make">Running Configure and Make</a>, Up: <a rel="up" accesskey="u" href="Installation.html#Installation">Installation</a> <hr> </div> <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><span class="option">--enable-64</span></samp> cannot magically make a 32-bit system have a 64-bit address space. <p>On 64-bit systems, Octave is limited to (approximately) the following array sizes when using the default 32-bit indexing mode: <pre class="example"> double: 16GB single: 8GB uint64, int64: 16GB uint32, int32: 8GB uint16, int16: 4GB uint8, int8: 2GB </pre> <p>In each case, the limit is really (approximately) 2^31 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>Trying to create larger arrays will produce the following error: <pre class="example"> octave:1> 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> <p class="noindent">You will obtain this error even if your system has enough memory to create this array (4 GB in the above case). <p>To use arrays larger than 2 GB, Octave has to be configured with the option <samp><span class="option">--enable-64</span></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>The following instructions were tested with the development version of Octave and GCC 4.3.4 on an x86_64 Debian system. <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>All libraries and header files will be installed in subdirectories of <code>$prefix64</code> (you must choose the location of this directory). <ul> <li><span class="sc">blas</span> and <span class="sc">lapack</span> (<a href="http://www.netlib.org/lapack">http://www.netlib.org/lapack</a>) <p>Reference versions for both libraries are included in the reference <span class="sc">lapack</span> 3.2.1 distribution from <a href="netlib.org">netlib.org</a>. <ul> <li>Copy the file <samp><span class="file">make.inc.example</span></samp> and name it <samp><span class="file">make.inc</span></samp>. The options <samp><span class="option">-fdefault-integer-8</span></samp> and <samp><span class="option">-fPIC</span></samp> (on 64-bit CPU) have to be added to the variable <code>OPTS</code> and <code>NOOPT</code>. <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 <span class="sc">lapack</span> library as $prefix64/lib/liblapack.a. </ul> <li>QRUPDATE (<a href="http://sourceforge.net/projects/qrupdate">http://sourceforge.net/projects/qrupdate</a>) <p>In the <samp><span class="file">Makeconf</span></samp> file: <ul> <li>Add <samp><span class="option">-fdefault-integer-8</span></samp> to <samp><span class="env">FFLAGS</span></samp>. <li>Adjust the <span class="sc">blas</span> and <span class="sc">lapack</span> variables as needed if your 64-bit aware <span class="sc">blas</span> and <span class="sc">lapack</span> libraries are in a non-standard location. <li>Set <samp><span class="env">PREFIX</span></samp> to the top-level directory of your install tree. <li>Run <code>make solib</code> to make a shared library. <li>Run <code>make install</code> to install the library. </ul> <li>SuiteSparse (<a href="http://www.cise.ufl.edu/research/sparse/SuiteSparse">http://www.cise.ufl.edu/research/sparse/SuiteSparse</a>) <ul> <li>In <samp><span class="file">UFconfig/UFconfig.mk</span></samp> use the following options for <samp><span class="env">CFLAGS</span></samp> and <samp><span class="env">F77FLAGS</span></samp>: <pre class="example"> CC = gcc CFLAGS = -fPIC -O -DLP64 -DLONGBLAS='long int' -DLONG='long int' F77 = gfortran F77FLAGS = -fPIC -O -fdefault-integer-8 BLAS = -L$BLAS/lib -lblas -lgfortran" LAPACK = -L$LAPACK/lib -llapack" </pre> <li>Disable the GPL-incompatible <code>METIS</code> library: <pre class="example"> CHOLMOD_CONFIG = -DNPARTITION SPQR_CONFIG = -DNPARTITION METIS_PATH = METIS = </pre> <li>Disable the <code>DI</code> versions of the <code>CHOLMOD</code> library files by setting <pre class="example"> OBJ = $(DL) </pre> <p class="noindent">in <samp><span class="file">CHOLMOD/Lib/Makefile</span></samp>. <li>Disable the <code>DI</code> versions of the <code>CHOLMOD</code> tests by commenting out or deleting the following lines in <samp><span class="file">CHOLMOD/Demo/Makefile</span></samp>: <pre class="example"> ./cholmod_demo < Matrix/bcsstk01.tri ./cholmod_demo < Matrix/lp_afiro.tri ./cholmod_demo < Matrix/can___24.mtx ./cholmod_demo < Matrix/c.tri ./cholmod_simple < Matrix/c.tri ./cholmod_simple < Matrix/can___24.mtx ./cholmod_simple < Matrix/bcsstk01.tri </pre> <li>Run <samp><span class="command">make</span></samp> to build the libraries. <li>The SuiteSparse <samp><span class="file">Makefile</span></samp> does not have an install target so you must install the files by hand: <pre class="example"> mkdir $prefix64/include/suitesparse cp UFconfig/UFconfig.h $prefix64/include/suitesparse for d in AMD BTF CAMD CCOLAMD \ CHOLMOD COLAMD CXSparse UMFPACK; do cp $d/Lib/lib*a $prefix64/lib cp $d/Include/*h $prefix64/include/suitesparse done </pre> <li>You can generate shared versions of these libraries by doing the following in the <samp><span class="file">$prefix64/lib</span></samp> directory: <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> </ul> <li>ATLAS instead of reference <span class="sc">blas</span> and <span class="sc">lapack</span> <p>Suggestions on how to compile ATLAS would be most welcome. <li><span class="sc">glpk</span> <p>Suggestions on how to compile <span class="sc">glpk</span> would be most welcome. <li>Qhull (<a href="http://www.qhull.org">http://www.qhull.org</a>) <p>Suggestions on how to compile Qhull would be most welcome. <li>Octave <p>Octave's 64-bit index support is activated with the configure option <samp><span class="option">--enable-64</span></samp>. <pre class="example"> ./configure \ LD_LIBRARY_PATH="$prefix64/lib" \ CPPFLAGS="-I$prefix64/include" LDFLAGS="-L$prefix64/lib" \ --enable-64 </pre> <p>You must ensure that all Fortran sources except those in the <samp><span class="file">libcruft/ranlib</span></samp> directory are compiled such that INTEGERS are 8-bytes wide. If you are using gfortan, the configure script should automatically set the Makefile variable <samp><span class="env">F77_INTEGER_8_FLAG</span></samp><!-- /@w --> to <samp><span class="option">-fdefault-integer-8</span></samp>. If you are using another compiler, you must set this variable yourself. You should NOT set this flag in <samp><span class="env">FFLAGS</span></samp>, otherwise the files in <samp><span class="file">libcruft/ranlib</span></samp> will be miscompiled. <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. <ul> <li>pcre <li>zlib <li>hdf5 <li>fftw3 <li>cURL <li>GraphicsMagick++ <li>OpenGL <li>freetype <li>fontconfig <li>fltk </ul> </ul> </body></html>