Mailinglist Archive: opensuse-programming (84 mails)

< Previous Next >
Re: [suse-programming-e] Is SuSE 64 bit ?
  • From: John Lamb <J.D.Lamb@xxxxxxxxxxxxxx>
  • Date: Thu, 26 Aug 2004 11:45:42 +0100
  • Message-id: <412DBF56.4040209@xxxxxxxxxxxxxx>
Colin Carter wrote:
Does anybody know if SuSE 64 bit system is really 64 bit code?
I can't seem to get any response from SuSE staff regarding the questions:
1: If I define int i; and real x;
do I get 64 bit integer and float if compiled under 64?

Try it and see:

#include<stdio.h>
int main() {
printf( "short has size %d\n", sizeof( short ) );
printf( "int has size %d\n", sizeof( int ) );
printf( "long has size %d\n", sizeof( long ) );
printf( "long long long has size %d\n", sizeof( long long ) );
printf( "float has size %d\n", sizeof( float ) );
printf( "double has size %d\n", sizeof( double ) );
}

A 32-bit system will give 2 for short, 4 for int, long and float and and 8 for long long and double. A 64-bit system ought to give different values. Remember that C also specifies bounds for some of these values; so short isn't going to have size 8 just because you've got 64-bit code.

2: Where does one find the definitions in the SuSE system?
For example, where is the definition for the structure of
XSizeHints ?
Where is the definition of the function prototypes for the
64 bit functions?

Typically somewhere in the /usr/include hierarchy.

Maybe the 'average' programmer can ignore such issues, but I
want to use FORTRAN to do the number crunching and I need to
know if I should pass an integer(KIND=4) or integer(KIND=8)

I don't suppose there's any way I could persuade you to try using C++ or C instead of FORTRAN (I gave up FORTRAN in 1988 and haven't looked back). If you're calling C functions, then I guess you just look for the declarations in an include directory and use the program above (compile it gcc name.c and run it ./a.out) to identify the actual sizes.

--
JDL

< Previous Next >
References