Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-27 08:47:18

0001 // Licensed to the Apache Software Foundation (ASF) under one
0002 // or more contributor license agreements.  See the NOTICE file
0003 // distributed with this work for additional information
0004 // regarding copyright ownership.  The ASF licenses this file
0005 // to you under the Apache License, Version 2.0 (the
0006 // "License"); you may not use this file except in compliance
0007 // with the License.  You may obtain a copy of the License at
0008 //
0009 //   http://www.apache.org/licenses/LICENSE-2.0
0010 //
0011 // Unless required by applicable law or agreed to in writing,
0012 // software distributed under the License is distributed on an
0013 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0014 // KIND, either express or implied.  See the License for the
0015 // specific language governing permissions and limitations
0016 // under the License.
0017 
0018 #pragma once
0019 
0020 #include <optional>
0021 #include <string>
0022 
0023 #include "arrow/status.h"
0024 #include "arrow/util/config.h"  // IWYU pragma: export
0025 #include "arrow/util/visibility.h"
0026 
0027 namespace arrow {
0028 
0029 struct BuildInfo {
0030   /// The packed version number, e.g. 1002003 (decimal) for Arrow 1.2.3
0031   int version;
0032   /// The "major" version number, e.g. 1 for Arrow 1.2.3
0033   int version_major;
0034   /// The "minor" version number, e.g. 2 for Arrow 1.2.3
0035   int version_minor;
0036   /// The "patch" version number, e.g. 3 for Arrow 1.2.3
0037   int version_patch;
0038   /// The version string, e.g. "1.2.3"
0039   std::string version_string;
0040   std::string so_version;
0041   std::string full_so_version;
0042 
0043   /// The CMake compiler identifier, e.g. "GNU"
0044   std::string compiler_id;
0045   std::string compiler_version;
0046   std::string compiler_flags;
0047 
0048   /// The git changeset id, if available
0049   std::string git_id;
0050   /// The git changeset description, if available
0051   std::string git_description;
0052   std::string package_kind;
0053 
0054   /// The uppercase build type, e.g. "DEBUG" or "RELEASE"
0055   std::string build_type;
0056 };
0057 
0058 struct RuntimeInfo {
0059   /// The enabled SIMD level
0060   ///
0061   /// This can be less than `detected_simd_level` if the ARROW_USER_SIMD_LEVEL
0062   /// environment variable is set to another value.
0063   std::string simd_level;
0064 
0065   /// The SIMD level available on the OS and CPU
0066   std::string detected_simd_level;
0067 
0068   /// Whether using the OS-based timezone database
0069   /// This is set at compile-time.
0070   bool using_os_timezone_db;
0071 
0072   /// The path to the timezone database; by default None.
0073   std::optional<std::string> timezone_db_path;
0074 };
0075 
0076 /// \brief Get runtime build info.
0077 ///
0078 /// The returned values correspond to exact loaded version of the Arrow library,
0079 /// rather than the values frozen at application compile-time through the `ARROW_*`
0080 /// preprocessor definitions.
0081 ARROW_EXPORT
0082 const BuildInfo& GetBuildInfo();
0083 
0084 /// \brief Get runtime info.
0085 ///
0086 ARROW_EXPORT
0087 RuntimeInfo GetRuntimeInfo();
0088 
0089 struct GlobalOptions {
0090   /// Path to text timezone database. This is only configurable on Windows,
0091   /// which does not have a compatible OS timezone database.
0092   std::optional<std::string> timezone_db_path;
0093 };
0094 
0095 ARROW_EXPORT
0096 Status Initialize(const GlobalOptions& options) noexcept;
0097 
0098 }  // namespace arrow