Skip to content

[BUILD IMPROVEMENT] Deprecated installing external projects using cmake "ExaternalProject_Add" #212

@yiakwy-enterprise-roborock

Description

Argument: this is a not a good practice and the operation might face many practical problems

  1. We don't to have to clone the whole tensorflow project, only the released one. The URL specified in cmake/TensorflowBase.cmake is incorrect! (git repo ssh address with a shallow depth). Or we can just use URL key word to fetch the released tar.gz files.

  2. native cmake does not support curl with https. And there might be other factors like git cache. proxy server causing permanent hung In command line

  3. User can provide the released source code of tensorflow without downloading it.

A temporal work around

Solution 1

change "cmake/TensorflowBase.cmake", comment the lines :

ExternalProject_Add(
tensorflow_base
# GIT_REPOSITORY https://github.com/tensorflow/tensorflow.git
# GIT_TAG "${TENSORFLOW_TAG}" 
# TMP_DIR "/tmp"
# STAMP_DIR "tensorflow-stamp"
# DOWNLOAD_DIR "tensorflow"
SOURCE_DIR "${TENSORFLOW_SOURCE}"
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND "${CMAKE_CURRENT_BINARY_DIR}/build_tensorflow.sh"
INSTALL_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy_links.sh" bazel-bin
)

Solution 2

Or equivalently, copy the generated "build/build_tensorflow.sh" to the source folder of downloaded tensorflow.

Conclusion

Drop the ExternalProject_Add and using shell commands, execute_process to do the relevant jobs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions