Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50295 - in sandbox/boost/numeric/bindings: blas traits
From: thomas.klimpel_at_[hidden]
Date: 2008-12-16 07:03:52


Author: klimpel
Date: 2008-12-16 07:03:51 EST (Tue, 16 Dec 2008)
New Revision: 50295
URL: http://svn.boost.org/trac/boost/changeset/50295

Log:
Pay attention to f2c return convention (g77, gfortran -ff2c and clapack), required on linux64 to make regression tests pass.

Text files modified:
   sandbox/boost/numeric/bindings/blas/blas.h | 20 ++++++++++++++++++++
   sandbox/boost/numeric/bindings/traits/fortran.h | 14 ++++++++++----
   2 files changed, 30 insertions(+), 4 deletions(-)

Modified: sandbox/boost/numeric/bindings/blas/blas.h
==============================================================================
--- sandbox/boost/numeric/bindings/blas/blas.h (original)
+++ sandbox/boost/numeric/bindings/blas/blas.h 2008-12-16 07:03:51 EST (Tue, 16 Dec 2008)
@@ -32,7 +32,11 @@
   void BLAS_CAXPY(const int *n, const fcomplex_t* alpha, const fcomplex_t* x, const int* incx, fcomplex_t* y, const int* incy);
   void BLAS_ZAXPY(const int *n, const dcomplex_t* alpha, const dcomplex_t* x, const int* incx, dcomplex_t* y, const int* incy);
 
+#ifndef BIND_FORTRAN_F2C_RETURN_CONVENTIONS
   float BLAS_SDOT (const int *n, const float *x, const int *incx, const float *y, const int *incy);
+#else
+ double BLAS_SDOT (const int *n, const float *x, const int *incx, const float *y, const int *incy);
+#endif
   double BLAS_DDOT (const int *n, const double *x, const int *incx, const double *y, const int *incy);
 
   void BLAS_CDOTU(fcomplex_t* ret, const int *n, const fcomplex_t *x, const int *incx, const fcomplex_t *y, const int *incy);
@@ -41,14 +45,30 @@
   void BLAS_CDOTC(fcomplex_t* ret, const int *n, const fcomplex_t *x, const int *incx, const fcomplex_t *y, const int *incy);
   void BLAS_ZDOTC(dcomplex_t* ret, const int *n, const dcomplex_t *x, const int *incx, const dcomplex_t *y, const int *incy);
 
+#ifndef BIND_FORTRAN_F2C_RETURN_CONVENTIONS
   float BLAS_SNRM2(const int *n, const float *x, const int *incx);
+#else
+ double BLAS_SNRM2(const int *n, const float *x, const int *incx);
+#endif
   double BLAS_DNRM2(const int *n, const double *x, const int *incx);
+#ifndef BIND_FORTRAN_F2C_RETURN_CONVENTIONS
   float BLAS_SCNRM2(const int *n, const fcomplex_t *x, const int *incx);
+#else
+ double BLAS_SCNRM2(const int *n, const fcomplex_t *x, const int *incx);
+#endif
   double BLAS_DZNRM2(const int *n, const dcomplex_t *x, const int *incx);
 
+#ifndef BIND_FORTRAN_F2C_RETURN_CONVENTIONS
   float BLAS_SASUM(const int *n, const float *x, const int *incx);
+#else
+ double BLAS_SASUM(const int *n, const float *x, const int *incx);
+#endif
   double BLAS_DASUM(const int *n, const double *x, const int *incx);
+#ifndef BIND_FORTRAN_F2C_RETURN_CONVENTIONS
   float BLAS_SCASUM(const int *n, const fcomplex_t *x, const int *incx);
+#else
+ double BLAS_SCASUM(const int *n, const fcomplex_t *x, const int *incx);
+#endif
   double BLAS_DZASUM(const int *n, const dcomplex_t *x, const int *incx);
 
   void BLAS_SCOPY( const int *n, const float *x, const int *incx, float *y, const int *incy);

Modified: sandbox/boost/numeric/bindings/traits/fortran.h
==============================================================================
--- sandbox/boost/numeric/bindings/traits/fortran.h (original)
+++ sandbox/boost/numeric/bindings/traits/fortran.h 2008-12-16 07:03:51 EST (Tue, 16 Dec 2008)
@@ -1,8 +1,8 @@
 //
-// Copyright (C) 2002, 2003 Si-Lab b.v.b.a., Toon Knapen and Kresimir Fresl
+// Copyright (C) 2002, 2003 Si-Lab b.v.b.a., Toon Knapen and Kresimir Fresl
 //
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 //
 
@@ -26,7 +26,7 @@
 
 #endif
 
-// Next we define macro's to convert our symbols to
+// Next we define macro's to convert our symbols to
 // the current convention
 #if defined(BIND_FORTRAN_LOWERCASE_UNDERSCORE)
 #define FORTRAN_ID( id ) id##_
@@ -36,4 +36,10 @@
 #error do not know how to bind to fortran calling convention
 #endif
 
+// As long as f2c return conventions are the common case,
+// we turn them on unless requested otherwise
+#ifndef BIND_FORTRAN_NO_F2C_RETURN_CONVENTIONS
+#define BIND_FORTRAN_F2C_RETURN_CONVENTIONS
+#endif
+
 #endif // BOOST_NUMERIC_BINDINGS_TRAITS_FORTRAN_H


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk