MFEM  v4.4.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
config.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 
13 // Support out-of-source builds: if MFEM_CONFIG_FILE is defined, include it.
14 //
15 // Otherwise, use the local file: _config.hpp.
16 
17 #ifndef MFEM_CONFIG_HPP
18 #define MFEM_CONFIG_HPP
19 
20 #ifdef MFEM_CONFIG_FILE
21 #include MFEM_CONFIG_FILE
22 #else
23 #include "_config.hpp"
24 #endif
25 
26 // Common configuration macros
27 
28 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) || defined(__clang__)
29 #define MFEM_HAVE_GCC_PRAGMA_DIAGNOSTIC
30 #endif
31 
32 // Windows specific options
33 #ifdef _WIN32
34 // Macro needed to get defines like M_PI from <cmath>. (Visual Studio C++ only?)
35 #define _USE_MATH_DEFINES
36 #endif
37 // On Cygwin the option -std=c++11 prevents the definition of M_PI. Defining
38 // the following macro allows us to get M_PI and some needed functions, e.g.
39 // posix_memalign(), strdup(), strerror_r().
40 #ifdef __CYGWIN__
41 #define _XOPEN_SOURCE 600
42 #endif
43 
44 // Check dependencies:
45 
46 // Options that require MPI
47 #ifndef MFEM_USE_MPI
48 #ifdef MFEM_USE_SUPERLU
49 #error Building with SuperLU_DIST (MFEM_USE_SUPERLU=YES) requires MPI (MFEM_USE_MPI=YES)
50 #endif
51 #ifdef MFEM_USE_MUMPS
52 #error Building with MUMPS (MFEM_USE_MUMPS=YES) requires MPI (MFEM_USE_MPI=YES)
53 #endif
54 #ifdef MFEM_USE_STRUMPACK
55 #error Building with STRUMPACK (MFEM_USE_STRUMPACK=YES) requires MPI (MFEM_USE_MPI=YES)
56 #endif
57 #ifdef MFEM_USE_MKL_CPARDISO
58 #error Building with MKL CPARDISO (MFEM_USE_MKL_CPARDISO=YES) requires MPI (MFEM_USE_MPI=YES)
59 #endif
60 #ifdef MFEM_USE_PETSC
61 #error Building with PETSc (MFEM_USE_PETSC=YES) requires MPI (MFEM_USE_MPI=YES)
62 #endif
63 #ifdef MFEM_USE_SLEPC
64 #error Building with SLEPc (MFEM_USE_SLEPC=YES) requires MPI (MFEM_USE_MPI=YES)
65 #endif
66 #ifdef MFEM_USE_PUMI
67 #error Building with PUMI (MFEM_USE_PUMI=YES) requires MPI (MFEM_USE_MPI=YES)
68 #endif
69 #endif // MFEM_USE_MPI not defined
70 
71 #endif // MFEM_CONFIG_HPP