vSMC
vSMC: Scalable Monte Carlo
config.h
Go to the documentation of this file.
1 //============================================================================
2 // vSMC/include/vsmc/internal/config.h
3 //----------------------------------------------------------------------------
4 // vSMC: Scalable Monte Carlo
5 //----------------------------------------------------------------------------
6 // Copyright (c) 2013-2016, Yan Zhou
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are met:
11 //
12 // Redistributions of source code must retain the above copyright notice,
13 // this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright notice,
16 // this list of conditions and the following disclaimer in the documentation
17 // and/or other materials provided with the distribution.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
20 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 // POSSIBILITY OF SUCH DAMAGE.
30 //============================================================================
31 
32 #ifndef VSMC_INTERNAL_CONFIG_H
33 #define VSMC_INTERNAL_CONFIG_H
34 
35 #include <vsmc/internal/compiler.h>
36 
37 #ifndef VSMC_NO_RUNTIME_ASSERT
38 #ifndef NDEBUG
39 #define VSMC_NO_RUNTIME_ASSERT 0
40 #else
41 #define VSMC_NO_RUNTIME_ASSERT 1
42 #endif
43 #endif
44 
45 #ifndef VSMC_NO_RUNTIME_WARNING
46 #ifndef NDEBUG
47 #define VSMC_NO_RUNTIME_WARNING 0
48 #else
49 #define VSMC_NO_RUNTIME_WARNING 1
50 #endif
51 #endif
52 
55 #ifndef VSMC_RUNTIME_ASSERT_AS_EXCEPTION
56 #define VSMC_RUNTIME_ASSERT_AS_EXCEPTION 0
57 #endif
58 
61 #ifndef VSMC_RUNTIME_WARNING_AS_EXCEPTION
62 #define VSMC_RUNTIME_WARNING_AS_EXCEPTION 0
63 #endif
64 
65 // POSIX
66 
67 #ifndef VSMC_OPENCL
68 #if defined(__APPLE__) || defined(__MACOSX)
69 #include <Availability.h>
70 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5
71 #ifndef VSMC_HAS_POSIX
72 #define VSMC_HAS_POSIX 1
73 #endif
74 #endif
75 #else // __APPLE__
76 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
77 #ifndef VSMC_HAS_POSIX
78 #define VSMC_HAS_POSIX 1
79 #endif
80 #endif // _POSIX_C_SOURCE >= 200112L
81 #if defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600
82 #ifndef VSMC_HAS_POSIX
83 #define VSMC_HAS_POSIX 1
84 #endif
85 #endif // _XOPEN_SOURCE >= 600
86 #endif // VSMC_MACOSX
87 #endif
88 
89 #ifndef VSMC_HAS_POSIX
90 #define VSMC_HAS_POSIX 0
91 #endif
92 
93 // Parallelization features
94 
95 #ifndef VSMC_HAS_OMP
96 #define VSMC_HAS_OMP 0
97 #endif
98 
99 #ifndef VSMC_HAS_TBB
100 #define VSMC_HAS_TBB 0
101 #endif
102 
103 #ifndef VSMC_USE_TBB
104 #define VSMC_USE_TBB VSMC_HAS_TBB
105 #endif
106 
107 #ifndef VSMC_HAS_TBB_MALLOC
108 #define VSMC_HAS_TBB_MALLOC VSMC_HAS_TBB
109 #endif
110 
111 // Optional libraries
112 
113 #ifndef VSMC_HAS_HDF5
114 #define VSMC_HAS_HDF5 0
115 #endif
116 
117 #ifndef VSMC_HAS_MKL
118 #define VSMC_HAS_MKL 0
119 #endif
120 
121 #ifndef VSMC_USE_MKL_CBLAS
122 #define VSMC_USE_MKL_CBLAS VSMC_HAS_MKL
123 #endif
124 
125 #ifndef VSMC_USE_MKL_LAPACKE
126 #define VSMC_USE_MKL_LAPACKE VSMC_HAS_MKL
127 #endif
128 
129 #ifndef VSMC_USE_MKL_VML
130 #define VSMC_USE_MKL_VML VSMC_HAS_MKL
131 #endif
132 
133 #ifndef VSMC_USE_MKL_VSL
134 #define VSMC_USE_MKL_VSL VSMC_HAS_MKL
135 #endif
136 
137 #endif // VSMC_INTERNAL_CONFIG_H