casacore
aipsenv.h
Go to the documentation of this file.
1 //# aipsenv.h: Global initialization for special Casacore macros
2 //# Copyright (C) 2000,2001,2002,2003,2004
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 // this file contains all the compiler specific defines
29 
30 #ifndef CASA_AIPSENV_H
31 #define CASA_AIPSENV_H
32 
33 namespace casacore { //# NAMESPACE CASACORE - BEGIN
34 
35 // Set if compiler supports C++11 or newer
36 #if __cplusplus >= 201103L
37 #define AIPS_CXX11
38 #endif
39 
40 // Set if GCC compiler is used.
41 #if defined(AIPS_GCC)
42 #undef AIPS_GCC
43 #endif
44 #if defined(__GNUC__)
45 #define AIPS_GCC
46 #endif
47 
48 /* ONLY USE IF CODE WILL _NOT_ WORK WITH NEWER VERSIONS */
49 #if defined(AIPS_GCC2)
50 #undef AIPS_GCC2
51 #endif
52 #if (defined(AIPS_GCC) && __GNUC_CC == 2)
53 #define AIPS_GCC2
54 #endif
55 
56 /* ONLY USE IF CODE WILL _NOT_ WORK WITH NEWER VERSIONS */
57 #if defined(AIPS_GCC295)
58 #undef AIPS_GCC295
59 #endif
60 #if (defined(AIPS_GCC2) && __GNUC_MINOR__ == 95)
61 #define AIPS_GCC295
62 #endif
63 
64 /* ONLY USE IF CODE WILL _NOT_ WORK WITH NEWER VERSIONS */
65 #if defined(AIPS_GCC3)
66 #undef AIPS_GCC3
67 #endif
68 #if (defined(AIPS_GCC) && __GNUC__ == 3)
69 #define AIPS_GCC3
70 #endif
71 
72 /* ONLY USE IF CODE WILL _NOT_ WORK WITH NEWER VERSIONS */
73 #if defined(AIPS_GCC4)
74 #undef AIPS_GCC4
75 #endif
76 #if (defined(AIPS_GCC) && __GNUC__ == 4)
77 #define AIPS_GCC4
78 #endif
79 
80 // Alternate project compiler
81 #if defined(AIPS_SGI)
82 #undef AIPS_SGI
83 #endif
84 #if defined(__sgi)
85 #define AIPS_SGI
86 #if defined(_MIPS_SZPTR) && (_MIPS_SZPTR == 64)
87 #define AIPS_64B
88 #define SGI64
89 #endif
90 #endif
91 
92 // Alternate project compiler
93 #if defined(AIPS_SUN_NATIVE)
94 #undef AIPS_SUN_NATIVE
95 #endif
96 #if defined(__SUNPRO_CC)
97 #define AIPS_SUN_NATIVE
98 #endif
99 
100 #if defined(AIPS_SOLARIS)
101 #undef AIPS_SOLARIS
102 #endif
103 #if defined(__sun)
104 #define AIPS_SOLARIS
105 #endif
106 
107 #if defined(AIPS_HP)
108 #undef AIPS_HP
109 #endif
110 #if defined(__hp)
111 #define AIPS_HP
112 #endif
113 
114 #if defined(AIPS_ALPHA)
115 #undef AIPS_ALPHA
116 #endif
117 #if defined(__alpha)
118 #define AIPS_ALPHA
119 #define AIPS_64B
120 #endif
121 
122 #if defined(AIPS_BSD)
123 #undef AIPS_BSD
124 #endif
125 #if defined(__FreeBSD__)
126 #define AIPS_BSD
127 #define AIPS_NOLARGEFILE
128 #endif
129 
130 #if defined(AIPS_LINUX)
131 #undef AIPS_LINUX
132 #endif
133 #if defined(__linux__)
134 #define AIPS_LINUX
135 #endif
136 
137 #if defined(AIPS_KAI)
138 #undef AIPS_KAI
139 #endif
140 #if defined(__kai)
141 #define AIPS_KAI
142 #endif
143 
144 #if defined(AIPS_AIX)
145 #undef AIPS_AIX
146 #endif
147 #if defined(_AIX)
148 #define AIPS_AIX
149 #endif
150 
151 #if defined(AIPS_INTELCC)
152 #undef AIPS_INTELCC
153 #endif
154 #if defined(__INTEL_COMPILER)
155 #define AIPS_INTELCC
156 #endif
157 
158 #if defined(AIPS_CRAY_PGI)
159 #undef AIPS_CRAY_PGI
160 #endif
161 #if defined(__QK_USER__)
162 #define AIPS_CRAY_PGI
163 #if !defined(AIPS_NOLARGEFILE)
164 #define AIPS_NOLARGEFILE
165 #endif
166 #if !defined(AIPS_NO_LEA_MALLOC)
167 #define AIPS_NO_LEA_MALLOC
168 #endif
169 #endif
170 
171 #if defined(AIPS_CRAY_CATAMOUNT)
172 #undef AIPS_CRAY_CATAMOUNT
173 #endif
174 #if defined(__LIB_CATAMOUNT__)
175 #define AIPS_CRAY_CATAMOUNT
176 #endif
177 
178 #if (defined(__ia64) || defined(__x86_64__) || defined(__aarch64__))
179 # if !defined(AIPS_64B)
180 # define AIPS_64B
181 # endif
182 #endif
183 
184 #if defined(AIPS_I386)
185 #undef AIPS_I386
186 #endif
187 #if defined(i386)
188 #define AIPS_I386
189 #endif
190 
191 #if defined(AIPS_DARWIN)
192 #undef AIPS_DARWIN
193 #endif
194 #if defined(__APPLE__)
195 #define AIPS_DARWIN
196 // No need for largefile definition as it is the default under DARWIN
197 #define AIPS_NOLARGEFILE
198  // Don't use AIPS_LITTLE_ENDIAN as this would prevent universal builds
199  // from working. Auto-detect from AIPS_I386 for intel Macs
200 #define AIPS_NO_LEA_MALLOC
201 # if defined(AIPS_LITTLE_ENDIAN)
202 # undef AIPS_LITTLE_ENDIAN
203 # endif
204 #endif
205 
206 // If the compiler specifies endianness, use that
207 #if !(defined(AIPS_LITTLE_ENDIAN))
208 #if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__))
209 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
210 #define AIPS_LITTLE_ENDIAN
211 #endif
212 #else
213 // Automatically configure for known LITTLE ENDIAN systems
214 #if (defined(AIPS_ALPHA) || defined(AIPS_I386) || defined(__x86_64__) || defined(__ARMEL__) || defined(__AARCH64EL__))
215 #define AIPS_LITTLE_ENDIAN
216 #endif
217 #endif
218 #endif
219 
220 
221 // If needed, define the LFS variables (needed in code using cfitsio).
222 #ifndef AIPS_NOLARGEFILE
223 # undef _FILE_OFFSET_BITS
224 # define _FILE_OFFSET_BITS 64
225 # ifndef _LARGEFILE_SOURCE
226 # define _LARGEFILE_SOURCE
227 # endif
228 # ifndef _LARGEFILE64_SOURCE
229 # define _LARGEFILE64_SOURCE
230 # endif
231 #endif
232 
233 
234 } //# NAMESPACE CASACORE - END
235 #endif
this file contains all the compiler specific defines
Definition: mainpage.dox:28