Skip to content

Commit 782c845

Browse files
dtrawinsmzeglaCopilot
authored
Gcc13 (#3538)
* enabling compilation with gcc13 Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: mzegla <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent c7f6cfe commit 782c845

File tree

10 files changed

+38
-28
lines changed

10 files changed

+38
-28
lines changed

.bazelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ build:linux --cxxopt=-fstack-clash-protection
102102
build:linux --cxxopt=-Wformat
103103
build:linux --cxxopt=-Wformat-security
104104
build:linux --cxxopt=-Werror=format-security
105-
106105
# TODO: Add equivalent windows flag
107106
build:linux --force_pic
108107

BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ cc_library(
5353
"@azure//:storage",
5454
"@cpprest//:sdk",
5555
"@boost//:boost",
56-
"@com_github_googleapis_google_cloud_cpp//google/cloud/storage:storage_client",],
56+
"@google_cloud_cpp//:storage",],
5757
"//:disable_cloud": []
5858
})
5959
+ select({

Dockerfile.ubuntu

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ ENV DEBIAN_FRONTEND=noninteractive
2727
ARG BASE_IMAGE
2828
RUN apt-get update && apt-get install --no-install-recommends -y \
2929
build-essential \
30-
gcc-9 \
31-
g++-9 \
3230
make \
3331
cmake \
3432
automake \
@@ -45,8 +43,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
4543
pkg-config \
4644
wget \
4745
zlib1g-dev && \
48-
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 && \
49-
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9 && \
5046
apt-get clean && \
5147
rm -rf /var/lib/apt/lists/*
5248

WORKSPACE

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -525,25 +525,33 @@ new_local_repository(
525525

526526
# Google Cloud SDK
527527
http_archive(
528-
name = "com_github_googleapis_google_cloud_cpp",
529-
sha256 = "a370bcf2913717c674a7250c4a310250448ffeb751b930be559a6f1887155f3b",
530-
strip_prefix = "google-cloud-cpp-0.21.0",
531-
url = "https://github.com/googleapis/google-cloud-cpp/archive/v0.21.0.tar.gz",
532-
repo_mapping = {"@com_github_curl_curl" : "@curl"}
528+
name = "google_cloud_cpp",
529+
sha256 = "629cbfcc5bd581d38277ba8fa94a5b6591af1e0f6af0dab6d1d9ed796bf48b61",
530+
strip_prefix = "google-cloud-cpp-2.39.0",
531+
url = "https://github.com/googleapis/google-cloud-cpp/archive/v2.39.0.tar.gz",
533532
)
534533

535-
load("@com_github_googleapis_google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
536-
google_cloud_cpp_deps()
534+
load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0")
537535

538-
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
539-
switched_rules_by_language(
540-
name = "com_google_googleapis_imports",
541-
cc = True, # C++ support is only "Partially implemented", roll our own.
542-
grpc = True,
543-
)
536+
gl_cpp_workspace0()
537+
538+
load("@google_cloud_cpp//bazel:workspace1.bzl", "gl_cpp_workspace1")
539+
540+
gl_cpp_workspace1()
541+
542+
load("@google_cloud_cpp//bazel:workspace2.bzl", "gl_cpp_workspace2")
543+
544+
gl_cpp_workspace2()
545+
546+
load("@google_cloud_cpp//bazel:workspace4.bzl", "gl_cpp_workspace4")
547+
548+
gl_cpp_workspace4()
549+
550+
load("@google_cloud_cpp//bazel:workspace5.bzl", "gl_cpp_workspace5")
551+
552+
gl_cpp_workspace5()
544553

545-
load("@com_github_googleapis_google_cloud_cpp_common//bazel:google_cloud_cpp_common_deps.bzl", "google_cloud_cpp_common_deps")
546-
google_cloud_cpp_common_deps()
554+
# grpc
547555

548556
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
549557
grpc_deps()

src/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ ovms_cc_library(
12151215
"gcsfilesystem.cpp",
12161216
],
12171217
deps = [
1218-
"@com_github_googleapis_google_cloud_cpp//google/cloud/storage:storage_client",
1218+
"@google_cloud_cpp//:storage",
12191219
"libovmsfilesystem",
12201220
"libovmslogging",
12211221
"libovmsstring_utils",

src/kfs_frontend/serialization.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ Status serializeTensorToTensorProto(
3131
::KFSResponse::InferOutputTensor& responseOutput,
3232
const std::shared_ptr<const TensorInfo>& servableOutput,
3333
ov::Tensor& tensor);
34+
Status serializeTensorToTensorProtoRaw(
35+
::KFSResponse::InferOutputTensor& responseOutput,
36+
std::string* rawOutputContents,
37+
const std::shared_ptr<const TensorInfo>& servableOutput,
38+
ov::Tensor& tensor);
3439

3540
template <typename T>
3641
Status serializePredictResponse(

src/metric_registry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include <memory>
1919
#include <string>
20-
20+
#include <stdexcept>
2121
#include <prometheus/registry.h>
2222

2323
namespace ovms {

src/model.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ const std::shared_ptr<ModelInstance> Model::getDefaultModelInstance() const {
117117
std::shared_ptr<ovms::ModelInstance> Model::modelInstanceFactory(const std::string& modelName, const model_version_t modelVersion, ov::Core& ieCore, MetricRegistry* registry, const MetricConfig* metricConfig) {
118118
if (isStateful()) {
119119
SPDLOG_DEBUG("Creating new stateful model instance - model name: {}; model version: {};", modelName, modelVersion);
120-
return std::move(std::static_pointer_cast<ModelInstance>(
121-
std::make_shared<StatefulModelInstance>(modelName, modelVersion, ieCore, registry, metricConfig, this->globalSequencesViewer)));
120+
return std::static_pointer_cast<ModelInstance>(
121+
std::make_shared<StatefulModelInstance>(modelName, modelVersion, ieCore, registry, metricConfig, this->globalSequencesViewer));
122122
} else {
123123
SPDLOG_DEBUG("Creating new model instance - model name: {}; model version: {};", modelName, modelVersion);
124-
return std::move(std::make_shared<ModelInstance>(modelName, modelVersion, ieCore, registry, metricConfig));
124+
return std::make_shared<ModelInstance>(modelName, modelVersion, ieCore, registry, metricConfig);
125125
}
126126
}
127127

src/python/python_executor_calculator.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ class PythonExecutorCalculator : public CalculatorBase {
231231

232232
std::vector<py::object> pyInputs;
233233
prepareInputs(cc, &pyInputs);
234-
py::object executeResult = std::move(nodeResources->ovmsPythonModel->attr("execute")(pyInputs));
235-
handleExecutionResult(cc, std::move(executeResult));
234+
py::object executeResult = nodeResources->ovmsPythonModel->attr("execute")(pyInputs);
235+
handleExecutionResult(cc, executeResult);
236236
}
237237
} catch (const UnexpectedOutputTensorError& e) {
238238
LOG(INFO) << "Error occurred during node " << cc->NodeName() << " execution: " << e.what();

src/stringutils.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <optional>
1919
#include <string>
2020
#include <vector>
21+
#include <cstdint>
22+
2123
namespace ovms {
2224

2325
std::string joins(const std::vector<std::string>& listOfStrings, const std::string delimiter);

0 commit comments

Comments
 (0)