[cffi-devel] detecting int size used by library
Mark Hoemmen
mark.hoemmen at gmail.com
Wed May 26 15:17:24 UTC 2010
On Wed, May 26, 2010 at 05:42, Tamas K Papp <tkpapp at gmail.com> wrote:
> I am using LAPACK/BLAS (ATLAS) libraries via CFFI. Recently, my
> tests failed, and to my surprise, the solution was to use 32-bit ints.
> Note that I am on a 64-bit platform, using the Ubuntu libraries, so
> why this happens is a mystery. But it would be great if I could
> detect it somehow from within Lisp.
In the particular case of LAPACK and the BLAS: the default LAPACK and
BLAS should always use 32-bit ints (Fortran's INTEGER type, a.k.a.
"INTEGER(4)"). There are versions of both libraries that use 64-bit
ints ("INTEGER(8)"), but the system should always identify them
specially: either as separate, differently named libraries, or as
differently named functions within the same library. (I've seen both
possibilities.)
In general: Of course it would be nicer to be able to do everything in
Lisp, but have you taken a look at CMake's CheckTypeSize module?
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:CheckTypeSize
mfh
More information about the cffi-devel
mailing list