CbmRoot
Loading...
Searching...
No Matches
BuildInfo.h
Go to the documentation of this file.
1/* Copyright (C) 2022 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Felix Weiglhofer [committer]*/
4#ifndef CBM_ALGO_BUILD_INFO_H
5#define CBM_ALGO_BUILD_INFO_H
6
7#include <string>
8
9#define MAKE_GCC_VERSION(major, minor, patch) ((major) *10000 + (minor) *100 + (patch))
10#define GCC_VERSION MAKE_GCC_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
11
12#if __has_include(<execution>) && !defined(__CLING__)
13#include <execution> // for feature test macro __cpp_lib_parallel_algorithm
14#endif
15
16#if defined(HAVE_TBB) && defined(__cpp_lib_parallel_algorithm)
17#define HAVE_PARALLEL_STL_LIBTBB
18#endif
19
20// PoolSTL triggers an internal error in GCC 10, so only enable it for GCC 11 and later
21#if GCC_VERSION >= MAKE_GCC_VERSION(11, 0, 0)
22#define HAVE_PARALLEL_STL_POOLSTL
23#endif
24
25#if __has_include(<omp.h>)
26#define HAVE_OMP
27#endif
28
29// Ensure we have the boost compression header AND flesnet is compiled with compression enabled
30#if __has_include(<boost/iostreams/filter/zstd.hpp>) && defined(BOOST_IOS_HAS_ZSTD)
31#define HAVE_ZSTD
32#endif
33
35{
36
37 extern const std::string GIT_HASH;
38 extern const std::string BUILD_TYPE;
39 extern const bool GPU_DEBUG;
40
41 inline constexpr bool WITH_TBB =
42#ifdef HAVE_TBB
43 true;
44#else
45 false;
46#endif
47
48 inline constexpr bool WITH_PARALLEL_STL =
49#ifdef HAVE_PARALLEL_STL_LIBTBB
50 true;
51#else
52 false;
53#endif
54
55 inline constexpr bool WITH_OMP =
56#ifdef HAVE_OMP
57 true;
58#else
59 false;
60#endif
61
62 inline constexpr bool WITH_ZSTD =
63#ifdef HAVE_ZSTD
64 true;
65#else
66 false;
67#endif
68
69} // namespace cbm::algo::BuildInfo
70
71#endif // CBM_ALGO_BUILD_INFO_H
const std::string GIT_HASH
constexpr bool WITH_PARALLEL_STL
Definition BuildInfo.h:48
constexpr bool WITH_OMP
Definition BuildInfo.h:55
constexpr bool WITH_TBB
Definition BuildInfo.h:41
constexpr bool WITH_ZSTD
Definition BuildInfo.h:62
const std::string BUILD_TYPE