- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please pardon me if this is elementary...
I'm trying to figure out what C/C++ type to use for LAPACK arguments that are billed as "LOGICAL". These are mostly bwork arrays, but also include selector arguments. I need to know this for building both 32-bit and 64-bit versions of our application.
The old f2c definition is as a long, but that isn't consistent on 64-bit platforms. Apple defines these arguments as long for 32-bit platforms and int on 64-bit.
The mkl_lapack.h header file has void * for those arguments, so it provides no guidance.
I'm trying to figure out what C/C++ type to use for LAPACK arguments that are billed as "LOGICAL". These are mostly bwork arrays, but also include selector arguments. I need to know this for building both 32-bit and 64-bit versions of our application.
The old f2c definition is as a long, but that isn't consistent on 64-bit platforms. Apple defines these arguments as long for 32-bit platforms and int on 64-bit.
The mkl_lapack.h header file has void * for those arguments, so it provides no guidance.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - johnwavemetrics.com
I'm trying to figure out what C/C++ type to use for LAPACK arguments that are billed as "LOGICAL". These are mostly bwork arrays, but also include selector arguments. I need to know this for building both 32-bit and 64-bit versions of our application.
The old f2c definition is as a long, but that isn't consistent on 64-bit platforms. Apple defines these arguments as long for 32-bit platforms and int on 64-bit.
The mkl_lapack.h header file has void * for those arguments, so it provides no guidance.
The old f2c definition is as a long, but that isn't consistent on 64-bit platforms. Apple defines these arguments as long for 32-bit platforms and int on 64-bit.
The mkl_lapack.h header file has void * for those arguments, so it provides no guidance.
On the 32-bit platforms, int * and long * are of course the same, and Fortran default logical is a 32-bit type for 64-bit also. For completeness, it would be good to confirm whether it becomes a 64-bit type in the ilp64 library.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
int * does make more sense than void *, so I agree we should have an explanation from the maintainers.
On the 32-bit platforms, int * and long * are of course the same, and Fortran default logical is a 32-bit type for 64-bit also. For completeness, it would be good to confirm whether it becomes a 64-bit type in the ilp64 library.
On the 32-bit platforms, int * and long * are of course the same, and Fortran default logical is a 32-bit type for 64-bit also. For completeness, it would be good to confirm whether it becomes a 64-bit type in the ilp64 library.
Yes, that is the, er, 64-dollar question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - johnwavemetrics.com
Please pardon me if this is elementary...
I'm trying to figure out what C/C++ type to use for LAPACK arguments that are billed as "LOGICAL". These are mostly bwork arrays, but also include selector arguments. I need to know this for building both 32-bit and 64-bit versions of our application.
The old f2c definition is as a long, but that isn't consistent on 64-bit platforms. Apple defines these arguments as long for 32-bit platforms and int on 64-bit.
The mkl_lapack.h header file has void * for those arguments, so it provides no guidance.
I'm trying to figure out what C/C++ type to use for LAPACK arguments that are billed as "LOGICAL". These are mostly bwork arrays, but also include selector arguments. I need to know this for building both 32-bit and 64-bit versions of our application.
The old f2c definition is as a long, but that isn't consistent on 64-bit platforms. Apple defines these arguments as long for 32-bit platforms and int on 64-bit.
The mkl_lapack.h header file has void * for those arguments, so it provides no guidance.
The type LOGICAL for LAPACK arguments is equivalent to the type INTEGER by size. INTEGER typeis mapped onto C types this way: for 32-bitplatform it's 'int' or 'long' - doesn't matter(32-bit long), for 64-bit platform it's either 'int' (32-bit long) in case of LP64 model, which you apparently use, or 64-bit integer type - 'long' in Linux/MacOS, 'long long' in Windows (they treat 'long' as 32-bit by some reason) or substitutes- in case of ILP64 model.
Using void* for logical arguments is inapropriate indeed, please indicate which function and argument has the wrong prototype.
Thanks, Michael.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Michael Chuvelev (Intel)
The type LOGICAL for LAPACK arguments is equivalent to the type INTEGER by size. INTEGER typeis mapped onto C types this way: for 32-bitplatform it's 'int' or 'long' - doesn't matter(32-bit long), for 64-bit platform it's either 'int' (32-bit long) in case of LP64 model, which you apparently use, or 64-bit integer type - 'long' in Linux/MacOS, 'long long' in Windows (they treat 'long' as 32-bit by some reason) or substitutes- in case of ILP64 model.
Using void* for logical arguments is inapropriate indeed, please indicate which function and argument has the wrong prototype.
Thanks, Michael.
Um, all of them?
Truly, I looked through mkl_lapack.h and find void * for LOGICAL everywhere I looked. Search for either "select" or "bwork" and you will find void *.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page