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

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

[Octave-bug-tracker] [bug #29515] libcruft/blas-xtra/cmatm3.f & f2c fort


From: Jaroslav Hajek
Subject: [Octave-bug-tracker] [bug #29515] libcruft/blas-xtra/cmatm3.f & f2c fortran calling convention bug
Date: Sun, 11 Apr 2010 12:31:16 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; cs-CZ; rv:1.9.0.18) Gecko/2010021501 Ubuntu/9.04 (jaunty) Firefox/3.0.18

URL:
  <http://savannah.gnu.org/bugs/?29515>

                 Summary: libcruft/blas-xtra/cmatm3.f & f2c fortran calling
convention bug
                 Project: GNU Octave
            Submitted by: highegg
            Submitted on: Sun 11 Apr 2010 12:31:14 PM GMT
                Category: Libraries
                Severity: 3 - Normal
              Item Group: Crash
                  Status: In Progress
             Assigned to: highegg
         Originator Name: Jarno Rajahalme
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

libcruft/blas-xtra/cmatm3.f calls blas function cdotu. If f2c calling
convention is used, the function needs to be declared as complex, so that the
compiler knows to pass the return value as the (implicit) first argument. If
complex declaration is missing when using -ff2c, the call will cause a
segmentation fault.

It seems that the cmatm3.f has a typo, as it declares:

     complex cdot,one,zero
     parameter (one = 1e0, zero = 0e0)
     external cdotu,cgemv,cgemm

and later uses:

           c(1,i) = cdotu(k,a(1,i),1,b(1,i),1)

The symbol "cdot" is not used at all.

The only place where cmatm3 is used is in dot.cc. I do not have a working
octave built with -f2c calling convention, so I can't see if the unit tests
fail.

 I verified this with the following sample code:

     program main

     complex cdot,ac(1),bc(1),wc
     external cdotu

     ac(1) = cmplx(1e0,1e0)
     bc(1) = cmplx(1e0,2e0)
     wc = cdotu(1,ac,1,bc,1)
     PRINT *,ac(1)*bc(1),"==",wc

     end

$ gfortran -ff2c main.f -lblas
$ ./a.out
Segmentation fault
$

Adding u to "cdot" on the complex declaration line will make this work.




    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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