SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
platform.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <cinttypes>
11 #include <ciso646> // makes _LIBCPP_VERSION available
12 #include <cstddef> // makes __GLIBCXX__ available
13 
19 // macro cruft
21 #define STR_HELPER(x) #x
22 #define STR(x) STR_HELPER(x)
23 
25 // ============================================================================
26 // C++ standard and features
27 // ============================================================================
28 
29 // C++ standard [required]
30 #ifdef __cplusplus
31  static_assert(__cplusplus >= 201703, "SeqAn3 requires C++17, make sure that you have set -std=c++17.");
32 #else
33 # error "This is not a C++ compiler."
34 #endif
35 
36 #if __has_include(<version>)
37 # include <version>
38 #endif
39 
40 // C++ Concepts [required]
41 #ifdef __cpp_concepts
42 # if __cpp_concepts == 201507 // GCC and Concepts TS
43 # define SEQAN3_CONCEPT concept bool
44 # else
45  static_assert(__cpp_concepts >= 201507, "Your compiler supports Concepts, but the support is not recent enough.");
46 # define SEQAN3_CONCEPT concept
47 # endif
48 #else
49 # error "SeqAn3 requires C++ Concepts, either vie the TS (flag: -fconcepts) or via C++20 (flag: -std=c++2a / -std=c++20)."
50 #endif
51 
52 // filesystem [required]
53 #if !__has_include(<filesystem>)
54 # if !__has_include(<experimental/filesystem>)
55 # error SeqAn3 requires C++17 filesystem support, but it was not found.
56 # endif
57 #endif
58 
59 // ============================================================================
60 // Dependencies
61 // ============================================================================
62 
63 // SeqAn [required]
64 #if !__has_include(<seqan3/version.hpp>)
65 # error SeqAn3 include directory not set correctly. Forgot to add -I ${INSTALLDIR}/include to your CXXFLAGS?
66 #endif
67 
68 // Ranges [required]
69 #if __has_include(<range/v3/version.hpp>)
70 # define RANGE_V3_MINVERSION 1000
71 # define RANGE_V3_MAXVERSION 1099
72 // TODO the following doesn't actually show the current version, only its formula. How'd you do it?
73 # define MSG "Your version: " STR(RANGE_V3_VERSION) \
74  "; minimum version: " STR(RANGE_V3_MINVERSION) \
75  "; expected maximum version: " STR(RANGE_V3_MAXVERSION)
76 # include <range/v3/version.hpp>
77 # if RANGE_V3_VERSION < RANGE_V3_MINVERSION
78 # error Your range-v3 library is too old.
79 # pragma message(MSG)
80 # elif RANGE_V3_VERSION > RANGE_V3_MAXVERSION
81 # pragma GCC warning "Your range-v3 library is possibly too new. Some features might not work correctly."
82 # pragma message(MSG)
83 # endif
84 # undef MSG
85 #else
86 # error The range-v3 library was not included correctly. Forgot to add -I ${INSTALLDIR}/include to your CXXFLAGS?
87 #endif
88 
89 // SDSL [required]
90 #if __has_include(<sdsl/version.hpp>)
91 # include <sdsl/version.hpp>
92  static_assert(sdsl::sdsl_version_major == 3, "Only version 3 of the SDSL is supported by SeqAn3.");
93 #else
94 # error The sdsl library was not included correctly. Forgot to add -I ${INSTALLDIR}/include to your CXXFLAGS?
95 #endif
96 
97 // Cereal [optional]
102 #ifndef SEQAN3_WITH_CEREAL
103 # if __has_include(<cereal/cereal.hpp>)
104 # define SEQAN3_WITH_CEREAL 1
105 # else
106 # define SEQAN3_WITH_CEREAL 0
107 # endif
108 #elif SEQAN3_WITH_CEREAL != 0
109 # if ! __has_include(<cereal/cereal.hpp>)
110 # error Cereal was marked as required, but not found!
111 # endif
112 #endif
113 
114 #if !SEQAN3_WITH_CEREAL
115 
122 # define CEREAL_SERIALIZE_FUNCTION_NAME serialize
124 # define CEREAL_LOAD_FUNCTION_NAME load
126 # define CEREAL_SAVE_FUNCTION_NAME save
128 # define CEREAL_LOAD_MINIMAL_FUNCTION_NAME load_minimal
130 # define CEREAL_SAVE_MINIMAL_FUNCTION_NAME save_minimal
132 
135 #endif
136 
137 // Lemon [optional]
142 #ifndef SEQAN3_WITH_LEMON
143 # if __has_include(<lemon/config.h>)
144 # define SEQAN3_WITH_LEMON 1
145 # else
146 # define SEQAN3_WITH_LEMON 0
147 # endif
148 #elif SEQAN3_WITH_LEMON != 0
149 # if !__has_include(<lemon/config.h>)
150 # error Lemon was marked as required, but not found!
151 # endif
152 #endif
153 #if SEQAN3_WITH_LEMON == 1
154 # define LEMON_HAVE_LONG_LONG 1
155 # define LEMON_CXX11 1
156 # if defined(__unix__) || defined(__APPLE__)
157 # define LEMON_USE_PTHREAD 1
158 # define LEMON_USE_WIN32_THREADS 0
159 # define LEMON_WIN32 0
160 # else
161 # define LEMON_USE_PTHREAD 0
162 # define LEMON_USE_WIN32_THREADS 1
163 # define LEMON_WIN32 1
164 # endif
165 #endif
166 
167 // TODO (doesn't have a version.hpp, yet)
168 
169 // ============================================================================
170 // Documentation
171 // ============================================================================
172 
173 // Doxygen related
174 // this macro is a NO-OP unless doxygen parses it, in which case it resolves to the argument
175 #ifndef SEQAN3_DOXYGEN_ONLY
176 # define SEQAN3_DOXYGEN_ONLY(x)
177 #endif
178 
179 // ============================================================================
180 // Deprecation Messages
181 // ============================================================================
182 
184 #if !defined(SEQAN3_DEPRECATED_310)
185 # define SEQAN3_DEPRECATED_310 [[deprecated("This will be removed in SeqAn-3.1.0; please see the documentation.")]]
186 #endif
187 
188 // ============================================================================
189 // Workarounds
190 // ============================================================================
191 
192 #ifndef SEQAN3_WORKAROUND_VIEW_PERFORMANCE
193 # define SEQAN3_WORKAROUND_VIEW_PERFORMANCE 1
195 #endif
196 
198 #ifndef SEQAN3_WORKAROUND_GCC_87113
199 # if defined(__GNUC_MINOR__) && ((__GNUC__ == 7) || ((__GNUC__ == 8) && (__GNUC_MINOR__ < 3)))
200 # define SEQAN3_WORKAROUND_GCC_87113 1
201 # else
202 # define SEQAN3_WORKAROUND_GCC_87113 0
203 # endif
204 #endif
205 
207 #ifndef SEQAN3_WORKAROUND_GCC_90897
208 # if defined(__GNUC__) && (__GNUC__ == 8)
209 # define SEQAN3_WORKAROUND_GCC_90897 1
210 # else
211 # define SEQAN3_WORKAROUND_GCC_90897 0
212 # endif
213 #endif
214 
216 #ifndef SEQAN3_WORKAROUND_GCC7_AND_8_CONCEPT_ISSUES
217 # if defined(__GNUC__) && ((__GNUC__ == 7) || (__GNUC__ == 8))
218 # define SEQAN3_WORKAROUND_GCC7_AND_8_CONCEPT_ISSUES 1
219 # else
220 # define SEQAN3_WORKAROUND_GCC7_AND_8_CONCEPT_ISSUES 0
221 # endif
222 #endif
223 
224 // ============================================================================
225 // Backmatter
226 // ============================================================================
227 
228 // macro cruft undefine
229 #undef STR
230 #undef STR_HELPER
cinttypes
cstddef
ciso646
version