Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
init.cc
Go to the documentation of this file.
1// Copyright 2010-2025 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14#include "ortools/init/init.h"
15
16#include <string>
17
18#include "absl/base/log_severity.h"
19#include "absl/flags/flag.h"
20#include "absl/log/globals.h"
21#include "absl/strings/string_view.h"
26
27namespace operations_research {
28void CppBridge::InitLogging(absl::string_view usage) {
30}
31
32void CppBridge::SetFlags(const CppFlags& flags) {
33 absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
34 absl::EnableLogPrefix(flags.log_prefix);
35 if (!flags.cp_model_dump_prefix.empty()) {
36 absl::SetFlag(&FLAGS_cp_model_dump_prefix, flags.cp_model_dump_prefix);
37 }
38 absl::SetFlag(&FLAGS_cp_model_dump_models, flags.cp_model_dump_models);
39 absl::SetFlag(&FLAGS_cp_model_dump_submodels, flags.cp_model_dump_submodels);
40 absl::SetFlag(&FLAGS_cp_model_dump_response, flags.cp_model_dump_response);
41}
42
43bool CppBridge::LoadGurobiSharedLibrary(absl::string_view full_library_path) {
44 return LoadGurobiDynamicLibrary({full_library_path}).ok();
45}
46
47} // namespace operations_research
static void InitLogging(absl::string_view usage)
Definition init.cc:28
static void SetFlags(const CppFlags &flags)
Definition init.cc:32
static bool LoadGurobiSharedLibrary(absl::string_view full_library_path)
Definition init.cc:43
void InitGoogleLogging(absl::string_view usage)
Definition init_google.h:26
In SWIG mode, we don't want anything besides these top-level includes.
absl::Status LoadGurobiDynamicLibrary(std::vector< absl::string_view > potential_paths)
bool log_prefix
Controls if time and source code info are used to prefix logging messages.
Definition init.h:45
std::string cp_model_dump_prefix
Definition init.h:50