On Wed, May 26, 2010 at 1:42 PM, Tamas K Papp <span dir="ltr"><<a href="mailto:tkpapp@gmail.com">tkpapp@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Is there a way to detect the size of integers (ie 32 or 64 bit) used<br>
by a library?<br></blockquote><div> </div></div>The point is that you cannot even detect it so simply in C. If the library is FORTRAN then you definitely have to introduce the knowledge of the type size "by hand", because different compilers and different compiler options will force the use of different type sizes.<br>
<br>If the library is in C and you have access to the headers then maybe cffi-grovel can traverse the header and find it out, but I am not familiar enough with that component and its preprocessing abilities (Atlas is likely to use #defines and #ifdefs to choose the appropriate size).<br>
<br>Otherwise the usual and most reliable way to detect it is to do something like autoconf does, which is to create a tiny C program, compile it with the same flags as the library and detect the type size. You may even automate this from lisp.<br>
<br>Juanjo<br clear="all"><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://tream.dreamhosters.com">http://tream.dreamhosters.com</a><br>