Grid 0.7.0
CompilerCompatible.h
Go to the documentation of this file.
1#pragma once
2
3#if defined(__NVCC__)
4
5#if (__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ == 0)
6#error "NVCC version 11.0 breaks on Ampere, see Github issue 346"
7#endif
8#if (__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ == 1)
9#error "NVCC version 11.1 breaks on Ampere, see Github issue 346"
10#endif
11
12#endif
13
14#if defined(__clang__)
15
16 #if __clang_major__ < 3
17 #error "This clang++ version is known to not work with Grid due to compiler bugs"
18 #endif
19
20 #if __clang_major__ == 3
21 #if __clang_minor__ < 5
22 #error "This clang++ version is known to not work with Grid due to compiler bugs"
23 #endif
24 #endif
25
26// Intel compiler *ALSO* has __GNUC__ defined so must if/else GCC checks
27#elif defined(__INTEL_COMPILER)
28
29 #if __INTEL_COMPILER < 1603
30 #error "This icpc version is known to not work with Grid due to compiler bugs"
31 #endif
32
33#else
34
35// This macro is annoying many other compilers just define __GNUC__ and claim GCC compat
36// but this defeats the use of __GNUC__ to really detect G++
37 #if defined(__GNUC__)
38
39 #if __GNUC__ < 4
40 #error "g++ prior to version 4 is known to not work with Grid due to compiler bugs"
41 #endif
42
43 #if __GNUC__ == 4
44 #if __GNUC_MINOR__ != 9
45 #error "g++ 4.9 is the only gcc-4.x version known to work with Grid due to compiler bugs"
46 #endif
47 #endif
48
49 #if __GNUC__ == 5
50 #warning "g++ version 5 is known to not work with Grid due to compiler bugs under -O3 : ensure you run make check"
51 #endif
52
53 #if __GNUC__ == 6
54 #if __GNUC_MINOR__ < 3
55 #warning "This g++6.3 is the first recent g++ version known to work with Grid: ensure you run make check"
56 #endif
57 #endif
58
59 #else
60
61 #warning "Unknown compiler detected: cannot guarantee compatability since Grid tends to break compilers"
62 #warning "Ensure to run : make check"
63
64 #endif
65
66#endif
67