patchGNU Octave - Patches: patch #7468, Wrapper for OSX libBLAS.dylib and...

 
 

patch #7468: Wrapper for OSX libBLAS.dylib and libLAPACK.dylib

Submitter:  None
Submitted:  Thu 17 Feb 2011 08:46:44 AM UTC
   
 
Category:  None Priority:  7 - High
Status:  Done Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 24 Mar 2011 08:57:57 PM UTC, comment #4: 

Thanks, I applied this changeset.  Sorry for the delay.

John W. Eaton <jwe>
Group administrator
Wed 02 Mar 2011 09:06:56 AM UTC, comment #3: 

Attached a new patch (patch-octave-blaswrap.diff) with all the requested changes.

  Jarno


(file #22824)

Anonymous
Fri 25 Feb 2011 11:06:22 AM UTC, comment #2: 

I do not object any of the changes you propose.

f2c_lapack_func is an array of function pointers. +1 in the array definition makes the array one element larger, so that when (an unused) stub for f2c_LAPACK_COUNT is created, the compiler does not warn about dereferencing f2c_lapack_func[f2c_LAPACK_COUNT].

BUT now that I think about this again, it would be cleaner to define:

#define F2C_LAPACK_CALL_NONE(name)

i.e. an empty macro body, and then replace the line:

  _(LAPACK_COUNT,0)

with

  _(LAPACK_COUNT,NONE)

This way f2c_lapack_func[f2c_LAPACK_COUNT] would never be used, and hence no warning either :-)

I have attached an updated blaswrap.c to this effect. The file is also untabified and has no C++ comments :-)


(file #22779)

Anonymous
Wed 23 Feb 2011 07:29:03 AM UTC, comment #1: 

Do you object to licensing the copy of this file that is distributed with Octave under the terms of the GPLv3 or any later version, and changing the notice to say that this file is part of Octave?

I would also make the following changes:

Use a macro to define the location of the vecLib file so that it can be easily changed if needed:


#ifndef VECLIB_FILE
#define VECLIB_FILE "/System/Library/..."

...

  apple_vecLib = dlopen (VECLIB_FILE, ...);


Use only C style comments since this is a C language file, not C++.

Include <stdlib.h> for the declaration of abort.

Untabify the file.

Can you also explain why the +1 in


static void (*f2c_lapack_func[f2c_LAPACK_COUNT+1])(void) = { 0 };


avoids the GCC warning "array subscript is above array bounds"?  I don't understand how f2c_LAPACK_COUNT+1 would not be above the array bounds if f2c_LAPACK_COUNT by itself is above the array bounds.

John W. Eaton <jwe>
Group administrator
Thu 17 Feb 2011 08:46:44 AM UTC, original submission:  

The attached changeset (blaswrap.diff) adds checks to configure.ac to retry incompatible fortran compiler in two ways:

1) Try with the "-ff2c" option, i.e. to use the F2C calling convention. This is required with e.g. 32-bit OSX, when using the Apple provided BLAS and LAPACK libraries, but may also work with other platforms

2) On OSX, try with an OSX specific libcruft/misc/blaswrap.c, which converts the F2C calls in libBLAS.dylib and libLAPACK.dylib to the native gfortran calling convention. This is required with 64-bit OSX, if using the Apple provided BLAS and LAPACK libraries.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #22824:  patch-octave-blaswrap.diff added by None (13KiB - application/octet-stream)
file #22779:  blaswrap.c added by None (9KiB - application/octet-stream)
file #22708:  blaswrap.diff added by None (12KiB - application/octet-stream)

 

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)
  •  

    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 logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-03-24 jwe StatusNone Done
        Open/ClosedOpen Closed
    2011-03-02 None Attached File- Added patch-octave-blaswrap.diff, #22824
    2011-02-25 None Attached File- Added blaswrap.c, #22779
    2011-02-17 None Attached File- Added blaswrap.diff, #22708

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code