bugGNU Octave - Bugs: bug #32009, Issues with OCT-files and LAPACK

 
 

bug #32009: Issues with OCT-files and LAPACK

Submitted by:  Lukas Reichlin <paramaniac>
Submitted on:  Wed 29 Dec 2010 09:51:30 PM UTC  
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  paramaniac Open/Closed:  Closed
Release:  3.3.52 Operating System:  Mac OS

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 24 Jan 2011 12:15:32 PM UTC, comment #4: 

"every mkoctfile command" means mkoctfile commands in the makefile_* [1] (all except makefile_helpers and makefile_all). In revision 8055, I removed the flags and added them again in revision 8063. See [2] for an example. This example is the failing test from comment #2. TG01JD.f is the SLICOT routine which won't pass the test provided by its authors.

Today, Jarno Rajahalme posted on the maintainer list:

I have been building Octave from sources on OSX using GCC 4.5. To avoid crashes LDFLAGS needs to have the newer libstdc++ as the first file to be linked with, like:

export LDFLAGS="/opt/local/lib/gcc45/libstdc++.6.dylib"

(Above before ./configure)

Without this Octave segfaults when compiled with newer-than-Apple GCC.

Also, Apple blas (vecLib) does not work with 64-bit gfortran (4.2, 4.3, 4.4, nor 4.5). Complex functions obviously fail (and segment fault) without -ff2c option, but then other non-complex routines return incorrect answers when -ff2c is enabled, so that configure fails. So with 64-bit OSX you pretty much have to use atlas and/or lapack.

Would information like this be of interest in README.MacOS?

Jarno

Ben and I exchanged a few mails about README.MacOS and I have tried to configure octave-devel with

--with-blas="-Wl,-framework -Wl,vecLib"

in a first attempt and added stuff like

configure.fflags-delete    -pipe -m64
configure.fflags-append    -ff2c -g -m32

and had exactly the config failures that Jarno describes.

My  octave_config_info.config_opts  for successful 3.3.90 builds are

'--prefix=/opt/local'
'--without-x'
'--enable-shared'
'--enable-dl'
'--disable-docs'
'--disable-openmp'
'--enable-readline'
'--enable-extra-warning-flags'
'--with-qhull'
'--with-z'
'--with-hdf5'
'--with-fftw3'
'--with-fftw3f'
'--with-glpk'
'--with-curl'
'--with-blas'
'--with-lapack'
'--with-qrupdate'
'--with-amd'
'--with-camd'
'--with-colamd'
'--with-ccolamd'
'--with-cholmod=-lcholmod -lmetis'
'--with-cxsparse'
'--with-umfpack'
'--with-arpack'
'CC=/opt/local/bin/gcc-mp-4.4'
'CFLAGS=-pipe -O2 -m64'
'LDFLAGS=-L/opt/local/lib'
'CPPFLAGS=-I/opt/local/include'
'CXX=/opt/local/bin/g++-mp-4.4'
'CXXFLAGS=-pipe -O2 -m64'
'F77=/opt/local/bin/gfortran-mp-4.4'
'FFLAGS=-pipe -O2 -m64'

but with these builds I need to add the mac-specific flags to mkoctfile calls like [2] which is exactly what I want to avoid.

Best Regards,
Lukas

[1]
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/control/devel/

[2]
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/control/devel/makefile_minreal.m?r1=8055&r2=8063

Lukas Reichlin <paramaniac>
Mon 24 Jan 2011 04:26:43 AM UTC, comment #3: 

I don't see the funny output with 3.3.90 on my Debian system.

I do see the failed test, but I'm not sure how to debug that problem.

What are BLAS_LIBS and LAPACK_LIBS set to in mkoctfile on your system?

When you say

If I add the options "-Wl,-framework" "-Wl,vecLib"
to every mkoctfile command, all tests from test_control pass without problems.

precisely what do you mean by "every mkoctfile command"?

Is your copy of Octave 3.2.4 linked with some different version of the BLAS and LAPACK, or does the mkoctfile script use a different command to compile files?  If so, what are the differences?

Also, since I am seeing the test failure, even if it is somehow solved by using Apple's veclib, it would be helpful if we could find out why the test is failing without veclib, so that we can fix the problem for other systems too.

John W. Eaton <jwe>
Project Administrator
Sun 23 Jan 2011 10:11:26 PM UTC, comment #2: 

The problem turned out to be not completely solved on my machines, therefore I reopen this bug report.

Octave 3.3.55 and 3.3.90 are able to build my oct-files from control-2.0 without the Mac-specific compiler flags

"-Wl,-framework" "-Wl,vecLib"

(MacPorts, Mac OS X 10.6.6, control/devel/makefile_all)

However, some tests are failing, for example the one for SLICOT Fortran routine TG01JD which requires BLAS and LAPACK:

octave:1> test_control
  ***** assert (Ar, Ae, 1e-4);
!!!!! test failed
assert (Ar,Ae,1e-4) expected

but got

maximum absolute error 2.42937 exceeds tolerance 0.0001
shared variables
  scalar structure containing the fields:

    Ar =

      octave:2> edit ltimodels
octave:3> test_control
octave:4>

If I add the options

"-Wl,-framework" "-Wl,vecLib"

to every mkoctfile command, all tests from test_control pass without problems.

BTW: Note the blanks before octave:2 and the missing output between octave:3 and octave:4. This problem doesn't exist in Octave 3.2.4.

Lukas Reichlin <paramaniac>
Thu 06 Jan 2011 08:11:58 AM UTC, comment #1: 

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/5eb10763069f

John W. Eaton <jwe>
Project Administrator
Wed 29 Dec 2010 09:51:30 PM UTC, original submission:  

Octave 3.3.52 (The most recent "octave-devel +gcc44" version available from MacPorts) running on Mac OS X 10.6.5 (A Core2Duo laptop and a Core i3 desktop) has problems to compile OCT-files that are using LAPACK routines:

octave:1> ls
control.tar.gz
octave:2> pkg install control*
Undefined symbols:
  "_dlaset_", referenced from:
      _ab08nd_ in AB08ND.o
      _ab08nd_ in AB08ND.o
      _ab08nx_ in AB08NX.o
      _ab08nx_ in AB08NX.o
      _ab08nx_ in AB08NX.o
      _ab08nx_ in AB08NX.o
  "_dggev_", referenced from:
      Fslab08nd(octave_value_list const&, int) in slab08nd.o
  "_dlapmt_", referenced from:
      _ab08nx_ in AB08NX.o
  "_dlarfg_", referenced from:
      _ab08nx_ in AB08NX.o
      _mb03oy_ in MB03OY.o
      _mb03py_ in MB03PY.o
  "_dlatzm_", referenced from:
      _ab08nx_ in AB08NX.o
  "_dlacpy_", referenced from:
      _ab08nd_ in AB08ND.o
      _ab08nd_ in AB08ND.o
      _ab08nd_ in AB08ND.o
      _ab08nd_ in AB08ND.o
      _ab08nd_ in AB08ND.o
      _ab08nd_ in AB08ND.o
  "_dtzrzf_", referenced from:
      _ab08nd_ in AB08ND.o
  "_dormqr_", referenced from:
      _ab08nx_ in AB08NX.o
  "_dormrq_", referenced from:
      _ab08nx_ in AB08NX.o
      _ab08nx_ in AB08NX.o
  "_dlaic1_", referenced from:
      _mb03oy_ in MB03OY.o
      _mb03oy_ in MB03OY.o
      _mb03py_ in MB03PY.o
      _mb03py_ in MB03PY.o
  "_dlamch_", referenced from:
      _ab08nd_ in AB08ND.o
      _tb01id_ in TB01ID.o
      _tb01id_ in TB01ID.o
  "_dormrz_", referenced from:
      _ab08nd_ in AB08ND.o
      _ab08nd_ in AB08ND.o
  "_dlange_", referenced from:
      _ab08nd_ in AB08ND.o
  "_dlarf_", referenced from:
      _mb03oy_ in MB03OY.o
      _mb03py_ in MB03PY.o
  "_ilaenv_", referenced from:
      _ab08nd_ in AB08ND.o
      _ab08nd_ in AB08ND.o
      _ab08nx_ in AB08NX.o
      _ab08nx_ in AB08NX.o
      _ab08nx_ in AB08NX.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [slab08nd.oct] Error 1
'make' returned the following error: mkoctfile slab08nd.cc \
              AB08ND.f AB08NX.f TB01ID.f MB03OY.f MB03PY.f
error: called from `pkg>configure_make' in file /opt/local/share/octave/3.3.52/m/pkg/pkg.m near line 1321, column 9
error: called from:
error:   /opt/local/share/octave/3.3.52/m/pkg/pkg.m at line 782, column 5
error:   /opt/local/share/octave/3.3.52/m/pkg/pkg.m at line 353, column 9
octave:2>

When adding the Mac-specific options
"-Wl,-framework" "-Wl,vecLib"
to the mkoctfile arguments like in [1], the problem is solved on my machine. But since these options are Mac-specific, other platforms are broken. Therefore some kind of patch for mkoctfile is needed.

BTW: The problem does not exist when using Octave 3.2.4 from MacPorts.

Steps to reproduce the problem:

  • Download the latest SVN version of the control package from [2]
  • Install the package by "pkg install" on a Mac with Octave 3.3
  • If installation doesn't fail, you can try to run

test_control
at least two times consecutively. All tests should pass.

Best Regards
Lukas

[1]
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/control/devel/makefile_zero.m

[2]
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/control/?view=tar

Lukas Reichlin <paramaniac>

 

(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 jwe (Posted a comment)
  • -email is unavailable- added by paramaniac (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-01-06 jwe StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.5