Mailinglist Archive: opensuse-programming (84 mails)
| < Previous | Next > |
Re: [suse-programming-e] Is SuSE 64 bit ?
- From: Colin Carter <colincarter@xxxxxxxxxxxxx>
- Date: Fri, 27 Aug 2004 11:36:42 GMT
- Message-id: <ecc6421.7666c762.81bca00@xxxxxxxxxxxxxxxxxxxx>
Thank you to
Stefan Hundhammer and John Lamb and William Mahaffey
for your suggestions; which I now need to digest and try.
But Stefan, I do need to care about the size of my integers:
It is generally faster to use the native word size of any
computer, and I need the accuracy and speed.
But most importantly, if my FOTRAN code calls the X-Window API
then I need to hand over the correct size integer.
I had found the includes, as per my sample, but my big problem
is in the linking. Is ther some special environment value
that I need? )I need special environmnet values for my FTN.)
Thanks for any more advice.
Regards,
Colin (a 61 year old 'newbie')
--- Begin Message ---John Lamb wrote:
- From: "William A. Mahaffey III" <wam@xxxxxxxxxx>
- Date: Thu, 26 Aug 2004 15:08:03 -0500
- Message-id: <412E4323.4080808@xxxxxxxxxx>
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.
FORTRAN is still as much as 75% faster than C/C++ with good compilers (SGI & Intel under various linuces, including SuSE), I have seen that without fail. If you are doing runs which take days to complete, the difference definitely counts.
--
To unsubscribe, email: suse-programming-e-unsubscribe@xxxxxxxx
For additional commands, email: suse-programming-e-help@xxxxxxxx
Archives can be found at: http://lists.suse.com/archive/suse-programming-e
--- End Message ---
| < Previous | Next > |