From a9ba425534cda2791059f201c5edce77b580a985 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler <44170764+jgehw@users.noreply.github.com> Date: Fri, 26 Mar 2021 22:55:50 +0100 Subject: [tensorflow] upgrade to 2.4.1 (#16364) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix build issues occurring from default bazel config being used because customized bazel config is stored in wrong directory * [tensorflow-cc] Update CONTROL and ci.baseline.txt * fix also applies to windows static build * fix debug and static builds as well as library naming for non-linux - add patch to fix debug builds - add patch to fix exports for static linking - really build debug (instead of cloning release) - override bazel build options for debug (work around bazel bug) - bazel doesn't support static libraries: work around by building dynamic library and constructing static linkage commands from build log - Windows .pdb file can't be >4GB even on x64: work around using reduced debug information - Windows doesn't support .lib files >4GB even on x64, so split into multiple libs - vcpkg requires equal amount of libs for debug and release: work around using handcrafted empty dummy libs - fix naming of libs (.dll on Windows and .dylib on macOS) * upgrade tensorflow from v1.14 to v2.3 - adapt patch files to tensorflow code changes - update bazel from v0.25.2 to v3.1 - on Windows use python installed on the host instead of embedded python obtained via vcpkg because embedded python lacks pip, which we need to obtain numpy - on Windows add MSYS2 to the PATH so that bazel tools can access MSYS2 GIT - add support for custom CA certificates when using HTTPS_PROXY * fix execute process macro The existing implementation totally screwed up commands if the command's arguments contained semicolons (this is the case, e.g., in the FindPython modules of the cmake distribution). * extend overriden execute_process to more than one COMMAND as there actually are use cases for this * added another patch required for tensorflow v2.3, fixed path and working directory * Revert "incorporate changes from microsoft:master" * Revert "Revert "incorporate changes from microsoft:master"" * final fixes for static build + improving out messages * enabling linux and osx in CI to see if it works now * simplified code, fixed version numbers, fixed generated include cmake file * fix failing postbuild check on handcrafted empty dummy library by spreading the last real libraries contents over the required number of libraries * remove dead code commit by mistake again * improvements from code review * cleaner fix for debug code * find pip3 in PATH (PYTHON3_DIR apparently not valid for pip3) * fix error in python helper script * fix wrong libname in postbuild script * fix python detection + switch to python on msys2 (instead of embedded python) for Windows as we need numpy * fix order of arguments * fix command (it may contain spaces such as C:\Program Files\...) * revert last commit (root cause for CI failures is something different: there are line breaks in path) * fix regex comparision (value needs to be escaped as it may contains regex special characters such as brackets, eg C:/Program Files (x86)/...) * fix linebreaks in generated file * fix CRT linkage (macOS doesn't support static CRT linkage; it's set to dynamic even static target triplets for macOS and linux) * refactor implemenation to avoid as much code duplication as possible -- algorithmically identical * fix version numbers in helper scripts * enable work-around for Windows until bazel fix is available * install missing python3-pip on linux * fix linux build by patching * apply timeout feature now available via merged master branch * correct linux build patch * improve debug build patches (no functional difference because LOG(FATAL, ...) macro internally anyway calls abort(), which the compiler doesn't detect in debug mode... * improve linux patch * temporarily add debug to inspect what's going on on macOS CI * remove temporary debug code and fix static linking scripts for linux and macOS * fix regex escaping * fix ambiguous match while grepping for the framework link command * extend fix of ambiguous match while grepping for the framework link command * fix what merge of master broke * fix more what got broken by merging master (all packages and their dependencies are now maintained manually instead of using pacman...) * remove "unofficial" from filename * added switch do distinct classic and manifest mode when generating config.cmake file * create symlinks for libraries without version number * fix linux postbuild script * temporarily disable code making problems * add note for linking on Linux and macOS * forget to add README file in previous commit * add file forgotton in macro fixing patch * fix python library path * fix macOS static link command * update linkage instructions in README * Update ports/tensorflow-cc/CONTROL * Update ports/tensorflow-cc/portfile.cmake * Update scripts/ci.baseline.txt * use vcpkg_execute_required_process * pass C_FLAGS and CXX_FLAGS to bazel * fix INTERFACE_INCLUDE_DIRECTORIES * fix optional c/cxx arguments * also add linker opts * update README * merge static libs into one to support force_load (cannot force_load both due to duplicate symbols) * update README * quote python path (it might contain spaces that don't get escaped inside outer quotes of bash command) * fix python path also for static build * add arm(64) as currently unsupported arch * bazel 3.7 is available -> remove workaround * update README, remove necessary c-ares from deps * update msys package * add uwp specific options, and minor general improvements * fix string replace * fix control file and windows path separator * revert backslashes-fix -- the root cause was missing .exe extension * upgrade to tf 2.3.1 * fix hard-coded version * remove uwp work-in-progress code so that PR can be merged * add [tensorflow] C API port * missing in previous commit * fix include file * remove unnecessary suffix * update README and print out usage info in portfile * add UWP patches * fix uwp patch file * fix patch again * fix patch again * fix patch again * move options from command line to .bazelrc * fix include paths * work around bazel restriction "The include path 'D:/buildtrees/tensorflow-cc/tools_clone' references a path outside of the execution root." * go for a completely different approach: force-include uwppatch.h * fix include path again * choose different include location, which is available in bazel build tree * fix compile errors * update header (getenv redefinition) * next try to get patched headers to work * another try to fix include paths * update patched header, bazel has its own naming for target triplet * yet another try to fix patched include path * next try to fix includes: patch bazel deps where required * fix patch * Update ports/tensorflow-cc/CONTROL Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/tensorflow/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * follow-up to code review * extend patch (further build deps) * fix suffix parameter * add more build deps * fix quoting * extend linux patch * fix patch * extend patch again * yet another deps fix * another try to fix quoting of possibly empty string parameter * add another deps patch * extend patch again * different approach to fix empty string arguments * fix portfiles, add more bazel deps * update list of headers for tensorflow 2.3.1 (was still 2.3.0) * update list of headers for v2.3.1 * extend bazel deps path again * Update ports/tensorflow/CONTROL Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * fix bazel deps, bump port version * add more bazel deps * move common stuff into tensorflow-common as discussed in review * go for a different approach (patch bazel toolchain) as adding bazel deps is a never-ending story... * Apply suggestions from code review Co-authored-by: nicole mazzuca * yet again a completely different approach to fix the include path * fix path * fix path again * merge changes from C port * fix cmake variable replacement (apparently @ cannot be escaped...) * try again without escaping * use absolute path * fix escaping * calculate absolute path * fix replacement in configure_file * handle directory exists error * convert cygpath to windows path * overcome backslash / escaping issues * try include with build-root-relative path * apply work-around until proper solution is available * merge master * resolved conflicts * Revert "merge master" This reverts commit f0804f184d107c68c6146e8f17afc33a2a8318fc. * add uwp files to copy list * update uwppatch.h * fix typo * patch the patch for UWP case * fix patch (missing spaces) * fix build error in AWS SDK prerequisit * fix more compilation errors * replace previous patch with more targeted patch * add escaped quotes around Windows path with spaces * cleanup * merge patch (there can only be one patch file per external) * add messages to user * update versions files * update tensorflow to 2.4.1 * port 0 seems to cause errors => remove port field * remove patches that made it into tensorflow, correct line numbers in remaining patches * fix patch line numbers, add copy rules for new header files * fix patch line numbers * fix versions for x86 * add more Windows and Linux specific patches * add more Windows and Linux patches * fix UWP patches * fix x86 target * remove UWP specific fixes from this branch as UWP PR doesn't get merged * fix version shas * Apply suggestions from code review Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * fix version hash again * try an easier fix after discussion upstream * fix hashes Co-authored-by: Gehweiler Co-authored-by: wangli28 Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> Co-authored-by: Joachim Gehweiler Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Co-authored-by: nicole mazzuca --- ports/tensorflow-cc/portfile.cmake | 3 +- ports/tensorflow-cc/vcpkg.json | 3 +- .../change-macros-for-static-lib.patch | 11 +- ports/tensorflow-common/fix-dbg-build-errors.patch | 111 --------------------- ports/tensorflow-common/fix-linux-build.patch | 68 ++----------- .../tensorflow-common/fix-more-build-errors.patch | 11 -- ports/tensorflow-common/fix-windows-build.patch | 12 +++ ports/tensorflow-common/portfile.cmake | 3 +- ports/tensorflow-common/tensorflow-common.cmake | 13 ++- ports/tensorflow-common/vcpkg.json | 3 +- ports/tensorflow/portfile.cmake | 4 + ports/tensorflow/vcpkg.json | 3 +- versions/baseline.json | 12 +-- versions/t-/tensorflow-cc.json | 5 + versions/t-/tensorflow-common.json | 5 + versions/t-/tensorflow.json | 5 + 16 files changed, 63 insertions(+), 209 deletions(-) delete mode 100644 ports/tensorflow-common/fix-dbg-build-errors.patch delete mode 100644 ports/tensorflow-common/fix-more-build-errors.patch create mode 100644 ports/tensorflow-common/fix-windows-build.patch diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index bf77e7148..f905397eb 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -2,8 +2,7 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "UWP") set(TF_LIB_SUFFIX "_cc") set(TF_PORT_SUFFIX "-cc") -set(TF_INCLUDE_DIRS "${CURRENT_INSTALLED_DIR}/include/tensorflow-external - ${CURRENT_INSTALLED_DIR}/include/tensorflow-external/src") +set(TF_INCLUDE_DIRS "${CURRENT_INSTALLED_DIR}/include/tensorflow-external ${CURRENT_INSTALLED_DIR}/include/tensorflow-external/src") list(APPEND CMAKE_MODULE_PATH "${CURRENT_INSTALLED_DIR}/share/tensorflow-common") include(tensorflow-common) diff --git a/ports/tensorflow-cc/vcpkg.json b/ports/tensorflow-cc/vcpkg.json index 5297a3b07..fe5503d3b 100644 --- a/ports/tensorflow-cc/vcpkg.json +++ b/ports/tensorflow-cc/vcpkg.json @@ -1,7 +1,6 @@ { "name": "tensorflow-cc", - "version-string": "2.3.1", - "port-version": 2, + "version-semver": "2.4.1", "description": "Library for computation using data flow graphs for scalable machine learning (C++ API version)", "homepage": "https://github.com/tensorflow/tensorflow", "supports": "!(x86 | arm | uwp)", 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(); - auto Toutput_v = outputs_tensor->reinterpret_last_dimension(); -- functor::DepthToSpaceOpFunctor functor; -- functor(context->eigen_device(), Tinput_v, block_size_, -+ functor::DepthToSpaceOpFunctor functor; -+ functor(context->eigen_device(), Tinput_v, block_size_, - Toutput_v); - return; - } else if (data_format_ == FORMAT_NCHW) { -- functor::DepthToSpaceOpFunctor functor; -- functor(context->eigen_device(), Tinput, block_size_, -+ functor::DepthToSpaceOpFunctor functor; -+ functor(context->eigen_device(), Tinput, block_size_, - Toutput); - return; - } -@@ -173,6 +173,15 @@ - } - } - }; -+#ifdef WIN32 -+template -+struct DepthToSpaceOpFunctor { -+ void operator()(const CPUDevice& d, typename TTypes::ConstTensor input, -+ int block_size, typename TTypes::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(); - auto Toutput_v = outputs_tensor->reinterpret_last_dimension(); -- functor::SpaceToDepthOpFunctor functor; -- functor(context->eigen_device(), Tinput_v, block_size_, -+ functor::SpaceToDepthOpFunctor functor; -+ functor(context->eigen_device(), Tinput_v, block_size_, - Toutput_v); - } else if (data_format_ == FORMAT_NCHW) { - CHECK((std::is_same::value)); -- functor::SpaceToDepthOpFunctor functor; -- functor(context->eigen_device(), input.tensor(), -+ functor::SpaceToDepthOpFunctor functor; -+ functor(context->eigen_device(), input.tensor(), - block_size_, outputs_tensor->tensor()); - } else { - CHECK((std::is_same::value)); -- functor::SpaceToDepthOpFunctor functor; -- functor(context->eigen_device(), input.tensor(), -+ functor::SpaceToDepthOpFunctor functor; -+ functor(context->eigen_device(), input.tensor(), - block_size_, outputs_tensor->tensor()); - } - } else { -@@ -188,6 +188,15 @@ - } - } - }; -+#ifdef WIN32 -+template -+struct SpaceToDepthOpFunctor { -+ void operator()(const CPUDevice& d, typename TTypes::ConstTensor input, -+ int block_size, typename TTypes::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" } diff --git a/ports/tensorflow/portfile.cmake b/ports/tensorflow/portfile.cmake index 0bd5ce354..a393a6ab9 100644 --- a/ports/tensorflow/portfile.cmake +++ b/ports/tensorflow/portfile.cmake @@ -8,12 +8,16 @@ include(tensorflow-common) file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_macros.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tensor_interface.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_attrtype.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_datatype.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_file_statistics.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_status.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tensor.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tstring.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api_experimental.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager") file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/dlpack.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/core/platform/ctstring.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/core/platform") +file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/core/platform/ctstring_internal.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/tensorflow/core/platform") diff --git a/ports/tensorflow/vcpkg.json b/ports/tensorflow/vcpkg.json index 2c3f6d4bf..b6fb8e613 100644 --- a/ports/tensorflow/vcpkg.json +++ b/ports/tensorflow/vcpkg.json @@ -1,7 +1,6 @@ { "name": "tensorflow", - "version-string": "2.3.1", - "port-version": 1, + "version-semver": "2.4.1", "description": "Library for computation using data flow graphs for scalable machine learning (C API version)", "homepage": "https://github.com/tensorflow/tensorflow", "supports": "!(x86 | arm | uwp)", diff --git a/versions/baseline.json b/versions/baseline.json index 5c5190051..ba5821aeb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5801,16 +5801,16 @@ "port-version": 0 }, "tensorflow": { - "baseline": "2.3.1", - "port-version": 1 + "baseline": "2.4.1", + "port-version": 0 }, "tensorflow-cc": { - "baseline": "2.3.1", - "port-version": 2 + "baseline": "2.4.1", + "port-version": 0 }, "tensorflow-common": { - "baseline": "2.3.1", - "port-version": 1 + "baseline": "2.4.1", + "port-version": 0 }, "termcolor": { "baseline": "2.0.0", diff --git a/versions/t-/tensorflow-cc.json b/versions/t-/tensorflow-cc.json index 380be804e..1711cad05 100644 --- a/versions/t-/tensorflow-cc.json +++ b/versions/t-/tensorflow-cc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "868e7ae57409669692df84ddb446f4a235e0b220", + "version-semver": "2.4.1", + "port-version": 0 + }, { "git-tree": "08a9ef525187b9b3656a686f2e83100643b7389e", "version-string": "2.3.1", diff --git a/versions/t-/tensorflow-common.json b/versions/t-/tensorflow-common.json index 2797aeb38..a42b859be 100644 --- a/versions/t-/tensorflow-common.json +++ b/versions/t-/tensorflow-common.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "566f036d2265f6c960014ceb526ed0d143f65c60", + "version-semver": "2.4.1", + "port-version": 0 + }, { "git-tree": "68686e3bd8a7304f0a9dbc090e2757ed2186a2a6", "version-string": "2.3.1", diff --git a/versions/t-/tensorflow.json b/versions/t-/tensorflow.json index b0c96ce5a..c83f74066 100644 --- a/versions/t-/tensorflow.json +++ b/versions/t-/tensorflow.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "bd9bf99a10fe9a9769f26dedb282f3c1954fc9bb", + "version-semver": "2.4.1", + "port-version": 0 + }, { "git-tree": "b6ac5c291afa1274c50ac9e1ff3010da0fbb6e36", "version-string": "2.3.1", -- cgit v1.2.3