octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #46134] error: out of memory or dimension too


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #46134] error: out of memory or dimension too large for Octave's index type
Date: Tue, 06 Oct 2015 11:24:13 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36

Update of bug #46134 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #1:

I also struggle with 64-bit builds. The problem seems to be that your
underlying BLAS wasn't compiled with the same flags as you did with Octave.

The configure error refers to the test m4/ax_blas_f77_func.m4 there the
Fortran program, I call it "test.f" here:


      program main

      integer n,nn(3)
      real s,a(1),b(1),sdot
      a(1) = 1.0
      b(1) = 1.0
c Generate -2**33 + 1, if possible
      n = 2
      n = -4 * (n ** 30)
      print *, "n = ", n
      n = n + 1
      print *, "n = ", n
      if (n >= 0) goto 1
c This means we're on 64-bit integers. Check whether the BLAS is, too.
      s = sdot(n,a,1,b,1)
      print *, "s = ", s
      if (s .ne. 0.0) stop 1
    1 continue
c We may be on 32-bit integers, and the BLAS on 64 bits. This is almost bound
c to have already failed, but just in case, we'll check.
      nn(1) = -1
      nn(2) = 1
      nn(3) = -1
      s = sdot(nn(2),a,1,b,1)
      if (s .ne. 1.0) stop 1

      end


gets executed. The intention of the code is the following:

- You create n = -2^32+1 (the documentation is wrong!), too big for int32 and
get an integer overflow to a positive value. On a int64 platform you get n =
-2^32+1.

- Then the idea, I guess, is the LAPACK-Routine sdot (
http://www.netlib.org/lapack/explore-html/d0/d16/sdot_8f_source.html ) should
return 0.0 if the input value is smaller than 0, means int64 was handed over
correctly, no integer overflows occurred and so on...

Thus, compiling "test.f" and linking my 32-bit BLAS from my Linux distributor
yields:


$ gfortran -fdefault-integer-8 bla.f -o test -lblas && ./test 
 n =           -4294967296
 n =           -4294967295
 s =    1.00000000    
STOP 1

$ gfortran test.f -o test -lblas && ./test 
 n =            0
 n =            1


Maybe try out the Fortran program. If you know a solution, let me know.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46134>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]