Skip to content

Commit

Permalink
Bump protobuf version requirements in CMake. (#5312)
Browse files Browse the repository at this point in the history
* Bump protobuf version requirements in CMake.
* Bump protobuf version in conda.

---------
Signed-off-by: Michał Zientkiewicz <[email protected]>
  • Loading branch information
mzient authored Feb 7, 2024
1 parent be1c80c commit a0a3b7f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 32 deletions.
14 changes: 5 additions & 9 deletions cmake/Dependencies.aarch64-linux.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2019-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -78,14 +78,10 @@ set(Protobuf_USE_STATIC_LIBS YES)
# deliberatelly use protobuf instead of Protobuf to use protobuf provided cmake configuration file
# then use Protobuf to utilize our FindProtobuf.cmake to discover the rest
find_package(protobuf REQUIRED CONFIG)
find_package(Protobuf 2.0 REQUIRED)
if(${Protobuf_VERSION} VERSION_LESS "3.0")
message(STATUS "TensorFlow TFRecord file format support is not available with Protobuf 2")
else()
message(STATUS "Enabling TensorFlow TFRecord file format support")
add_definitions(-DDALI_BUILD_PROTO3=1)
set(BUILD_PROTO3 ON CACHE STRING "Build proto3")
endif()
find_package(Protobuf 3.6.1 REQUIRED)
message(STATUS "Enabling TensorFlow TFRecord file format support")
add_definitions(-DDALI_BUILD_PROTO3=1)
set(BUILD_PROTO3 ON CACHE STRING "Build proto3")

include_directories(SYSTEM ${Protobuf_INCLUDE_DIRS})
list(APPEND DALI_LIBS protobuf::libprotobuf)
Expand Down
14 changes: 5 additions & 9 deletions cmake/Dependencies.aarch64-qnx.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019, 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2019, 2021, 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -82,14 +82,10 @@ include(cmake/Dependencies.common.cmake)
##################################################################
set(Protobuf_CROSS YES)
set(Protobuf_USE_STATIC_LIBS YES)
find_package(Protobuf 2.0 REQUIRED)
if(${Protobuf_VERSION} VERSION_LESS "3.0")
message(STATUS "TensorFlow TFRecord file format support is not available with Protobuf 2")
else()
message(STATUS "Enabling TensorFlow TFRecord file format support")
add_definitions(-DDALI_BUILD_PROTO3=1)
set(BUILD_PROTO3 ON CACHE STRING "Build proto3")
endif()
find_package(Protobuf 3.6.1 REQUIRED)
message(STATUS "Enabling TensorFlow TFRecord file format support")
add_definitions(-DDALI_BUILD_PROTO3=1)
set(BUILD_PROTO3 ON CACHE STRING "Build proto3")

include_directories(SYSTEM ${Protobuf_INCLUDE_DIRS})
set(DALI_SYSTEM_LIBS "")
Expand Down
14 changes: 5 additions & 9 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017-2019, 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2017-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -118,14 +118,10 @@ if (BUILD_PROTOBUF)
# deliberatelly use protobuf instead of Protobuf to use protobuf provided cmake configuration file
# then use Protobuf to utilize our FindProtobuf.cmake to discover the rest
find_package(protobuf REQUIRED CONFIG)
find_package(Protobuf 2.0 REQUIRED)
if(${Protobuf_VERSION} VERSION_LESS "3.0")
message(STATUS "TensorFlow TFRecord file format support is not available with Protobuf 2")
else()
message(STATUS "Enabling TensorFlow TFRecord file format support")
add_definitions(-DDALI_BUILD_PROTO3=1)
set(BUILD_PROTO3 ON CACHE STRING "Build proto3")
endif()
find_package(Protobuf 3.6.1 REQUIRED)
message(STATUS "Enabling TensorFlow TFRecord file format support")
add_definitions(-DDALI_BUILD_PROTO3=1)
set(BUILD_PROTO3 ON CACHE STRING "Build proto3")

include_directories(SYSTEM ${Protobuf_INCLUDE_DIRS})
list(APPEND DALI_LIBS protobuf::libprotobuf)
Expand Down
6 changes: 3 additions & 3 deletions conda/dali_native_libs/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ requirements:
- python-clang
- git-lfs
host:
- protobuf
- libprotobuf-static
- protobuf >=3.6.1
- libprotobuf-static >=3.6.1
- libjpeg-turbo
- dali-opencv
- dali-ffmpeg
Expand All @@ -98,7 +98,7 @@ requirements:
# dependency to install the right version on the libabseil (as protobuf depends on
# libprotobuf-static and a newer version of libprotobuf-static may be available than
# the protobuf was build with)
- protobuf
- protobuf >=3.6.1
- openjpeg
- cfitsio
about:
Expand Down
4 changes: 2 additions & 2 deletions conda/dali_python_bindings/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ requirements:
host:
- dali-opencv
- dali-ffmpeg
- libprotobuf-static
- libprotobuf-static >=3.6.1
- python
- future
- protobuf
- protobuf >=3.6.1
- astunparse >=1.6.0
- gast >=0.3.3
- dm-tree >=0.1.8
Expand Down

0 comments on commit a0a3b7f

Please sign in to comment.