forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://tensorflow.google.cn/install/source_windows #注意该页面应使用英文,中文的话可…
…能是老版本的步骤 bazel clean --expunge 可根据.bazelversion下载bazel版本 set http_proxy=http://127.0.0.1:10809 set https_proxy=http://127.0.0.1:10809 bazel --output_user_root="E:/bazel_root" build --noincompatible_do_not_split_linking_cmdline --config=windows --config=win_clang --verbose_failures --config=opt [--config=dbg] --local_ram_resources=2048 ■//tensorflow:tensorflow.dll //tensorflow:tensorflow.lib //tensorflow:install_headers ■//tensorflow:tensorflow_cc(在版本2.16.1失败,提示链接时找不到导入函数) ■//tensorflow/examples/label_image(例子) ■//tensorflow/tools/pip_package:wheel --repo_env=WHEEL_NAME=tensorflow_cpu # 注意: 由于windows系统文件路径长度限制,需要设置output_user_root # 注意: 如果在windows系统使用pyenv配置python,编译(bazel build ...)时会提示CreateProcessW(python3...)失败(ERROR: src/main/native/windows/process.cc(202)) 原因是找到的python3可执行脚本是linux的,需要修改"~\_bazel_Administrator\brzvmudz\external\llvm-raw\utils\bazel\configure.bzl" ... python_bin = repository_ctx.which("python3") 改为 python_bin = repository_ctx.which("python3.bat") ...
- Loading branch information
Showing
5 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
// 使用 IntelliSense 了解相关属性。 | ||
// 悬停以查看现有属性的描述。 | ||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "(msvc) Launch", | ||
"type": "cppvsdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/bazel-bin/tensorflow/examples/label_image/label_image.exe", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceFolder}", | ||
"environment": [], | ||
"console": "integratedTerminal", | ||
"preLaunchTask": "bazel build" | ||
}, | ||
{ | ||
"name": "(lldb) Launch", | ||
"type": "lldb", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/bazel-bin/tensorflow/examples/label_image/label_image.exe", | ||
"args": [], | ||
"cwd": "${workspaceFolder}", | ||
"console": "integratedTerminal", | ||
"preLaunchTask": "bazel build" | ||
}, | ||
{ | ||
"name": "(gdb) Launch", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/bazel-bin/tensorflow/examples/label_image/label_image.exe", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceFolder}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "D:/msys64/mingw64/bin/gdb.exe", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
}, | ||
{ | ||
"description": "Set Disassembly Flavor to Intel", | ||
"text": "-gdb-set disassembly-flavor intel", | ||
"ignoreFailures": true | ||
} | ||
], | ||
"preLaunchTask": "bazel build" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"tasks": [ | ||
// try bazel build | ||
{ | ||
"type": "cppbuild", | ||
"label": "bazel build", | ||
"command": "bazel", | ||
"args": [ | ||
"--output_user_root=\"E:/bazel_root\"", | ||
"build", | ||
"--noincompatible_do_not_split_linking_cmdline", | ||
"--config=windows", | ||
"--config=win_clang", | ||
//"--config=win_mingw", | ||
//"--config=win_msys", | ||
//"-s", | ||
"--verbose_failures", | ||
"--config=opt", | ||
//"--config=dbg", | ||
"--local_ram_resources=2048", | ||
"//tensorflow/examples/label_image" | ||
], | ||
"options": { | ||
"cwd": "${fileDirname}" | ||
}, | ||
"problemMatcher": [ | ||
"$gcc" | ||
], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"detail": "调试器生成的任务。" | ||
} | ||
], | ||
"version": "2.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@echo off | ||
@chcp 936 | ||
|
||
SET CC1=win_clang | ||
SET CC2=win_mingw | ||
SET CC3=win_msys | ||
SET ROT=E:/bazel_root | ||
SET TGT=//tensorflow:tensorflow.dll //tensorflow:tensorflow.lib //tensorflow:install_headers //tensorflow/tools/pip_package:wheel --repo_env=WHEEL_NAME=tf_nightly_cpu //tensorflow/lite:tensorflowlite //tensorflow/lite/delegates/flex:tensorflowlite_flex | ||
SET CMD=bazel --output_user_root="%ROT%" build --noincompatible_do_not_split_linking_cmdline --config=windows --config=%CC1% --verbose_failures --config=opt --local_ram_resources=2048 | ||
|
||
echo -------------------------------------------------------- | ||
echo ----------------------Debug----------------------------- | ||
echo -------------------------------------------------------- | ||
echo %CMD% --config=dbg %TGT% | ||
echo -------------------------------------------------------- | ||
echo ---------------------Release---------------------------- | ||
echo -------------------------------------------------------- | ||
echo %CMD% %TGT% | ||
echo -------------------------------------------------------- | ||
echo ----------------------Debug----------------------------- | ||
echo -------------------------------------------------------- | ||
%CMD% --config=dbg %TGT% | ||
echo -------------------------------------------------------- | ||
echo ---------------------Release---------------------------- | ||
echo -------------------------------------------------------- | ||
%CMD% %TGT% | ||
|
||
pause |