Debian Codegraph @

include/deal.II/base/config.h.in

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2012 - 2025 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // Part of the source code is dual licensed under Apache-2.0 WITH
9 // LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10 // governing the source code and code contributions can be found in
11 // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12 //
13 // ------------------------------------------------------------------------
14
15 #ifndef dealii_config_h
16 #define dealii_config_h
17
18 /***********************************************************************
19 * Some deal.II macros depends on Kokkos macros:
20 */
21 #include <Kokkos_Macros.hpp>
22
23 /***********************************************************************
24 * Information about deal.II:
25 */
26
27 #define DEAL_II_PACKAGE_NAME "@DEAL_II_PACKAGE_NAME@"
28
29 #define DEAL_II_PACKAGE_VERSION "@DEAL_II_PACKAGE_VERSION@"
30
31 #define DEAL_II_VERSION_MAJOR @DEAL_II_VERSION_MAJOR@
32 #define DEAL_II_VERSION_MINOR @DEAL_II_VERSION_MINOR@
33 #define DEAL_II_VERSION_SUBMINOR @DEAL_II_VERSION_SUBMINOR@
34
35 /***********************************************************************
36 * Two macro names that we put at the top and bottom of all deal.II files
37 * and that will be expanded to "namespace dealii {" and "}".
38 */
39
40 #define DEAL_II_NAMESPACE_OPEN namespace dealii {
41 #define DEAL_II_NAMESPACE_CLOSE }
42
43 /***********************************************************************
44 * A variable that can be used to query whether we are compiling in
45 * debug or release mode.
46 */
47
48 DEAL_II_NAMESPACE_OPEN
49
50 /**
51 * An enum type that is used to describe what kind of build has
52 * been used to compile the deal.II library: Namely, whether it is
53 * a debug or a release build.
54 */
55 enum class LibraryBuildMode
56 {
57 debug,
58 release
59 };
60
61 /**
62 * A variable that can be queried to determine whether the deal.II
63 * library you are trying to compile against is a debug or a release
64 * mode build.
65 */
66 constexpr LibraryBuildMode library_build_mode
67 #ifdef DEBUG
68 = LibraryBuildMode::debug;
69 #else
70 = LibraryBuildMode::release;
71 #endif
72
73
74 /**
75 * A function that returns whether we are currently compiling for a debug
76 * build (rather than a release build).
77 */
78 constexpr bool running_in_debug_mode()
79 {
80 return (library_build_mode == LibraryBuildMode::debug);
81 }
82
83
84 DEAL_II_NAMESPACE_CLOSE
85
86
87 /***********************************************************************
88 * Configured deal.II features:
89 */
90
91 #cmakedefine DEAL_II_WITH_64BIT_INDICES
92 #cmakedefine DEAL_II_WITH_ADOLC
93 #cmakedefine DEAL_II_WITH_ARPACK
94 #cmakedefine DEAL_II_WITH_ARBORX
95 #cmakedefine DEAL_II_WITH_ASSIMP
96 #cmakedefine DEAL_II_FEATURE_BOOST_BUNDLED_CONFIGURED
97 #cmakedefine DEAL_II_WITH_CGAL
98 #cmakedefine DEAL_II_WITH_COMPLEX_VALUES
99 #cmakedefine DEAL_II_WITH_GINKGO
100 #cmakedefine DEAL_II_WITH_GMSH
101 #cmakedefine DEAL_II_WITH_GSL
102 #cmakedefine DEAL_II_WITH_HDF5
103 #cmakedefine DEAL_II_WITH_KOKKOS
104 #cmakedefine DEAL_II_FEATURE_KOKKOS_BUNDLED_CONFIGURED
105 #cmakedefine DEAL_II_WITH_LAPACK
106 #cmakedefine LAPACK_WITH_64BIT_BLAS_INDICES
107 #cmakedefine DEAL_II_LAPACK_WITH_MKL
108 #cmakedefine DEAL_II_WITH_MAGIC_ENUM
109 #cmakedefine DEAL_II_WITH_METIS
110 #cmakedefine DEAL_II_WITH_MPI
111 #cmakedefine DEAL_II_WITH_MUPARSER
112 #cmakedefine DEAL_II_WITH_MUMPS
113 #cmakedefine DEAL_II_FEATURE_MUPARSER_BUNDLED_CONFIGURED
114 #cmakedefine DEAL_II_WITH_OPENCASCADE
115 #cmakedefine DEAL_II_WITH_P4EST
116 #cmakedefine DEAL_II_WITH_PETSC
117 #cmakedefine DEAL_II_WITH_PSBLAS
118 #cmakedefine DEAL_II_WITH_SCALAPACK
119 #cmakedefine DEAL_II_WITH_SLEPC
120 #cmakedefine DEAL_II_WITH_SUNDIALS
121 #cmakedefine DEAL_II_WITH_SYMENGINE
122 #cmakedefine DEAL_II_WITH_TASKFLOW
123 #cmakedefine DEAL_II_FEATURE_TASKFLOW_BUNDLED_CONFIGURED
124 #cmakedefine DEAL_II_WITH_TBB
125 #cmakedefine DEAL_II_FEATURE_TBB_BUNDLED_CONFIGURED
126 #cmakedefine DEAL_II_WITH_TRILINOS
127 #cmakedefine DEAL_II_WITH_UMFPACK
128 #cmakedefine DEAL_II_FEATURE_UMFPACK_BUNDLED_CONFIGURED
129 #cmakedefine DEAL_II_USE_VECTORIZATION_GATHER
130 #cmakedefine DEAL_II_WITH_VTK
131 #cmakedefine DEAL_II_WITH_ZLIB
132
133 #ifdef DEAL_II_WITH_TBB
134 /**
135 * For backwards compatibility, continue defining DEAL_II_WITH_THREADS when the
136 * library is configured with TBB.
137 */
138 #define DEAL_II_WITH_THREADS
139
140 #define TBB_SUPPRESS_DEPRECATED_MESSAGES 1
141
142 #cmakedefine DEAL_II_TBB_WITH_ONEAPI
143
144 #endif
145
146 /***********************************************************************
147 * Compiler bugs:
148 *
149 * For documentation see cmake/checks/check_03_compiler_bugs.cmake
150 */
151
152 #cmakedefine DEAL_II_DELETED_MOVE_CONSTRUCTOR_BUG
153
154 /***********************************************************************
155 * Compiler features:
156 *
157 * For documentation see cmake/checks/check_01_compiler_features.cmake
158 */
159
160 #cmakedefine DEAL_II_COMPILER_USE_VECTOR_ARITHMETICS
161 #cmakedefine DEAL_II_VECTOR_ITERATOR_IS_POINTER
162 #cmakedefine DEAL_II_HAVE_BUILTIN_EXPECT
163 #cmakedefine DEAL_II_HAVE_GLIBC_STACKTRACE
164 #cmakedefine DEAL_II_HAVE_LIBSTDCXX_DEMANGLER
165 #cmakedefine __PRETTY_FUNCTION__ @__PRETTY_FUNCTION__@
166 #cmakedefine DEAL_II_ALWAYS_INLINE @DEAL_II_ALWAYS_INLINE@
167 #cmakedefine DEAL_II_RESTRICT @DEAL_II_RESTRICT@
168 #cmakedefine DEAL_II_COMPILER_HAS_DIAGNOSTIC_PRAGMA
169
170
171 #define DEAL_II_HOST_DEVICE KOKKOS_FUNCTION
172 #define DEAL_II_HOST_DEVICE_ALWAYS_INLINE KOKKOS_FORCEINLINE_FUNCTION
173
174 // clang++ assumes that all constexpr functions are __host__ __device__ when
175 // Kokkos was configured with CUDA or HIP support. This is problematic
176 // when calling non-constexpr functions in constexpr functions. Hence, we
177 // need a way to annotate functions explicitly as host-only.
178 #cmakedefine DEAL_II_KOKKOS_ENABLE_HIP
179 #if (defined(__clang__) && defined(__CUDA__)) || defined(DEAL_II_KOKKOS_ENABLE_HIP)
180 # define DEAL_II_HOST __host__
181 #else
182 # define DEAL_II_HOST
183 #endif
184
185
186 /***********************************************************************
187 * CPU features:
188 *
189 * For documentation see cmake/checks/check_01_cpu_features.cmake
190 */
191
192 #cmakedefine DEAL_II_WORDS_BIGENDIAN
193
194 /*
195 * This sets the largest number of vectorization bits detected for the given
196 * compiler flags and hardware (e.g. 256 for AVX on x86-64 architectures) for
197 * use in deal.II's intrinsics-based VectorizedArray class.
198 */
199 #define DEAL_II_VECTORIZATION_WIDTH_IN_BITS @DEAL_II_VECTORIZATION_WIDTH_IN_BITS@
200
201 /*
202 * Backward compatibility setting
203 */
204 #if DEAL_II_VECTORIZATION_WIDTH_IN_BITS == 512
205 #define DEAL_II_COMPILER_VECTORIZATION_LEVEL 3
206 #elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS == 256
207 #define DEAL_II_COMPILER_VECTORIZATION_LEVEL 2
208 #elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS == 128
209 #define DEAL_II_COMPILER_VECTORIZATION_LEVEL 1
210 #else
211 #define DEAL_II_COMPILER_VECTORIZATION_LEVEL 0
212 #endif
213
214 #define DEAL_II_OPENMP_SIMD_PRAGMA @DEAL_II_OPENMP_SIMD_PRAGMA@
215
216
217 /***********************************************************************
218 * Language features:
219 *
220 * For documentation see cmake/checks/check_01_cxx_features.cmake
221 */
222
223 #cmakedefine DEAL_II_HAVE_CXX14
224 #cmakedefine DEAL_II_HAVE_CXX17
225 #cmakedefine DEAL_II_HAVE_CXX20
226 #cmakedefine DEAL_II_HAVE_CXX23
227
228 #cmakedefine DEAL_II_HAVE_FP_EXCEPTIONS
229 #cmakedefine DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS
230 #cmakedefine DEAL_II_HAVE_CXX17_BESSEL_FUNCTIONS
231 #cmakedefine DEAL_II_CXX14_CONSTEXPR_BUG
232
233 // The following three are defined for backwards compatibility with older
234 // deal.II versions:
235 #define DEAL_II_WITH_CXX11
236 #define DEAL_II_WITH_CXX14
237 #define DEAL_II_WITH_CXX17
238
239 /**
240 * If we have C++20 available, we can have concepts and requires
241 * clauses. We want to avoid using too many `#ifdef` statements, so
242 * define a convenience macro that allows us to write a 'requires'
243 * clause that is simply removed when not using C++20.
244 */
245 #if defined(DEAL_II_HAVE_CXX20) && !defined(DEAL_II_DOXYGEN_DO_NOT_PARSE_REQUIRES_CLAUSES)
246 # define DEAL_II_CXX20_REQUIRES(condition) requires(condition)
247 #else
248 # define DEAL_II_CXX20_REQUIRES(condition)
249 #endif
250
251 /**
252 * Provide support for the C++23 [[assume]] attribute. To mimic the
253 * attribute for older standards we rely on compiler intrinsics when
254 * available.
255 */
256 #ifdef DEAL_II_HAVE_CXX23
257 # define DEAL_II_CXX23_ASSUME(expr) [[assume(expr)]]
258 #else
259 # if defined(__clang__)
260 # define DEAL_II_CXX23_ASSUME(expr) __builtin_assume(static_cast<bool>(expr))
261 # elif defined(_MSC_VER) || defined(__ICC)
262 # define DEAL_II_CXX23_ASSUME(expr) __assume(expr);
263 # else
264 /* no way with GCC to express this without evaluating 'expr' */
265 # define DEAL_II_CXX23_ASSUME(expr) \
266 do \
267 { \
268 } \
269 while (false)
270 # endif
271 #endif
272
273 #cmakedefine DEAL_II_FALLTHROUGH @DEAL_II_FALLTHROUGH@
274 #cmakedefine DEAL_II_CONSTEXPR @DEAL_II_CONSTEXPR@
275
276
277
278 /***********************************************************************
279 * Dealing with deprecations.
280 */
281
282 /**
283 * Macro indicating that the current feature will be removed in a future
284 * release.
285 */
286 #define DEAL_II_DEPRECATED [[deprecated]]
287 #define DEAL_II_DEPRECATED_WITH_COMMENT(comment) [[deprecated(comment)]]
288
289 /**
290 * Same as above, but for things that have been deprecated during the current
291 * development cycle. By default, no warnings are printed for a feature
292 * deprecated prior to a release until <em>after</em> that release has been
293 * finalized - see DEAL_II_EARLY_DEPRECATIONS for more information.
294 */
295 #cmakedefine DEAL_II_EARLY_DEPRECATIONS
296 #ifndef DEAL_II_DEPRECATED_EARLY
297 // guard to allow user to override DEAL_II_DEPRECATED_EARLY
298 #ifdef DEAL_II_EARLY_DEPRECATIONS
299 #define DEAL_II_DEPRECATED_EARLY [[deprecated]]
300 #else
301 #define DEAL_II_DEPRECATED_EARLY
302 #endif
303 #endif
304
305 #ifndef DEAL_II_DEPRECATED_EARLY_WITH_COMMENT
306 // guard to allow user to override DEAL_II_DEPRECATED_EARLY
307 #ifdef DEAL_II_EARLY_DEPRECATIONS
308 #define DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(comment) [[deprecated(comment)]]
309 #else
310 #define DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(comment)
311 #endif
312 #endif
313
314
315 /***********************************************************************
316 * System features:
317 *
318 * For documentation see cmake/checks/check_02_system_features.cmake
319 */
320
321 #cmakedefine DEAL_II_HAVE_SYS_RESOURCE_H
322 #cmakedefine DEAL_II_HAVE_UNISTD_H
323 #cmakedefine DEAL_II_HAVE_GETHOSTNAME
324 #cmakedefine DEAL_II_HAVE_GETPID
325 #cmakedefine DEAL_II_HAVE_JN
326
327 #cmakedefine DEAL_II_MSVC
328
329
330 /***********************************************************************
331 * Feature configuration
332 *
333 * For documentation see cmake/configure/configure_*.cmake and
334 * cmake/modules/Find*.cmake
335 */
336
337 /* cmake/modules/FindADOLC.cmake */
338 #cmakedefine DEAL_II_ADOLC_WITH_ATRIG_ERF
339 #cmakedefine DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING
340 #cmakedefine DEAL_II_ADOLC_WITH_TAPELESS_REFCOUNTING
341
342 /* cmake/modules/FindARBORX.cmake */
343 #cmakedefine DEAL_II_ARBORX_WITH_MPI
344
345 /* cmake/modules/FindARPACK.cmake */
346 #cmakedefine DEAL_II_ARPACK_WITH_PARPACK
347
348 /* cmake/modules/FindGMSH.cmake */
349 #cmakedefine DEAL_II_GMSH_WITH_API
350
351 /* cmake/modules/FindPETSC.cmake */
352 #cmakedefine DEAL_II_PETSC_WITH_COMPLEX
353 #cmakedefine DEAL_II_PETSC_WITH_HYPRE
354 #cmakedefine DEAL_II_PETSC_WITH_MUMPS
355 #cmakedefine DEAL_II_PETSC_WITH_KOKKOS
356
357 /* cmake/modules/FindSUNDIALS.cmake */
358 #cmakedefine DEAL_II_SUNDIALS_WITH_IDAS
359
360 /* cmake/modules/FindSYMENGINE.cmake */
361 #cmakedefine DEAL_II_SYMENGINE_WITH_LLVM
362
363 /* cmake/configure/configure_20_boost.cmake */
364 #cmakedefine DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS
365
366 /* cmake/configure/configure_50_cgal.cmake */
367 #cmakedefine DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES
368
369 /* cmake/configure/configure_2_trilinos.cmake */
370 #cmakedefine DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD
371 #cmakedefine DEAL_II_TRILINOS_WITH_AMESOS2
372 #cmakedefine DEAL_II_TRILINOS_WITH_BELOS
373 #cmakedefine DEAL_II_TRILINOS_WITH_EPETRAEXT
374 #cmakedefine DEAL_II_TRILINOS_WITH_IFPACK2
375 #cmakedefine DEAL_II_TRILINOS_WITH_MUELU
376 #cmakedefine DEAL_II_TRILINOS_WITH_NOX
377 #cmakedefine DEAL_II_TRILINOS_WITH_ROL
378 #cmakedefine DEAL_II_TRILINOS_WITH_SACADO
379 #cmakedefine DEAL_II_TRILINOS_WITH_SEACAS
380 #cmakedefine DEAL_II_TRILINOS_WITH_TPETRA
381 #cmakedefine DEAL_II_TRILINOS_WITH_ZOLTAN
382
383 #if defined(DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS) || \
384 defined(DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES)
385 # ifndef BOOST_ALLOW_DEPRECATED_HEADERS
386 # define BOOST_ALLOW_DEPRECATED_HEADERS
387 # endif
388 #endif
389
390 /***********************************************************************
391 * Various macros for version number query and comparison:
392 *
393 * These macros are defined to make testing for specific versions within
394 * the deal.II main code as simple as possible.
395 */
396
397 /*
398 * deal.II:
399 */
400
401 /**
402 * Returns true if the used deal.II version is greater or equal than the
403 * version specified by the three arguments. The internal implementation
404 * assumes that the number of minor and subminor versions is not larger
405 * than 100.
406 */
407 #define DEAL_II_VERSION_GTE(major,minor,subminor) \
408 ((DEAL_II_VERSION_MAJOR * 10000 + \
409 DEAL_II_VERSION_MINOR * 100 + \
410 DEAL_II_VERSION_SUBMINOR) \
411 >= \
412 (major)*10000 + (minor)*100 + (subminor))
413
414 /*
415 * boost:
416 */
417 #define DEAL_II_BOOST_VERSION_MAJOR @BOOST_VERSION_MAJOR@
418 #define DEAL_II_BOOST_VERSION_MINOR @BOOST_VERSION_MINOR@
419 #define DEAL_II_BOOST_VERSION_SUBMINOR @BOOST_VERSION_SUBMINOR@
420
421 #define DEAL_II_BOOST_VERSION_GTE(major,minor,subminor) \
422 ((DEAL_II_BOOST_VERSION_MAJOR * 100000 + \
423 DEAL_II_BOOST_VERSION_MINOR * 100 + \
424 DEAL_II_BOOST_VERSION_SUBMINOR) \
425 >= \
426 (major)*100000 + (minor)*100 + (subminor))
427
428 /*
429 * Gmsh:
430 */
431 #ifdef DEAL_II_WITH_GMSH
432 # define DEAL_II_GMSH_EXECUTABLE_PATH "@GMSH_EXECUTABLE@"
433 #endif
434
435
436 /**
437 * Kokkos:
438 */
439
440 #ifdef DEAL_II_WITH_KOKKOS
441 # define DEAL_II_KOKKOS_VERSION_MAJOR @KOKKOS_VERSION_MAJOR@
442 # define DEAL_II_KOKKOS_VERSION_MINOR @KOKKOS_VERSION_MINOR@
443 # define DEAL_II_KOKKOS_VERSION_SUBMINOR @KOKKOS_VERSION_SUBMINOR@
444
445 # define DEAL_II_KOKKOS_VERSION_GTE(major,minor,subminor) \
446 ((DEAL_II_KOKKOS_VERSION_MAJOR * 10000 + \
447 DEAL_II_KOKKOS_VERSION_MINOR * 100 + \
448 DEAL_II_KOKKOS_VERSION_SUBMINOR) \
449 >= \
450 (major)*10000 + (minor)*100 + (subminor))
451 #endif
452
453
454 /**
455 * OpenCASCADE:
456 */
457
458 #ifdef DEAL_II_WITH_OPENCASCADE
459 # define DEAL_II_OPENCASCADE_VERSION_MAJOR @OPENCASCADE_VERSION_MAJOR@
460 # define DEAL_II_OPENCASCADE_VERSION_MINOR @OPENCASCADE_VERSION_MINOR@
461 # define DEAL_II_OPENCASCADE_VERSION_SUBMINOR @OPENCASCADE_VERSION_SUBMINOR@
462
463 # define DEAL_II_OPENCASCADE_VERSION_GTE(major,minor,subminor) \
464 ((DEAL_II_OPENCASCADE_VERSION_MAJOR * 10000 + \
465 DEAL_II_OPENCASCADE_VERSION_MINOR * 100 + \
466 DEAL_II_OPENCASCADE_VERSION_SUBMINOR) \
467 >= \
468 (major)*10000 + (minor)*100 + (subminor))
469 #endif
470
471 /*
472 * p4est:
473 */
474
475 #ifdef DEAL_II_WITH_P4EST
476 # define DEAL_II_P4EST_VERSION_MAJOR @P4EST_VERSION_MAJOR@
477 # define DEAL_II_P4EST_VERSION_MINOR @P4EST_VERSION_MINOR@
478 # define DEAL_II_P4EST_VERSION_SUBMINOR @P4EST_VERSION_SUBMINOR@
479 # define DEAL_II_P4EST_VERSION_PATCH @P4EST_VERSION_PATCH@
480
481 # define DEAL_II_P4EST_VERSION_GTE(major,minor,subminor,patch) \
482 ((DEAL_II_P4EST_VERSION_MAJOR * 1000000 + \
483 DEAL_II_P4EST_VERSION_MINOR * 10000 + \
484 DEAL_II_P4EST_VERSION_SUBMINOR * 100 + \
485 DEAL_II_P4EST_VERSION_PATCH) \
486 >= \
487 (major)*1000000 + (minor)*10000 + (subminor)*100 + (patch))
488 #endif
489
490 /*
491 * SUNDIALS:
492 */
493
494 #ifdef DEAL_II_WITH_SUNDIALS
495 # define DEAL_II_SUNDIALS_VERSION_MAJOR @SUNDIALS_VERSION_MAJOR@
496 # define DEAL_II_SUNDIALS_VERSION_MINOR @SUNDIALS_VERSION_MINOR@
497 # define DEAL_II_SUNDIALS_VERSION_PATCH @SUNDIALS_VERSION_PATCH@
498
499 #define DEAL_II_SUNDIALS_VERSION_GTE(major,minor,patch) \
500 ((DEAL_II_SUNDIALS_VERSION_MAJOR * 10000 + \
501 DEAL_II_SUNDIALS_VERSION_MINOR * 100 + \
502 DEAL_II_SUNDIALS_VERSION_PATCH) \
503 >= \
504 (major)*10000 + (minor)*100 + (patch))
505
506 #define DEAL_II_SUNDIALS_VERSION_LT(major,minor,patch) \
507 ((DEAL_II_SUNDIALS_VERSION_MAJOR * 10000 + \
508 DEAL_II_SUNDIALS_VERSION_MINOR * 100 + \
509 DEAL_II_SUNDIALS_VERSION_PATCH) \
510 < \
511 (major)*10000 + (minor)*100 + (patch))
512 #endif
513
514 /*
515 * PETSc:
516 *
517 * Note: The following macros are defined in petscversion.h
518 * so we simply refer to the ones there.
519 */
520
521 #ifdef DEAL_II_WITH_PETSC
522 # include <petscversion.h>
523 # define DEAL_II_PETSC_VERSION_LT(major,minor,subminor) \
524 PETSC_VERSION_LT(major,minor,subminor)
525 # define DEAL_II_PETSC_VERSION_GTE(major,minor,subminor) \
526 PETSC_VERSION_GE(major,minor,subminor)
527 #endif
528
529 /*
530 * SLEPC:
531 */
532
533 #ifdef DEAL_II_WITH_SLEPC
534 # include <slepcversion.h>
535 # define DEAL_II_SLEPC_VERSION_LT(major,minor,subminor) \
536 SLEPC_VERSION_LT(major,minor,subminor)
537 # define DEAL_II_SLEPC_VERSION_GTE(major,minor,subminor) \
538 SLEPC_VERSION_GE(major,minor,subminor)
539 #endif
540
541 /*
542 * Trilinos:
543 */
544
545 #ifdef DEAL_II_WITH_TRILINOS
546 # define DEAL_II_TRILINOS_VERSION_MAJOR @TRILINOS_VERSION_MAJOR@
547 # define DEAL_II_TRILINOS_VERSION_MINOR @TRILINOS_VERSION_MINOR@
548 # define DEAL_II_TRILINOS_VERSION_SUBMINOR @TRILINOS_VERSION_SUBMINOR@
549
550 # define DEAL_II_TRILINOS_VERSION_GTE(major,minor,subminor) \
551 ((DEAL_II_TRILINOS_VERSION_MAJOR * 10000 + \
552 DEAL_II_TRILINOS_VERSION_MINOR * 100 + \
553 DEAL_II_TRILINOS_VERSION_SUBMINOR) \
554 >= \
555 (major)*10000 + (minor)*100 + (subminor))
556 #endif
557
558 /*
559 * CGAL:
560 */
561
562 #ifdef DEAL_II_WITH_CGAL
563 # define DEAL_II_CGAL_VERSION_MAJOR @CGAL_VERSION_MAJOR@
564 # define DEAL_II_CGAL_VERSION_MINOR @CGAL_VERSION_MINOR@
565 # define DEAL_II_CGAL_VERSION_SUBMINOR @CGAL_VERSION_SUBMINOR@
566
567 # define DEAL_II_CGAL_VERSION_GTE(major, minor, subminor) \
568 ((DEAL_II_CGAL_VERSION_MAJOR * 10000 + DEAL_II_CGAL_VERSION_MINOR * 100 + \
569 DEAL_II_CGAL_VERSION_SUBMINOR) >= \
570 (major)*10000 + (minor)*100 + (subminor))
571 #endif
572
573 /*
574 * MPI
575 */
576
577 #ifdef DEAL_II_WITH_MPI
578 # define DEAL_II_MPI_VERSION_MAJOR @MPI_VERSION_MAJOR@
579 # define DEAL_II_MPI_VERSION_MINOR @MPI_VERSION_MINOR@
580
581 # define DEAL_II_MPI_VERSION_GTE(major,minor) \
582 ((DEAL_II_MPI_VERSION_MAJOR * 100 + \
583 DEAL_II_MPI_VERSION_MINOR) \
584 >= \
585 (major)*100 + (minor))
586 #else
587 # define DEAL_II_MPI_VERSION_GTE(major,minor) false
588 #endif
589
590 #cmakedefine DEAL_II_MPI_WITH_DEVICE_SUPPORT
591
592 /***********************************************************************
593 * Two macros to guard external header includes.
594 *
595 * Selectively disable diagnostics set by "-Wextra" (and similar flags) for
596 * GCC and compiler accepting GCC dialects (such as clang).
597 * "diagnostic push" is supported since gcc-4.6 and clang-3.3.
598 */
599
600 #ifdef DEAL_II_COMPILER_HAS_DIAGNOSTIC_PRAGMA
601
602 /* keep pragmas with an exclamation mark in order.. */
603 # define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS \
604 _Pragma("GCC diagnostic push") /*!*/ \
605 _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") /*!*/ \
606 _Pragma("GCC diagnostic ignored \"-Wpragmas\"") /*!*/ \
607 _Pragma("GCC diagnostic ignored \"-Wunknown-warning-option\"") /*!*/ \
608 _Pragma("GCC diagnostic ignored \"-Wunknown-warning\"") /*!*/ \
609 _Pragma("GCC diagnostic ignored \"-Wextra\"") /*!*/ \
610 _Pragma("GCC diagnostic ignored \"-Waddress-of-packed-member\"") \
611 _Pragma("GCC diagnostic ignored \"-Wcast-function-type\"") \
612 _Pragma("GCC diagnostic ignored \"-Wcpp\"") \
613 _Pragma("GCC diagnostic ignored \"-Wdeprecated-copy\"") \
614 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
615 _Pragma("GCC diagnostic ignored \"-Wdeprecated-volatile\"") \
616 _Pragma("GCC diagnostic ignored \"-Wexpansion-to-defined\"") \
617 _Pragma("GCC diagnostic ignored \"-Wfloat-conversion\"") \
618 _Pragma("GCC diagnostic ignored \"-Wignored-attributes\"") \
619 _Pragma("GCC diagnostic ignored \"-Wignored-qualifiers\"") \
620 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") \
621 _Pragma("GCC diagnostic ignored \"-Winfinite-recursion\"") \
622 _Pragma("GCC diagnostic ignored \"-Wint-in-bool-context\"") \
623 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
624 _Pragma("GCC diagnostic ignored \"-Wmisleading-indentation\"") \
625 _Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
626 _Pragma("GCC diagnostic ignored \"-Wnested-anon-types\"") \
627 _Pragma("GCC diagnostic ignored \"-Wnon-template-friend\"") \
628 _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"") \
629 _Pragma("GCC diagnostic ignored \"-Wnonnull\"") \
630 _Pragma("GCC diagnostic ignored \"-Woverflow\"") \
631 _Pragma("GCC diagnostic ignored \"-Woverloaded-virtual\"") \
632 _Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
633 _Pragma("GCC diagnostic ignored \"-Wsuggest-override\"") \
634 _Pragma("GCC diagnostic ignored \"-Wtautological-constant-out-of-range-compare\"") \
635 _Pragma("GCC diagnostic ignored \"-Wtautological-overlap-compare\"") \
636 _Pragma("GCC diagnostic ignored \"-Wtype-limits\"") \
637 _Pragma("GCC diagnostic ignored \"-Wundef\"") \
638 _Pragma("GCC diagnostic ignored \"-Wunused-but-set-parameter\"") \
639 _Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"") \
640 _Pragma("GCC diagnostic ignored \"-Wunused-function\"") \
641 _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
642 _Pragma("GCC diagnostic ignored \"-Wunused-private-field\"") \
643 _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
644 _Pragma("GCC diagnostic ignored \"-Wuse-after-free\"") \
645 _Pragma("GCC diagnostic warning \"-Wpragmas\"") /*!*/
646
647 # define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS \
648 _Pragma("GCC diagnostic pop")
649
650 #else
651
652 # define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
653 # define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
654
655 #endif
656
657 /***********************************************************************
658 * Define macros for picking the correct C linkage name for a Fortran function.
659 * See cmake/configure/configure_fortran_mangling.cmake for more information.
660 */
661
662 #define DEAL_II_FORTRAN_MANGLE(name, NAME) @DEAL_II_FORTRAN_MANGLE@
663
664 #define DEAL_II_FORTRAN_MANGLE_UNDERSCORE(name, NAME) @DEAL_II_FORTRAN_MANGLE_UNDERSCORE@
665
666 /***********************************************************************
667 * Define a portable preprocessor macro that generates custom warnings
668 * reporting the line and the file where the warning appears. Taken from:
669 * http://goodliffe.blogspot.com/2009/07/c-how-to-say-warning-to-visual-studio-c.html
670 */
671
672 #ifdef _MSC_VER
673 #define DEAL_II_STRINGIZE_HELPER(x) #x
674 #define DEAL_II_STRINGIZE(x) DEAL_II_STRINGIZE_HELPER(x)
675 #define DEAL_II_DO_PRAGMA(x) __pragma(x)
676 #define DEAL_II_WARNING(desc) DEAL_II_DO_PRAGMA(message(__FILE__ "(" DEAL_II_STRINGIZE(__LINE__) ") : warning: " #desc))
677 #else
678 #define DEAL_II_DO_PRAGMA(x) _Pragma(#x)
679 #define DEAL_II_WARNING(desc) DEAL_II_DO_PRAGMA(message(#desc))
680 #endif
681
682
683 /***********************************************************************
684 * Final inclusions:
685 */
686
687 /*
688 * Include the boost version header to do a quick version check in case, by
689 * accident, we have configured with one version of boost but are compiling
690 * either the library or an external application with a different version of
691 * boost.
692 */
693 #include <boost/version.hpp>
694 static_assert(
695 BOOST_VERSION == 100000 * DEAL_II_BOOST_VERSION_MAJOR +
696 100 * DEAL_II_BOOST_VERSION_MINOR +
697 DEAL_II_BOOST_VERSION_SUBMINOR,
698 "The version number of boost that you are compiling with does not match the "
699 "version number of boost found during deal.II's configuration step. This "
700 "leads to difficult to understand bugs and is not supported. Please check "
701 "that you have set up your application with the same version of boost as "
702 "deal.II.");
703
704 #endif