Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译examples/windows/x86/build_msvc_native无法通过 #1681

Closed
phlas-end opened this issue Jun 7, 2022 · 3 comments
Closed

编译examples/windows/x86/build_msvc_native无法通过 #1681

phlas-end opened this issue Jun 7, 2022 · 3 comments
Assignees

Comments

@phlas-end
Copy link

1. 环境(environment)

  • Build OS and Version:Windows

2. Github版本

  • branch:0.3.0

3. 编译方式(compile method)
cd <path_to_tnn>\examples\windows\x86
.\build_msvc_native.bat

4. 编译日志(build log)

ECHO 处于关闭状态。
子目录或文件 build_win 已经存在。
E:/TNN_C++/C++_use/TNN
E:/TNN_C++/C++_use/TNN
-- >>>>>>>>>>>>>
-- TNN BUILD INFO:
--      System: Windows
--      Processor:
--      Cpu:    ON
--      X86:    ON
--      Arm:    OFF
--      Arm82:  OFF
--      Metal:  OFF
--      OpenCL: OFF
--      CUDA:   OFF
--      DSP:    OFF
--      Atlas:  OFF
--      TensorRT:       OFF
--      AppleNPU:       OFF
--      HuaweiNPU:      OFF
--      RKNPU:  OFF
--      OpenVINO:       OFF
--      OpenMP: OFF
--      TEST:   ON
--      --Unit Test:    OFF
--      Quantization:   OFF
--      ModelCheck:     OFF
--      DEBUG:
--      PROFILE:        OFF
--      BENCHMARK:      OFF
--      BENCHMARK Layer:        OFF
--      Model Converter:        OFF
--      ONNX2TNN Converter:     OFF
--      TNN2MEM:        OFF
--      BENCHMARK Test Lib:     OFF
--      Dynamic Range Quantization:     OFF
-- Configuring done
-- Generating done
-- Build files have been written to: E:/TNN_C++/C++_use/TNN/scripts/build_win
ninja: no work to do.
!cd!
-- The C compiler identification is MSVC 19.16.27048.0
-- The CXX compiler identification is MSVC 19.16.27048.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: E:/VS2017/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: E:/VS2017/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
E:/TNN_C++/C++_use/TNN/examples/windows/x86
E:\TNN_C++\C++_use\TNN\examples\windows\x86\\..\..\..\scripts\build_win\
-- Check size of __int32
-- Check size of __int32 - done
-- Configuring done
-- Generating done
-- Build files have been written to: E:/TNN_C++/C++_use/TNN/examples/windows/x86/build_msvc_native
[1/215] Building CXX object CMakeFiles\demo_x86_imageclass...NN_C++\C++_use\TNN\examples\base\face_gray_transfer.cc.obj
cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
[2/215] Building CXX object CMakeFiles\demo_x86_imageclass...TNN_C++\C++_use\TNN\examples\base\hair_segmentation.cc.obj
cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
[3/215] Building CXX object CMakeFiles\demo_x86_imageclass...N_C++\C++_use\TNN\examples\base\face_detect_aligner.cc.obj
cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
[4/215] Building CXX object CMakeFiles\demo_x86_imageclass...\TNN_C++\C++_use\TNN\examples\base\face_detect_mesh.cc.obj
cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
[5/215] Building CXX object CMakeFiles\demo_x86_imageclass...\TNN_C++\C++_use\TNN\examples\base\image_classifier.cc.obj
cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
[6/215] Building CXX object CMakeFiles\demo_x86_imageclass...+\C++_use\TNN\examples\base\object_detector_nanodet.cc.obj
FAILED: CMakeFiles/demo_x86_imageclassify.dir/E_/TNN_C++/C++_use/TNN/examples/base/object_detector_nanodet.cc.obj
E:\VS2017\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe  /nologo /TP -DGFLAGS_IS_A_DLL=0 -IE:\TNN_C++\C++_use\TNN\third_party\gflags\include -IE:\TNN_C++\C++_use\TNN\examples\windows\x86\..\..\..\include -IE:\TNN_C++\C++_use\TNN\examples\windows\x86\..\..\base -IE:\TNN_C++\C++_use\TNN\examples\windows\x86\..\..\utils /DWIN32 /D_WINDOWS /W3 /GR /EHsc /w /MD /O2 /Ob2 /DNDEBUG /showIncludes /FoCMakeFiles\demo_x86_imageclassify.dir\E_\TNN_C++\C++_use\TNN\examples\base\object_detector_nanodet.cc.obj /FdCMakeFiles\demo_x86_imageclassify.dir\ /FS -c E:\TNN_C++\C++_use\TNN\examples\base\object_detector_nanodet.cc
cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
E:\TNN_C++\C++_use\TNN\examples\base\object_detector_nanodet.cc(183): error C2131: 表达式的计算结果不是常数
E:\TNN_C++\C++_use\TNN\examples\base\object_detector_nanodet.cc(183): note: 因读取超过生命周期的变量而失败
E:\TNN_C++\C++_use\TNN\examples\base\object_detector_nanodet.cc(183): note: 请参见“this”的用法
[7/215] Building CXX object CMakeFiles\demo_x86_imageclassify.dir\E_\TNN_C++\C++_use\TNN\examples\base\monodepth.cc.obj
cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
[8/215] Building CXX object CMakeFiles\demo_x86_imageclassify.dir\E_\TNN_C++\C++_use\TNN\examples\base\face_mesh.cc.obj
cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
[9/215] Building CXX object CMakeFiles\demo_x86_imageclass...N_C++\C++_use\TNN\examples\base\object_detector_ssd.cc.obj
cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
ninja: build stopped: subcommand failed.
命令语法不正确。
Build Successfully!

5. 详细描述bug 情况 (Describe the bug)
按照官方文档,编译examples/windows/x86/build_msvc_native无法通过

@Smeegol
Copy link

Smeegol commented Jun 19, 2022

遇到同样的问题。TNN不维护了吗?闭源了吗?QQ群也没有一点官方回复

@Maosquerade
Copy link
Collaborator

很抱歉造成问题,这里是引用了一些 x86 尚未支持的 demo 导致错误,目前可以删除原有编译文件切到 fix_windows_x86_build 分支进行编译解决,后续会尽快合进 master

@Maosquerade
Copy link
Collaborator

问题已修复,可以用 master编译了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants