diff options
Diffstat (limited to 'ports/tensorflow-common')
| -rw-r--r-- | ports/tensorflow-common/change-macros-for-static-lib.patch | 11 | ||||
| -rw-r--r-- | ports/tensorflow-common/fix-dbg-build-errors.patch | 111 | ||||
| -rw-r--r-- | ports/tensorflow-common/fix-linux-build.patch | 68 | ||||
| -rw-r--r-- | ports/tensorflow-common/fix-more-build-errors.patch | 11 | ||||
| -rw-r--r-- | ports/tensorflow-common/fix-windows-build.patch | 12 | ||||
| -rw-r--r-- | ports/tensorflow-common/portfile.cmake | 3 | ||||
| -rw-r--r-- | ports/tensorflow-common/tensorflow-common.cmake | 13 | ||||
| -rw-r--r-- | ports/tensorflow-common/vcpkg.json | 3 |
8 files changed, 35 insertions, 197 deletions
diff --git a/ports/tensorflow-common/change-macros-for-static-lib.patch b/ports/tensorflow-common/change-macros-for-static-lib.patch index b000d5f0e..daff655ce 100644 --- a/ports/tensorflow-common/change-macros-for-static-lib.patch +++ b/ports/tensorflow-common/change-macros-for-static-lib.patch @@ -23,7 +23,7 @@ diff --git a/tensorflow/core/platform/macros.h b/tensorflow/core/platform/macros diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h --- a/tensorflow/c/c_api.h +++ b/tensorflow/c/c_api.h -@@ -70,24 +70,7 @@ +@@ -71,24 +71,7 @@ // and the API just provides high level controls over the number of // devices of each type. @@ -81,7 +81,7 @@ diff --git a/tensorflow/c/c_api_experimental.h b/tensorflow/c/c_api_experimental diff --git a/tensorflow/c/c_api_macros.h b/tensorflow/c/c_api_macros.h --- a/tensorflow/c/c_api_macros.h +++ b/tensorflow/c/c_api_macros.h -@@ -16,18 +16,6 @@ +@@ -16,17 +16,5 @@ #ifndef TENSORFLOW_C_C_API_MACROS_H_ #define TENSORFLOW_C_C_API_MACROS_H_ @@ -99,14 +99,13 @@ diff --git a/tensorflow/c/c_api_macros.h b/tensorflow/c/c_api_macros.h -#endif // _WIN32 -#endif // SWIG - #endif // TENSORFLOW_C_C_API_MACROS_H_ diff --git a/tensorflow/c/kernels.h b/tensorflow/c/kernels.h --- a/tensorflow/c/kernels.h +++ b/tensorflow/c/kernels.h -@@ -21,24 +21,7 @@ - #include "tensorflow/c/tf_datatype.h" +@@ -23,24 +23,7 @@ #include "tensorflow/c/tf_status.h" + #include "tensorflow/c/tf_tensor.h" -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). @@ -210,7 +209,7 @@ diff --git a/tensorflow/c/tf_status.h b/tensorflow/c/tf_status.h diff --git a/tensorflow/c/tf_tensor.h b/tensorflow/c/tf_tensor.h --- a/tensorflow/c/tf_tensor.h +++ b/tensorflow/c/tf_tensor.h -@@ -22,24 +22,7 @@ +@@ -23,24 +23,7 @@ #include "tensorflow/c/tf_datatype.h" #include "tensorflow/c/tf_status.h" diff --git a/ports/tensorflow-common/fix-dbg-build-errors.patch b/ports/tensorflow-common/fix-dbg-build-errors.patch deleted file mode 100644 index 63e95dbb8..000000000 --- a/ports/tensorflow-common/fix-dbg-build-errors.patch +++ /dev/null @@ -1,111 +0,0 @@ -diff --git a/tensorflow/core/platform/path.cc b/tensorflow/core/platform/path.cc ---- a/tensorflow/core/platform/path.cc -+++ b/tensorflow/core/platform/path.cc -@@ -329,6 +329,7 @@ - } - LOG(FATAL) << "No temp directory found."; - #endif -+ std::abort(); - } - - bool GetTestUndeclaredOutputsDir(string* dir) { - -diff --git a/tensorflow/core/framework/device_base.cc b/tensorflow/core/framework/device_base.cc ---- a/tensorflow/core/framework/device_base.cc -+++ b/tensorflow/core/framework/device_base.cc -@@ -65,10 +65,12 @@ - - const DeviceAttributes& DeviceBase::attributes() const { - LOG(FATAL) << "Device does not implement attributes()"; -+ std::abort(); - } - - const string& DeviceBase::name() const { - LOG(FATAL) << "Device does not implement name()"; -+ std::abort(); - } - - void DeviceBase::set_eigen_cpu_device(Eigen::ThreadPoolDevice* d) { - -diff --git a/tensorflow/core/kernels/depthtospace_op.cc b/tensorflow/core/kernels/depthtospace_op.cc ---- a/tensorflow/core/kernels/depthtospace_op.cc -+++ b/tensorflow/core/kernels/depthtospace_op.cc -@@ -117,13 +117,13 @@ - // NCHW_VECT_C with 4 x qint8 can be treated as NCHW int32. - auto Tinput_v = input.template reinterpret_last_dimension<int32, 4>(); - auto Toutput_v = outputs_tensor->reinterpret_last_dimension<int32, 4>(); -- functor::DepthToSpaceOpFunctor<GPUDevice, int32, FORMAT_NCHW> functor; -- functor(context->eigen_device<GPUDevice>(), Tinput_v, block_size_, -+ functor::DepthToSpaceOpFunctor<Device, int32, FORMAT_NCHW> functor; -+ functor(context->eigen_device<Device>(), Tinput_v, block_size_, - Toutput_v); - return; - } else if (data_format_ == FORMAT_NCHW) { -- functor::DepthToSpaceOpFunctor<GPUDevice, T, FORMAT_NCHW> functor; -- functor(context->eigen_device<GPUDevice>(), Tinput, block_size_, -+ functor::DepthToSpaceOpFunctor<Device, T, FORMAT_NCHW> functor; -+ functor(context->eigen_device<Device>(), Tinput, block_size_, - Toutput); - return; - } -@@ -173,6 +173,15 @@ - } - } - }; -+#ifdef WIN32 -+template <typename T> -+struct DepthToSpaceOpFunctor<CPUDevice, T, FORMAT_NCHW> { -+ void operator()(const CPUDevice& d, typename TTypes<T, 4>::ConstTensor input, -+ int block_size, typename TTypes<T, 4>::Tensor output) { -+ LOG(FATAL) << "dummy implementation to make debug build compile"; -+ } -+}; -+#endif - } // namespace functor - - #define REGISTER(type) \ - -diff --git a/tensorflow/core/kernels/spacetodepth_op.cc b/tensorflow/core/kernels/spacetodepth_op.cc ---- a/tensorflow/core/kernels/spacetodepth_op.cc -+++ b/tensorflow/core/kernels/spacetodepth_op.cc -@@ -132,18 +132,18 @@ - // NCHW_VECT_C with 4 x qint8 can be treated as NCHW int32. - auto Tinput_v = input.template reinterpret_last_dimension<int32, 4>(); - auto Toutput_v = outputs_tensor->reinterpret_last_dimension<int32, 4>(); -- functor::SpaceToDepthOpFunctor<GPUDevice, int32, FORMAT_NCHW> functor; -- functor(context->eigen_device<GPUDevice>(), Tinput_v, block_size_, -+ functor::SpaceToDepthOpFunctor<Device, int32, FORMAT_NCHW> functor; -+ functor(context->eigen_device<Device>(), Tinput_v, block_size_, - Toutput_v); - } else if (data_format_ == FORMAT_NCHW) { - CHECK((std::is_same<T, RT>::value)); -- functor::SpaceToDepthOpFunctor<GPUDevice, RT, FORMAT_NCHW> functor; -- functor(context->eigen_device<GPUDevice>(), input.tensor<RT, 4>(), -+ functor::SpaceToDepthOpFunctor<Device, RT, FORMAT_NCHW> functor; -+ functor(context->eigen_device<Device>(), input.tensor<RT, 4>(), - block_size_, outputs_tensor->tensor<RT, 4>()); - } else { - CHECK((std::is_same<T, RT>::value)); -- functor::SpaceToDepthOpFunctor<GPUDevice, RT, FORMAT_NHWC> functor; -- functor(context->eigen_device<GPUDevice>(), input.tensor<RT, 4>(), -+ functor::SpaceToDepthOpFunctor<Device, RT, FORMAT_NHWC> functor; -+ functor(context->eigen_device<Device>(), input.tensor<RT, 4>(), - block_size_, outputs_tensor->tensor<RT, 4>()); - } - } else { -@@ -188,6 +188,15 @@ - } - } - }; -+#ifdef WIN32 -+template <typename T> -+struct SpaceToDepthOpFunctor<CPUDevice, T, FORMAT_NCHW> { -+ void operator()(const CPUDevice& d, typename TTypes<T, 4>::ConstTensor input, -+ int block_size, typename TTypes<T, 4>::Tensor output) { -+ LOG(FATAL) << "dummy implementation to make debug build compile"; -+ } -+}; -+#endif - } // namespace functor - - #define REGISTER(type) \ diff --git a/ports/tensorflow-common/fix-linux-build.patch b/ports/tensorflow-common/fix-linux-build.patch index 224f28fe3..e3eaca517 100644 --- a/ports/tensorflow-common/fix-linux-build.patch +++ b/ports/tensorflow-common/fix-linux-build.patch @@ -1,72 +1,20 @@ -diff --git a/third_party/aws/aws-checksums.bazel b/third_party/aws/aws-checksums.bazel ---- a/third_party/aws/aws-checksums.bazel -+++ b/third_party/aws/aws-checksums.bazel -@@ -7,6 +7,13 @@ - - exports_files(["LICENSE"]) - -+load("@bazel_skylib//lib:selects.bzl", "selects") -+ -+selects.config_setting_group( -+ name = "is_linux_debug", -+ match_all = ["@org_tensorflow//tensorflow:linux_x86_64", "@org_tensorflow//tensorflow:debug"], -+) -+ - cc_library( - name = "aws-checksums", - srcs = select({ -@@ -27,4 +34,10 @@ - deps = [ - "@aws-c-common", - ], -+ defines = select({ -+ ":is_linux_debug": [ -+ "DEBUG_BUILD" -+ ], -+ "//conditions:default": [], -+ }), - ) - -diff --git a/tensorflow/core/kernels/data/experimental/io_ops.cc b/tensorflow/core/kernels/data/experimental/io_ops.cc ---- a/tensorflow/core/kernels/data/experimental/io_ops.cc -+++ b/tensorflow/core/kernels/data/experimental/io_ops.cc -@@ -28,6 +28,12 @@ - namespace data { - namespace experimental { - -+/*static*/ constexpr const char* const LoadDatasetOp::kCompression; -+/*static*/ constexpr const char* const LoadDatasetOp::kReaderFunc; -+/*static*/ constexpr const char* const LoadDatasetOp::kReaderFuncTarguments; -+ -+/*static*/ constexpr const int SaveDatasetOp::kFileFormatVersion; -+ - SaveDatasetOp::SaveDatasetOp(OpKernelConstruction* ctx) - : HybridAsyncOpKernel(ctx, "tf_data_save_dataset") { - OP_REQUIRES_OK(ctx, ctx->GetAttr(kCompression, &compression_)); - diff --git a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc --- a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc +++ b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc -@@ -63,6 +63,14 @@ - namespace data { - namespace experimental { +@@ -72,6 +72,8 @@ + SnapshotDatasetV2Op::kReaderFuncTarguments; + /* static */ constexpr const char* const + SnapshotDatasetV2Op::kShardFuncTarguments; ++/* static */ constexpr const char* const SnapshotDatasetV2Op::kReaderPrefix; ++/* static */ constexpr const char* const SnapshotDatasetV2Op::kWriterPrefix; + /* static */ constexpr const int SnapshotDatasetV2Op::kFileFormatVersion; -+/*static*/ constexpr const char* const SnapshotDatasetV2Op::kCompression; -+/*static*/ constexpr const char* const SnapshotDatasetV2Op::kReaderFunc; -+/*static*/ constexpr const char* const SnapshotDatasetV2Op::kShardFunc; -+/*static*/ constexpr const char* const SnapshotDatasetV2Op::kReaderFuncTarguments; -+/*static*/ constexpr const char* const SnapshotDatasetV2Op::kShardFuncTarguments; -+ -+/*static*/ constexpr const int SnapshotDatasetV2Op::kFileFormatVersion; -+ // ==== Snapshot Implementation ==== - /* The current snapshot on-disk layout is as follows: - diff --git a/tensorflow/core/kernels/data/experimental/data_service_dataset_op.cc b/tensorflow/core/kernels/data/experimental/data_service_dataset_op.cc --- a/tensorflow/core/kernels/data/experimental/data_service_dataset_op.cc +++ b/tensorflow/core/kernels/data/experimental/data_service_dataset_op.cc -@@ -52,6 +52,8 @@ +@@ -53,6 +53,8 @@ /* static */ constexpr const char* const DataServiceDatasetOp::kMaxOutstandingRequests; /* static */ constexpr const char* const diff --git a/ports/tensorflow-common/fix-more-build-errors.patch b/ports/tensorflow-common/fix-more-build-errors.patch deleted file mode 100644 index c7d6a9b7f..000000000 --- a/ports/tensorflow-common/fix-more-build-errors.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/tensorflow/core/distributed_runtime/remote_device.cc b/tensorflow/core/distributed_runtime/remote_device.cc ---- a/tensorflow/core/distributed_runtime/remote_device.cc -+++ b/tensorflow/core/distributed_runtime/remote_device.cc -@@ -45,6 +45,7 @@ - ResourceMgr* resource_manager() override { - LOG(FATAL) << "Accessing the resource manager of a remote device is not " - << "supported."; -+ std::abort(); - } - - bool IsLocal() const override { return false; } diff --git a/ports/tensorflow-common/fix-windows-build.patch b/ports/tensorflow-common/fix-windows-build.patch new file mode 100644 index 000000000..89536836f --- /dev/null +++ b/ports/tensorflow-common/fix-windows-build.patch @@ -0,0 +1,12 @@ +diff --git a/core/platform/default/logging.h b/core/platform/default/logging.h +--- a/tensorflow/core/platform/default/logging.h ++++ b/tensorflow/core/platform/default/logging.h +@@ -13,6 +13,8 @@ + limitations under the License. + ==============================================================================*/ + ++#pragma warning(disable:4716) ++ + #ifndef TENSORFLOW_CORE_PLATFORM_DEFAULT_LOGGING_H_ + #define TENSORFLOW_CORE_PLATFORM_DEFAULT_LOGGING_H_ + diff --git a/ports/tensorflow-common/portfile.cmake b/ports/tensorflow-common/portfile.cmake index 5902d0502..7aacbbc20 100644 --- a/ports/tensorflow-common/portfile.cmake +++ b/ports/tensorflow-common/portfile.cmake @@ -5,9 +5,8 @@ set(TENSORFLOW_FILES "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_linux.py" "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_windows.py" "${CMAKE_CURRENT_LIST_DIR}/fix-build-error.patch" - "${CMAKE_CURRENT_LIST_DIR}/fix-dbg-build-errors.patch" "${CMAKE_CURRENT_LIST_DIR}/fix-linux-build.patch" - "${CMAKE_CURRENT_LIST_DIR}/fix-more-build-errors.patch" + "${CMAKE_CURRENT_LIST_DIR}/fix-windows-build.patch" "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_linux.py" "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_macos.py" "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_windows.py" diff --git a/ports/tensorflow-common/tensorflow-common.cmake b/ports/tensorflow-common/tensorflow-common.cmake index dd601ba9b..18011257e 100644 --- a/ports/tensorflow-common/tensorflow-common.cmake +++ b/ports/tensorflow-common/tensorflow-common.cmake @@ -1,5 +1,5 @@ -set(TF_VERSION 2.3.1) -set(TF_VERSION_SHORT 2.3) +set(TF_VERSION 2.4.1) +set(TF_VERSION_SHORT 2.4) vcpkg_find_acquire_program(BAZEL) get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) @@ -112,10 +112,14 @@ endif() foreach(BUILD_TYPE dbg rel) # prefer repeated source extraction here for each build type over extracting once above the loop and copying because users reported issues with copying symlinks set(STATIC_ONLY_PATCHES) + set(WINDOWS_ONLY_PATCHES) set(LINUX_ONLY_PATCHES) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(STATIC_ONLY_PATCHES "${CMAKE_CURRENT_LIST_DIR}/change-macros-for-static-lib.patch") # there is no static build option - change macros via patch and link library manually at the end endif() + if(VCPKG_TARGET_IS_WINDOWS) + set(WINDOWS_ONLY_PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-windows-build.patch") + endif() if(VCPKG_TARGET_IS_LINUX) set(LINUX_ONLY_PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-linux-build.patch") endif() @@ -123,13 +127,12 @@ foreach(BUILD_TYPE dbg rel) OUT_SOURCE_PATH SOURCE_PATH REPO tensorflow/tensorflow REF "v${TF_VERSION}" - SHA512 e497ef4564f50abf9f918be4522cf702f4cf945cb1ebf83af1386ac4ddc7373b3ba70c7f803f8ca06faf2c6b5396e60b1e0e9b97bfbd667e733b08b6e6d70ef0 + SHA512 be8273f464c1c1c392f3ab0190dbba36d56a0edcc7991c1a86f16604c859056d3188737d11c3b41ec7918e1cf46d13814c50c00be8f459dde9f0fb618740ee3c HEAD_REF master PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-build-error.patch" # Fix namespace error - "${CMAKE_CURRENT_LIST_DIR}/fix-dbg-build-errors.patch" # Fix no return statement - "${CMAKE_CURRENT_LIST_DIR}/fix-more-build-errors.patch" # Fix no return statement ${STATIC_ONLY_PATCHES} + ${WINDOWS_ONLY_PATCHES} ${LINUX_ONLY_PATCHES} ) diff --git a/ports/tensorflow-common/vcpkg.json b/ports/tensorflow-common/vcpkg.json index 5d6009d2f..7477461b3 100644 --- a/ports/tensorflow-common/vcpkg.json +++ b/ports/tensorflow-common/vcpkg.json @@ -1,7 +1,6 @@ { "name": "tensorflow-common", - "version-string": "2.3.1", - "port-version": 1, + "version-semver": "2.4.1", "description": "This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own.", "homepage": "https://github.com/tensorflow/tensorflow" } |
