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__) || defined(__FreeBSD_kernel__)
126 #define AIPS_BSD
127 #define AIPS_NOLARGEFILE
128 #endif
129 
130 #if defined(AIPS_HURD)
131 #undef AIPS_HURD
132 #endif
133 #if defined(__gnu_hurd__)
134 #define AIPS_HURD
135 #endif
136 
137 #if defined(AIPS_LINUX)
138 #undef AIPS_LINUX
139 #endif
140 #if defined(__linux__)
141 #define AIPS_LINUX
142 #endif
143 
144 #if defined(AIPS_KAI)
145 #undef AIPS_KAI
146 #endif
147 #if defined(__kai)
148 #define AIPS_KAI
149 #endif
150 
151 #if defined(AIPS_AIX)
152 #undef AIPS_AIX
153 #endif
154 #if defined(_AIX)
155 #define AIPS_AIX
156 #endif
157 
158 #if defined(AIPS_INTELCC)
159 #undef AIPS_INTELCC
160 #endif
161 #if defined(__INTEL_COMPILER)
162 #define AIPS_INTELCC
163 #endif
164 
165 #if defined(AIPS_CRAY_PGI)
166 #undef AIPS_CRAY_PGI
167 #endif
168 #if defined(__QK_USER__)
169 #define AIPS_CRAY_PGI
170 #if !defined(AIPS_NOLARGEFILE)
171 #define AIPS_NOLARGEFILE
172 #endif
173 #if !defined(AIPS_NO_LEA_MALLOC)
174 #define AIPS_NO_LEA_MALLOC
175 #endif
176 #endif
177 
178 #if defined(AIPS_CRAY_CATAMOUNT)
179 #undef AIPS_CRAY_CATAMOUNT
180 #endif
181 #if defined(__LIB_CATAMOUNT__)
182 #define AIPS_CRAY_CATAMOUNT
183 #endif
184 
185 #if (defined(__ia64) || defined(__x86_64__) || defined(__aarch64__))
186 # if !defined(AIPS_64B)
187 # define AIPS_64B
188 # endif
189 #endif
190 
191 #if defined(AIPS_I386)
192 #undef AIPS_I386
193 #endif
194 #if defined(i386)
195 #define AIPS_I386
196 #endif
197 
198 #if defined(AIPS_DARWIN)
199 #undef AIPS_DARWIN
200 #endif
201 #if defined(__APPLE__)
202 #define AIPS_DARWIN
203 // No need for largefile definition as it is the default under DARWIN
204 #define AIPS_NOLARGEFILE
205  // Don't use AIPS_LITTLE_ENDIAN as this would prevent universal builds
206  // from working. Auto-detect from AIPS_I386 for intel Macs
207 #define AIPS_NO_LEA_MALLOC
208 # if defined(AIPS_LITTLE_ENDIAN)
209 # undef AIPS_LITTLE_ENDIAN
210 # endif
211 #endif
212 
213 // If the compiler specifies endianness, use that
214 #if !(defined(AIPS_LITTLE_ENDIAN))
215 #if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__))
216 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
217 #define AIPS_LITTLE_ENDIAN
218 #endif
219 #else
220 // Automatically configure for known LITTLE ENDIAN systems
221 #if (defined(AIPS_ALPHA) || defined(AIPS_I386) || defined(__x86_64__) || defined(__ARMEL__) || defined(__AARCH64EL__))
222 #define AIPS_LITTLE_ENDIAN
223 #endif
224 #endif
225 #endif
226 
227 
228 // If needed, define the LFS variables (needed in code using cfitsio).
229 #ifndef AIPS_NOLARGEFILE
230 # undef _FILE_OFFSET_BITS
231 # define _FILE_OFFSET_BITS 64
232 # ifndef _LARGEFILE_SOURCE
233 # define _LARGEFILE_SOURCE
234 # endif
235 # ifndef _LARGEFILE64_SOURCE
236 # define _LARGEFILE64_SOURCE
237 # endif
238 #endif
239 
240 
241 } //# NAMESPACE CASACORE - END
242 #endif
this file contains all the compiler specific defines
Definition: mainpage.dox:28