fw4spl
CMakeFortranCompilerABI.F
1  PROGRAM cmakefortrancompilerabi
2 #if 0
3 ! Address Size
4 #endif
5 #if defined(_LP64)
6  print *, 'INFO:sizeof_dptr[8]'
7 #elif defined(_M_IA64)
8  print *, 'INFO:sizeof_dptr[8]'
9 #elif defined(_M_X64)
10  print *, 'INFO:sizeof_dptr[8]'
11 #elif defined(_M_AMD64)
12  print *, 'INFO:sizeof_dptr[8]'
13 #elif defined(__x86_64__)
14  print *, 'INFO:sizeof_dptr[8]'
15 
16 #elif defined(_ILP32)
17  print *, 'INFO:sizeof_dptr[4]'
18 #elif defined(_M_IX86)
19  print *, 'INFO:sizeof_dptr[4]'
20 #elif defined(__i386__)
21  print *, 'INFO:sizeof_dptr[4]'
22 
23 #elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
24  print *, 'INFO:sizeof_dptr[8]'
25 #elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4
26  print *, 'INFO:sizeof_dptr[4]'
27 #elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 8
28  print *, 'INFO:sizeof_dptr[8]'
29 #elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 4
30  print *, 'INFO:sizeof_dptr[4]'
31 #endif
32 
33 #if 0
34 ! Application Binary Interface
35 #endif
36 #if defined(__sgi) && defined(_ABIO32)
37  print *, 'INFO:abi[ELF O32]'
38 #elif defined(__sgi) && defined(_ABIN32)
39  print *, 'INFO:abi[ELF N32]'
40 #elif defined(__sgi) && defined(_ABI64)
41  print *, 'INFO:abi[ELF 64]'
42 #elif defined(__ELF__)
43  print *, 'INFO:abi[ELF]'
44 #endif
45  print *, 'ABI Detection'
46  END