Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
码匠许师傅
Tensorflow
提交
9d643efe
T
Tensorflow
项目概览
码匠许师傅
/
Tensorflow
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tensorflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9d643efe
编写于
12月 01, 2016
作者:
D
Derek Murray
提交者:
Daniel W Mane
12月 01, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #5844 from vit-stepanovs/cmake_tensorboard_deps (#6020)
[CMake] Add TensorBoard dependencies to PIP package.
上级
45254d9d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
139 addition
and
4 deletion
+139
-4
tensorflow/contrib/cmake/CMakeLists.txt
tensorflow/contrib/cmake/CMakeLists.txt
+1
-0
tensorflow/contrib/cmake/external/tensorboard.cmake
tensorflow/contrib/cmake/external/tensorboard.cmake
+134
-0
tensorflow/contrib/cmake/tf_python.cmake
tensorflow/contrib/cmake/tf_python.cmake
+4
-4
未找到文件。
tensorflow/contrib/cmake/CMakeLists.txt
浏览文件 @
9d643efe
...
...
@@ -209,6 +209,7 @@ if(tensorflow_BUILD_CC_EXAMPLE)
include
(
tf_label_image_example.cmake
)
endif
()
if
(
tensorflow_BUILD_PYTHON_BINDINGS
)
include
(
tensorboard
)
include
(
tf_python.cmake
)
endif
()
if
(
tensorflow_BUILD_CC_TESTS OR tensorflow_BUILD_PYTHON_TESTS
)
...
...
tensorflow/contrib/cmake/external/tensorboard.cmake
0 → 100644
浏览文件 @
9d643efe
include
(
ExternalProject
)
set
(
tensorboard_dependencies
)
add_custom_target
(
tensorboard_copy_dependencies
)
function
(
tb_new_http_archive
)
cmake_parse_arguments
(
_TB
""
"NAME;URL"
"FILES"
${
ARGN
}
)
ExternalProject_Add
(
${
_TB_NAME
}
PREFIX
${
_TB_NAME
}
URL
${
_TB_URL
}
DOWNLOAD_DIR
"
${
DOWNLOAD_LOCATION
}
/
${
_TB_NAME
}
"
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
INSTALL_COMMAND
""
)
set
(
src_dir
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
_TB_NAME
}
/src/
${
_TB_NAME
}
"
)
set
(
dst_dir
"
${
CMAKE_CURRENT_BINARY_DIR
}
/tensorboard_external/
${
_TB_NAME
}
"
)
foreach
(
src_file
${
_TB_FILES
}
)
add_custom_command
(
TARGET tensorboard_copy_dependencies PRE_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
src_dir
}
/
${
src_file
}
${
dst_dir
}
/
${
src_file
}
)
endforeach
()
set
(
tensorboard_dependencies
${
tensorboard_dependencies
}
${
_TB_NAME
}
PARENT_SCOPE
)
endfunction
()
function
(
tb_http_file
)
cmake_parse_arguments
(
_TB
""
"NAME;URL"
""
${
ARGN
}
)
get_filename_component
(
src_file
${
_TB_URL
}
NAME
)
file
(
DOWNLOAD
${
_TB_URL
}
"
${
DOWNLOAD_LOCATION
}
/
${
_TB_NAME
}
/
${
src_file
}
"
)
set
(
src_dir
"
${
DOWNLOAD_LOCATION
}
/
${
_TB_NAME
}
"
)
set
(
dst_dir
"
${
CMAKE_CURRENT_BINARY_DIR
}
/tensorboard_external/
${
_TB_NAME
}
/file"
)
add_custom_command
(
TARGET tensorboard_copy_dependencies PRE_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
src_dir
}
/
${
src_file
}
${
dst_dir
}
/
${
src_file
}
)
add_custom_target
(
${
_TB_NAME
}
DEPENDS
${
src_dir
}
/
${
src_file
}
)
set
(
tensorboard_dependencies
${
tensorboard_dependencies
}
${
_TB_NAME
}
PARENT_SCOPE
)
endfunction
()
# Parse TensorBoard dependency names and URLs from Bazel's WORKSPACE file.
set
(
tb_dep_names
)
file
(
STRINGS
${
PROJECT_SOURCE_DIR
}
/../../../WORKSPACE workspace_contents
)
foreach
(
line
${
workspace_contents
}
)
if
(
line MATCHES
"# TENSORBOARD_BOWER_AUTOGENERATED_BELOW_THIS_LINE_DO_NOT_EDIT"
)
set
(
tb_deps_started 1
)
endif
()
if
(
NOT tb_deps_started
)
continue
()
endif
()
if
(
line MATCHES
"new_http_archive
\\
("
)
set
(
tb_dep_is_archive 1
)
continue
()
elseif
(
line MATCHES
"http_file
\\
("
)
set
(
tb_dep_is_archive 0
)
continue
()
endif
()
string
(
REGEX MATCH
"name.*=.*
\"
(.*)
\"
"
has_name
${
line
}
)
if
(
has_name
)
set
(
tb_dep_name
${
CMAKE_MATCH_1
}
)
continue
()
endif
()
string
(
REGEX MATCH
"url.*=.*
\"
(.*)
\"
"
has_url
${
line
}
)
if
(
has_url
)
list
(
APPEND tb_dep_names
${
tb_dep_name
}
)
set
(
${
tb_dep_name
}
_is_archive
${
tb_dep_is_archive
}
)
set
(
${
tb_dep_name
}
_url
${
CMAKE_MATCH_1
}
)
endif
()
endforeach
()
# Parse the files needed for each TensorBoard dependency from Bazel's bower.BUILD file.
# Due to CMAKE quirkiness, cannot use file(strings) with files that contain '[' and ']'.
file
(
READ
${
PROJECT_SOURCE_DIR
}
/../../../bower.BUILD bower_build_contents
)
string
(
REPLACE
"\["
"OB"
bower_build_contents
"
${
bower_build_contents
}
"
)
string
(
REPLACE
"\]"
"CB"
bower_build_contents
"
${
bower_build_contents
}
"
)
string
(
REPLACE
";"
"
\\\\
;"
bower_build_contents
"
${
bower_build_contents
}
"
)
string
(
REPLACE
"
\n
"
"E;"
bower_build_contents
"
${
bower_build_contents
}
"
)
foreach
(
line
${
bower_build_contents
}
)
string
(
REGEX MATCH
"name.*=.*
\"
(.*)
\"
"
has_name
${
line
}
)
if
(
has_name
)
set
(
tb_dep_name
${
CMAKE_MATCH_1
}
)
set
(
${
tb_dep_name
}
_files
)
continue
()
endif
()
string
(
REGEX MATCH
"srcs.*=.*
\"
(.*)
\"
CB"
has_single_line_src
${
line
}
)
if
(
has_single_line_src
)
list
(
APPEND
${
tb_dep_name
}
_files
${
CMAKE_MATCH_1
}
)
continue
()
endif
()
if
(
line MATCHES
"srcs.*=.*OB"
)
set
(
inside_files_def 1
)
continue
()
elseif
(
line MATCHES
"CB,"
)
set
(
inside_files_def 0
)
continue
()
endif
()
if
(
inside_files_def
)
string
(
REGEX MATCH
"
\"
(.*)
\"
,"
has_file
${
line
}
)
if
(
has_file
)
list
(
APPEND
${
tb_dep_name
}
_files
${
CMAKE_MATCH_1
}
)
endif
()
endif
()
endforeach
()
# Generate a target for each dependency.
foreach
(
tb_dep_name
${
tb_dep_names
}
)
if
(
${
tb_dep_name
}
_is_archive
)
tb_new_http_archive
(
NAME
${
tb_dep_name
}
URL
${${
tb_dep_name
}
_url
}
FILES
${${
tb_dep_name
}
_files
}
)
else
()
tb_http_file
(
NAME
${
tb_dep_name
}
URL
${${
tb_dep_name
}
_url
}
)
endif
()
endforeach
()
add_dependencies
(
tensorboard_copy_dependencies
${
tensorboard_dependencies
}
)
tensorflow/contrib/cmake/tf_python.cmake
浏览文件 @
9d643efe
...
...
@@ -373,10 +373,6 @@ add_python_module("tensorflow/contrib/tensor_forest/hybrid/python/ops")
add_python_module
(
"tensorflow/contrib/tensor_forest/python"
)
add_python_module
(
"tensorflow/contrib/tensor_forest/python/kernel_tests"
)
add_python_module
(
"tensorflow/contrib/tensor_forest/python/ops"
)
add_python_module
(
"tensorflow/contrib/tensorboard"
)
add_python_module
(
"tensorflow/contrib/tensorboard"
)
add_python_module
(
"tensorflow/contrib/tensorboard/plugins"
)
add_python_module
(
"tensorflow/contrib/tensorboard/plugins/projector"
)
add_python_module
(
"tensorflow/contrib/testing"
)
add_python_module
(
"tensorflow/contrib/testing/python"
)
add_python_module
(
"tensorflow/contrib/testing/python/framework"
)
...
...
@@ -577,6 +573,7 @@ target_link_libraries(pywrap_tensorflow
add_custom_target
(
tf_python_build_pip_package
)
add_dependencies
(
tf_python_build_pip_package
pywrap_tensorflow
tensorboard_copy_dependencies
tf_python_copy_scripts_to_destination
tf_python_touchup_modules
tf_python_ops
)
...
...
@@ -615,6 +612,9 @@ add_custom_command(TARGET tf_python_build_pip_package POST_BUILD
add_custom_command
(
TARGET tf_python_build_pip_package POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
tensorflow_source_dir
}
/tensorflow/tensorboard/TAG
${
CMAKE_CURRENT_BINARY_DIR
}
/tf_python/tensorflow/tensorboard/
)
add_custom_command
(
TARGET tf_python_build_pip_package POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
CMAKE_CURRENT_BINARY_DIR
}
/tensorboard_external
${
CMAKE_CURRENT_BINARY_DIR
}
/tf_python/external
)
if
(
${
tensorflow_ENABLE_GPU
}
)
add_custom_command
(
TARGET tf_python_build_pip_package POST_BUILD
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录