MFEM  v4.5.1
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 #ifndef _USE_MATH_DEFINES
35 // Macro needed to get defines like M_PI from <cmath>. (Visual Studio C++ only?)
36 #define _USE_MATH_DEFINES
37 #endif
38 #endif
39 // On Cygwin the option -std=c++11 prevents the definition of M_PI. Defining
40 // the following macro allows us to get M_PI and some needed functions, e.g.
41 // posix_memalign(), strdup(), strerror_r().
42 #ifdef __CYGWIN__
43 #define _XOPEN_SOURCE 600
44 #endif
45 
46 // Check dependencies:
47 
48 // Options that require MPI
49 #ifndef MFEM_USE_MPI
50 #ifdef MFEM_USE_SUPERLU
51 #error Building with SuperLU_DIST (MFEM_USE_SUPERLU=YES) requires MPI (MFEM_USE_MPI=YES)
52 #endif
53 #ifdef MFEM_USE_MUMPS
54 #error Building with MUMPS (MFEM_USE_MUMPS=YES) requires MPI (MFEM_USE_MPI=YES)
55 #endif
56 #ifdef MFEM_USE_STRUMPACK
57 #error Building with STRUMPACK (MFEM_USE_STRUMPACK=YES) requires MPI (MFEM_USE_MPI=YES)
58 #endif
59 #ifdef MFEM_USE_MKL_CPARDISO
60 #error Building with MKL CPARDISO (MFEM_USE_MKL_CPARDISO=YES) requires MPI (MFEM_USE_MPI=YES)
61 #endif
62 #ifdef MFEM_USE_PETSC
63 #error Building with PETSc (MFEM_USE_PETSC=YES) requires MPI (MFEM_USE_MPI=YES)
64 #endif
65 #ifdef MFEM_USE_SLEPC
66 #error Building with SLEPc (MFEM_USE_SLEPC=YES) requires MPI (MFEM_USE_MPI=YES)
67 #endif
68 #ifdef MFEM_USE_PUMI
69 #error Building with PUMI (MFEM_USE_PUMI=YES) requires MPI (MFEM_USE_MPI=YES)
70 #endif
71 #endif // MFEM_USE_MPI not defined
72 
73 #endif // MFEM_CONFIG_HPP