bugGNU Octave - Bugs: bug #43003, polyfit error.... 64 bit problem?

 
 

bug #43003: polyfit error.... 64 bit problem?

Submitter:  Ceral Paquet <octavebugs>
Submitted:  Sat 16 Aug 2014 11:55:38 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Need Info Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 28 Aug 2014 09:16:10 PM UTC, comment #13: 

What do you mean "the mxe environment and the mxe-octave files"?

Precisely what did you download, how did you download it, and from where?

If you cloned http://hg.octave.org/mxe-octave then you need to cd to the resulting mxe-octave directory and type


autoconf
./configure
make


That will cross compile stable Octave for 32-bit Windows along with all the needed dependencies.

If you want the mxe-octave build environment to do something else, you're kind of on your own, but you might be able to get some help for specific questions on the help list.

John W. Eaton <jwe>
Group administrator
Thu 28 Aug 2014 08:52:57 PM UTC, comment #12: 

Please can you give a a pointer how to start with mxe.

I've downloaded the mxe environment and the mxe-octave files. I typed configure and make in the mxe-octave directory but they don't work.

~/mxe/mxe-octave-ed7c61a97068$ make
make: * No targets specified and no makefile found.  Stop.
~/mxe/mxe-octave-ed7c61a97068$ ./configure
bash: ./configure: No such file or directory
~/mxe/mxe-octave-ed7c61a97068$

If I back out to the mxe directory, then make works (not sure what it is doing tho) but configure doesn't.

~/mxe$ ./configure
bash: ./configure: No such file or directory
~/mxe$ make
[target]   i686-pc-mingw32 with 276 goals from src/*.mk
[build]    fftw
...

I just need to know how to start :)

Ceral Paquet <octavebugs>
Wed 20 Aug 2014 09:20:17 PM UTC, comment #11: 

Oh, I also used the following options for the mxe-octave configure script:


--enable-system-gcc --enable-64 --enable-lib64-directory --disable-jit --enable-native-build --enable-pic-flag --host=gnu-linux


You could also experiment with --enable-openblas.  It should be set up to work properly with 64-bit indexing.


John W. Eaton <jwe>
Group administrator
Wed 20 Aug 2014 09:16:37 PM UTC, comment #10: 

I checked in a few changes to the mxe-octave build system and I'm able to build stable Octave (3.8.2) with --enable-64 using the current mxe-octave (hg id: 2b4493282fc7) on a Debian system (relatively current testing release).

Running _run_test_suite_ produces the following results for me:


  PASS     11544
  FAIL         0
  XFAIL        7
  SKIPPED     53


Note that one of the changes was to disable Qhull because I was getting test failures for functions that use Qhull and I don't know how to properly compile that for 64-bit indexing.  If that's not possible, then I think we'll need to take another look at how we call those functions so that we correctly pass index integers to them.

I also use --disable-jit because the JIT compiler really doesn't do anything useful now.

It might be nice to modify the mxe-octave build system to allow it to build only those dependencies that need special treatment for 64-bit indexing.  Then it might be simpler to reliably build the necessary dependencies on systems which otherwise have everything already provided in packages.  It would be great if someone wants to work on that.

John W. Eaton <jwe>
Group administrator
Wed 20 Aug 2014 08:09:07 PM UTC, comment #9: 

Hi John - thanks for commenting! I probably don't "need" 64 bit but I used to run into out of memory errors on MATLAB 32-bit with 4Gb RAM. Weirdly enough, only with sparse matrices as you need the matrix and all the indices to be in memory at the same time. I sort of abandoned that project but may return to it with 64 bit.

I think enable-64 is now working on my computer. No prizes, but I simply commented out the offending lines in dldfun/amd.cc

 //amd_malloc = malloc;
 //amd_free = free;
 //amd_calloc = calloc;
 //amd_realloc = realloc;
 //amd_printf = printf;

and it compiled.

./configure --enable-jit --with-blas=/opt/OpenBLAS/lib/libopenblas.a --with-lapack=/opt/lapack/lib/liblapack.a LLVM_CONFIG=/usr/bin/llvm-config-3.3 LD_LIBRARY_PATH=/usr/local/lib CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib -l:liblapack.a" --enable-64

The make check was working until it got stuck on plotting functions (permission denied). I logged in as root and it got stuck at legend (same error) so I abandoned check.

Ceral Paquet <octavebugs>
Wed 20 Aug 2014 04:35:12 PM UTC, comment #8: 

I'm curious to know whether you really need 64-bit indexing.  Do you really do computations with arrays that have more than 2e9 elements?

In any case, you might want to look at the way the mxe-octave build system builds Octave and dependencies for 64-bit indexing.

http://hg.octave.org/mxe-octave

mxe-octave can be used to build nearly all dependencies, but if you need only some of them (because your OS provides most as packages, for example) you could still use it to build individual dependencies, or at least examine what is done for building with 64-bit indexing by looking at the makefile fragments in the mxe-octave src directory.

John W. Eaton <jwe>
Group administrator
Wed 20 Aug 2014 01:42:03 PM UTC, comment #7: 

Partial progress... I commented out #include <math.h> in SuiteSparse_config.h and then make can get a lot further. However it stops again with this message.

...
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I../liboctave/cruft/misc -I../liboctave/array -I../liboctave/numeric -I../liboctave/numeric -I../liboctave/operators -I../liboctave/operators -I../liboctave/system -I../liboctave/util -I./octave-value -I./operators -Iparse-tree -I./parse-tree -Icorefcn -I./corefcn -I../libgnu -I../libgnu -I/usr/local/include -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -O3 -mfpmath=sse -fomit-frame-pointer -march=native -s -pthread -MT dldfcn/dldfcn_amd_la-amd.lo -MD -MP -MF dldfcn/.deps/dldfcn_amd_la-amd.Tpo -c dldfcn/amd.cc  -fPIC -DPIC -o dldfcn/.libs/dldfcn_amd_la-amd.o
dldfcn/amd.cc: In function 'octave_value_list Famd(const octave_value_list&, int)':
dldfcn/amd.cc:167:15: error: 'amd_malloc' was not declared in this scope
               amd_malloc = malloc;
               ^
dldfcn/amd.cc:168:15: error: 'amd_free' was not declared in this scope
               amd_free = free;
               ^
dldfcn/amd.cc:169:15: error: 'amd_calloc' was not declared in this scope
               amd_calloc = calloc;
               ^
dldfcn/amd.cc:170:15: error: 'amd_realloc' was not declared in this scope
               amd_realloc = realloc;
               ^
dldfcn/amd.cc:171:15: error: 'amd_printf' was not declared in this scope
               amd_printf = printf;
               ^
Makefile:6085: recipe for target 'dldfcn/dldfcn_amd_la-amd.lo' failed
make[3]: * [dldfcn/dldfcn_amd_la-amd.lo] Error 1

Ceral Paquet <octavebugs>
Wed 20 Aug 2014 04:57:32 AM UTC, comment #6: 

Thanks Mike - you're right. The configure script did find camd.h (and the others) later on.

I still get a compilation error which seems to me to be in the line below. Your help very much appreciated! XOX

...
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I./array -I./cruft/misc -Inumeric -I./numeric -Ioperators -I./operators -I./system -I./util -I../libgnu -I../libgnu -I./cruft/Faddeeva -I/usr/local/include -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -O3 -mfpmath=sse -fomit-frame-pointer -march=native -s -pthread -MT numeric/numeric_libnumeric_la-SparseCmplxCHOL.lo -MD -MP -MF numeric/.deps/numeric_libnumeric_la-SparseCmplxCHOL.Tpo -c numeric/SparseCmplxCHOL.cc  -fPIC -DPIC -o numeric/.libs/numeric_libnumeric_la-SparseCmplxCHOL.o
In file included from /usr/local/include/SuiteSparse_config.h:47:0,
                 from /usr/local/include/amd.h:46,
                 from ./util/oct-sparse.h:33,
                 from numeric/sparse-base-chol.h:27,
                 from numeric/SparseCmplxCHOL.h:27,
                 from numeric/SparseCmplxCHOL.cc:28:
../libgnu/math.h: In function 'int signbit(double)':
../libgnu/math.h:2576:1: error: conflicting declaration of C function 'int signbit(double)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
../libgnu/math.h:2576:1: note: previous declaration 'int signbit(float)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
../libgnu/math.h: In function 'int signbit(long double)':
../libgnu/math.h:2576:1: error: conflicting declaration of C function 'int signbit(long double)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
../libgnu/math.h:2576:1: note: previous declaration 'int signbit(double)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
../libgnu/math.h:2576:1: error: conflicting declaration of C function 'int signbit(long double)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
../libgnu/math.h:2576:1: note: previous declaration 'int signbit(float)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^

Ceral Paquet <octavebugs>
Tue 19 Aug 2014 06:07:38 PM UTC, comment #5: 

Your configure command looks good to me. Note that configure will be checking for suitesparse header files in several different directories, so it's ok if you see errors for some of those. For the example of camd.h, it should look for suitesparse/camd.h, ufsparse/camd.h, camd/camd.h, and lastly just camd.h.

I know it's sometimes tricky to differentiate true errors in a run of configure from errors that mean one possibility failed, try a different one, but it would be helpful if you could try again and see what the actual error is with finding these libraries, if you're still getting errors.

Mike Miller <mtmiller>
Group Member
Mon 18 Aug 2014 02:36:01 PM UTC, comment #4: 

After compiling suitesparse and qrupdate, they install in /usr/local/lib and /usr/local/include. At least, I can see a lot of .so, .a and .h files with the right sounding names.

However octave's configure script still reports they can't be found. E.g.

conftest.c:118:30: fatal error: suitesparse/camd.h: No such file or directory

I checked that file is in /usr/local/include but not in a suitesparse directory. It's just sitting in /usr/local/include. Same for the libs.

This is my configure command:

./configure --enable-jit --with-blas=/opt/OpenBLAS/lib/libopenblas.a --with-lapack=/opt/lapack/lib/liblapack.a LLVM_CONFIG=/usr/bin/llvm-config-3.3 LD_LIBRARY_PATH=/usr/local/lib CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib --enable-64

Ceral Paquet <octavebugs>
Sun 17 Aug 2014 07:26:00 PM UTC, comment #3: 

I have not done this myself so I can't you any more specific help on building SuiteSparse other than pointing to what's in the manual. It sounds to me like you need to build SuiteSparse using its build instructions first, which builds the .a static libraries. Then run the snippet of shell code shown to turn each of the static libraries into shared libraries.

Mike Miller <mtmiller>
Group Member
Sun 17 Aug 2014 02:46:58 PM UTC, comment #2: 

Thanks Mike. I'm in the process of following the instructions.

I'm having trouble with SuiteSparse. There is an instruction "The SuiteSparse makefiles don’t generate shared libraries. On some systems, you can generate them by doing something as simple as..." that I'm stuck on. What exactly do I do here? I copy/pasted the script into the bash shell while in the SuiteSparse directory but it gives an error.

ar: ../*.a: No such file or directory
gcc: error: *.o: No such file or directory
gcc: fatal error: no input files
compilation terminated.




Ceral Paquet <octavebugs>
Sun 17 Aug 2014 02:41:46 AM UTC, comment #1: 

Thanks for your bug report. Please see the comments on bug #42512. In particular, have you compiled QRUPDATE and other libraries to work with 64-bit indexing as indicated in the manual page you cited? The page you linked to is not outdated as far as I know and accurately describes what you need to do to get Octave working with 64-bit indexes. It seems that ensuring all of the dependencies were built and linked properly resolved this error on that bug report.

Mike Miller <mtmiller>
Group Member
Sat 16 Aug 2014 11:55:38 PM UTC, original submission:  

So I just compiled 3.8.2 using gcc4.9 on my new 64 bit computer (debian testing) with the following options:

CFLAGS -O3 -mfpmath=sse -fomit-frame-pointer -march=native -s

configure --enable-64 --enable-jit --with-blas=/opt/OpenBLAS/lib/libopenblas_nehalemp-r0.2.10.so LLVM_CONFIG=/usr/bin/llvm-config-3.3

make -j2


Unfortunately I'm not having a fun time. One of my codes gives this error:

octave:1> fval=[3.4422e+06   3.4255e+07   3.0596e+06];
octave:2> range=[0.00000   1.00000   0.33333];
octave:3> polyfit(range,fval,2)
error: qr: subscript indices must be either positive integers less than 2^63 or logicals
error: called from:
error:   /usr/local/share/octave/3.8.2/m/polynomial/polyfit.m at line 114, column 10
octave:3>


I am thinking this is something related to 64 bit indexing. I found this page:

https://www.gnu.org/software/octave/doc/interpreter/Compiling-Octave-with-64_002dbit-Indexing.html

I was kind of hoping this is outdated and things are auto-magic these days, now that 64 bit is more popular... Is it so?

Ceral Paquet <octavebugs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by octavebugs (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-02 rik5 Open/ClosedOpen Closed
    2014-08-17 mtmiller CategoryNone Configuration and Build System
        Item GroupNone Incorrect Result
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code