7#ifndef GMATTENSOR_VERSION_H
8#define GMATTENSOR_VERSION_H
32#ifndef GMATTENSOR_VERSION
33#define GMATTENSOR_VERSION "@PROJECT_VERSION@"
40inline std::string unquote(
const std::string& arg)
42 std::string ret = arg;
43 ret.erase(std::remove(ret.begin(), ret.end(),
'\"'), ret.end());
47inline std::string replace(std::string str,
const std::string& from,
const std::string& to)
50 while ((start_pos = str.find(from, start_pos)) != std::string::npos) {
51 str.replace(start_pos, from.length(), to);
52 start_pos += to.length();
83 std::vector<std::string> ret;
88#ifdef GMATELASTIC_VERSION
90 ret.push_back(
"gmatelastic=" + detail::unquote(std::string(QUOTE(GMATELASTIC_VERSION))));
94#ifdef GMATELASTOPLASTIC_VERSION
97 "gmatelastoplastic=" + detail::unquote(std::string(QUOTE(GMATELASTOPLASTIC_VERSION))));
101#ifdef GMATELASTOPLASTICQPOT_VERSION
104 "gmatelastoplasticqpot=" +
105 detail::unquote(std::string(QUOTE(GMATELASTOPLASTICQPOT_VERSION))));
109#ifdef GMATELASTOPLASTICQPOT3D_VERSION
112 "gmatelastoplasticqpot3d=" +
113 detail::unquote(std::string(QUOTE(GMATELASTOPLASTICQPOT3D_VERSION))));
117#ifdef GMATELASTOPLASTICFINITESTRAINSIMO_VERSION
120 "gmatelastoplasticfinitestrainsimo=" +
121 detail::unquote(std::string(QUOTE(GMATELASTOPLASTICFINITESTRAINSIMO_VERSION))));
125#ifdef GMATNONLINEARELASTIC_VERSION
128 "gmatnonlinearelastic=" +
129 detail::unquote(std::string(QUOTE(GMATNONLINEARELASTIC_VERSION))));
133#ifdef GOOSEFEM_VERSION
135 ret.push_back(
"goosefem=" + detail::unquote(std::string(QUOTE(GOOSEFEM_VERSION))));
139#ifdef GOOSEEYE_VERSION
141 ret.push_back(
"goosefem=" + detail::unquote(std::string(QUOTE(GOOSEEYE_VERSION))));
147 ret.push_back(
"qpot=" + detail::unquote(std::string(QUOTE(QPOT_VERSION))));
153 ret.push_back(
"prrng=" + detail::unquote(std::string(QUOTE(PRRNG_VERSION))));
157#ifdef FRICTIONQPOTSPRINGBLOCK_VERSION
160 "frictionqpotspringblock=" +
161 detail::unquote(std::string(QUOTE(FRICTIONQPOTSPRINGBLOCK_VERSION))));
165#ifdef FRICTIONQPOTFEM_VERSION
168 "frictionqpotfem=" + detail::unquote(std::string(QUOTE(FRICTIONQPOTFEM_VERSION))));
172#ifdef CPPPATH_VERSION
174 ret.push_back(
"cpppath=" + detail::unquote(std::string(QUOTE(CPPPATH_VERSION))));
178#ifdef CPPCOLORMAP_VERSION
180 ret.push_back(
"cppcolormap=" + detail::unquote(std::string(QUOTE(CPPCOLORMAP_VERSION))));
189 "boost=" + detail::unquote(std::to_string(BOOST_VERSION / 100000)) +
"." +
190 detail::unquote(std::to_string((BOOST_VERSION / 100) % 1000)) +
"." +
191 detail::unquote(std::to_string(BOOST_VERSION % 100)));
197#ifdef EIGEN_WORLD_VERSION
200 "eigen=" + detail::unquote(std::string(QUOTE(EIGEN_WORLD_VERSION))) +
"." +
201 detail::unquote(std::string(QUOTE(EIGEN_MAJOR_VERSION))) +
"." +
202 detail::unquote(std::string(QUOTE(EIGEN_MINOR_VERSION))));
208#ifdef XTENSOR_VERSION_MAJOR
210 "xtensor=" + detail::unquote(std::string(QUOTE(XTENSOR_VERSION_MAJOR))) +
"." +
211 detail::unquote(std::string(QUOTE(XTENSOR_VERSION_MINOR))) +
"." +
212 detail::unquote(std::string(QUOTE(XTENSOR_VERSION_PATCH))));
215#ifdef XSIMD_VERSION_MAJOR
217 "xsimd=" + detail::unquote(std::string(QUOTE(XSIMD_VERSION_MAJOR))) +
"." +
218 detail::unquote(std::string(QUOTE(XSIMD_VERSION_MINOR))) +
"." +
219 detail::unquote(std::string(QUOTE(XSIMD_VERSION_PATCH))));
222#ifdef XTL_VERSION_MAJOR
224 "xtl=" + detail::unquote(std::string(QUOTE(XTL_VERSION_MAJOR))) +
"." +
225 detail::unquote(std::string(QUOTE(XTL_VERSION_MINOR))) +
"." +
226 detail::unquote(std::string(QUOTE(XTL_VERSION_PATCH))));
229#if defined(XTENSOR_PYTHON_VERSION_MAJOR)
231 "xtensor-python=" + detail::unquote(std::string(QUOTE(XTENSOR_PYTHON_VERSION_MAJOR))) +
232 "." + detail::unquote(std::string(QUOTE(XTENSOR_PYTHON_VERSION_MINOR))) +
"." +
233 detail::unquote(std::string(QUOTE(XTENSOR_PYTHON_VERSION_PATCH))));
236 std::sort(ret.begin(), ret.end(), std::greater<std::string>());
247 std::vector<std::string> ret;
250 std::string date = detail::unquote(std::string(QUOTE(__DATE__)));
251 ret.push_back(
"date=" + detail::replace(detail::replace(date,
" ",
"-"),
"--",
"-"));
255 ret.push_back(
"platform=apple");
259 ret.push_back(
"platform=mingw");
263 ret.push_back(
"platform=linux");
266#ifdef __clang_version__
268 "clang=" + detail::unquote(std::string(QUOTE(__clang_major__))) +
"." +
269 detail::unquote(std::string(QUOTE(__clang_minor__))) +
"." +
270 detail::unquote(std::string(QUOTE(__clang_patchlevel__))));
275 "gcc=" + detail::unquote(std::string(QUOTE(__GNUC__))) +
"." +
276 detail::unquote(std::string(QUOTE(__GNUC_MINOR__))) +
"." +
277 detail::unquote(std::string(QUOTE(__GNUC_PATCHLEVEL__))));
281 ret.push_back(
"msvc=" + std::to_string(_MSC_VER));
287 ret.push_back(
"c++=" + detail::unquote(std::string(QUOTE(__cplusplus))));
290 std::sort(ret.begin(), ret.end(), std::greater<std::string>());
Macros used in the library.
Tensor products / operations.
std::string version()
Return version string, e.g.
std::vector< std::string > version_dependencies(bool greedy=true)
Return versions of this library and of all of its major dependencies.
std::vector< std::string > version_compiler()
Return information on the compiler, the platform, the C++ standard, and the compilation data.
#define GMATTENSOR_VERSION
Current version.