Re: zdotu_ problem on libblas3gf on sparc and alpha

2008-02-17 Thread Kumar Appaiah
Dear Julien,

On Sun, Feb 17, 2008 at 03:53:05PM +0100, Julien Cristau wrote:
 I ran your test programs on sparc, with the following results:

Thank you!

 On Sat, Feb 16, 2008 at 23:17:09 +0530, Kumar Appaiah wrote:
 
  1. Please build and run the following programs
  g++ progfile.cpp -lblas should do.
  
  Program 1
  -
  
 $ make blastest1 CXXFLAGS='-Wall -g' LDFLAGS=-lblas
 g++ -Wall -g  -lblas  blastest1.cpp   -o blastest1
 $ ./blastest1 
 Illegal instruction
 
  
  Program 2
  -
  
 $ make blastest2 CXXFLAGS='-Wall -g' LDFLAGS=-lblas
 g++ -Wall -g  -lblas  blastest2.cpp   -o blastest2
 $ ./blastest2 
 $ echo $?
 1

It appears that the calling convention for the new gfortran does not
like the direct conversion to std::complexdouble. I guess the
following should work though:

#include complex
typedef std::complexdouble cdouble;
extern C {
  double _Complex zdotu_(const int *, const cdouble *, const int *,
 const cdouble *, const int *);
}

int main() {
  const int incr = 1;
  const int size = 6;
  cdouble a[size] = {cdouble( 0.7219, 0.8871),
  cdouble(0.7073,-0.7953),
 cdouble( 0.2610, 0.4325),
  cdouble(-0.0565,-0.0719),
 cdouble( 0.7277,-0.9754), cdouble(-0.3780,  1.0718)};
  cdouble b[size] = {cdouble(-0.0821,+0.8410), cdouble(-0.0749,  0.0729),
 cdouble(-0.6094,-0.2975), cdouble(0.2106,  -0.2026),
 cdouble( 0.1043,-0.8300), cdouble( 0.0806,  0.3698)};
  cdouble x_ref(-2.01767031,-0.45861365);
  cdouble x = std::complexdouble(zdotu_(size, a, incr, b, incr));
  return (std::abs(x - x_ref)  1e-6) ? 0 : 1;
}

Not tested, but should work. Confirmation would be appreciated! :-)

Thanks!

Kumar
-- 
Kumar Appaiah,
458, Jamuna Hostel,
Indian Institute of Technology Madras,
Chennai - 600 036


signature.asc
Description: Digital signature


Re: zdotu_ problem on libblas3gf on sparc and alpha

2008-02-17 Thread Kumar Appaiah
On Sun, Feb 17, 2008 at 08:08:30PM +, Jurij Smakov wrote:
  Not tested, but should work. Confirmation would be appreciated! :-)
 
 Runs fine, exit code is 0. Let me know if you still need log of that 
 configure run.

No, this information is more than sufficient! Thanks!

Kumar
-- 
Kumar Appaiah,
458, Jamuna Hostel,
Indian Institute of Technology Madras,
Chennai - 600 036


signature.asc
Description: Digital signature


zdotu_ problem on libblas3gf on sparc and alpha

2008-02-16 Thread Kumar Appaiah
(Cross posted to debian-sparc and debian-alpha)

Dear Debian Alpha/Sparc users,

I am observing mysterious failures of a BLAS+LAPACK based package not
building on sparc and alpha due to its failure to find the zdotu_
function in Blas. The failed build logs are:

Sparc:
http://buildd.debian.org/fetch.cgi?pkg=3Dlibitppver=3D4.0.2-1arch=3Dspar=
cstamp=3D1203160339file=3Dlog

Alpha:
http://buildd.debian.org/fetch.cgi?pkg=3Dlibitppver=3D4.0.2-1arch=3Dalph=
astamp=3D1203160099file=3Dlog

Now, to help me debug this failure, I would request people with access
to sid on these architecture machines to do the following, please:

1. Please build and run the following programs
g++ progfile.cpp -lblas should do.

Program 1
-

#include complex
typedef std::complexdouble cdouble;
extern C {
  cdouble zdotu_(const int *, const cdouble *, const int *,
 const cdouble *, const int *);
}

int main() {
  const int incr = 1;
  const int size = 6;
  cdouble a[size] = {cdouble( 0.7219, 0.8871), cdouble(0.7073,-0.7953),
 cdouble( 0.2610, 0.4325),  cdouble(-0.0565,-0.0719),
 cdouble( 0.7277,-0.9754), cdouble(-0.3780, 1.0718)};
  cdouble b[size] = {cdouble(-0.0821,+0.8410), cdouble(-0.0749, 0.0729),
 cdouble(-0.6094,-0.2975), cdouble(0.2106, -0.2026),
 cdouble( 0.1043,-0.8300), cdouble( 0.0806, 0.3698)};
  cdouble x_ref(-2.01767031,-0.45861365);
  cdouble x = zdotu_(size, a, incr, b, incr);
  return (std::abs(x - x_ref)  1e-6) ? 0 : 1;
}

Program 2
-
#include complex

#define SIZE 6

typedef std::complexdouble cdouble;

using namespace std;

extern C {
  void zdotu_(cdouble *, const int *, const cdouble *, const int *,
  const cdouble *, const int *);
}

int main() {
  int incr = 1;
  const int size = SIZE;
  cdouble a[SIZE] = {cdouble( 0.7219, 0.8871), cdouble( 0.7073,-0.7953),
 cdouble( 0.2610, 0.4325), cdouble(-0.0565,-0.0719),
 cdouble( 0.7277,-0.9754), cdouble(-0.3780, 1.0718)};
  cdouble b[SIZE] = {cdouble(-0.0821,+0.8410), cdouble(-0.0749, 0.0729),
 cdouble(-0.6094,-0.2975), cdouble( 0.2106,-0.2026),
 cdouble( 0.1043,-0.8300), cdouble( 0.0806, 0.3698)};
  cdouble x_ref(-2.01767031,-0.45861365);
  cdouble x;
  zdotu_(x, size, a, incr, b, incr);
  return (std::abs(x - x_ref)  1e-6) ? 0 : 1;
}


2. If the programs runs and gives no error and exits with a nice
status message, please fetch the source for libitpp 4.0.2-1 from sid,
and please run the ./configure and send me the config.log, if
possible, in the presence of the build dependencies, of course.

Thank you!

Kumar
-- 
Kumar Appaiah,
458, Jamuna Hostel,
Indian Institute of Technology Madras,
Chennai - 600 036


signature.asc
Description: Digital signature