vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[ncnn] Add new port

Open holylong opened this issue 2 years ago • 12 comments

[ncnn] Add new port

  • Provide ncnn implementation

  • Convert CONTROL to vcpkg.json.

  • Update versions/baseline.json.

  • Address reviewer comments by using vcpkg_from_github.

  • Implement recommended changes from MR review.

  • Update x-add-version.

  • ncnn uses a proprietary license is BSD

  • Update versions file.

  • format portfile.cmake

  • x-add-version

  • apply suggestion

  • x-add-version

Co-authored-by: holylong[email protected]

holylong avatar Jun 16 '22 12:06 holylong

@holylong, Thanks for your pr, Looks the ci tested failed, this is error log, please taeke a look:

/debug/share should not exist. Please reorganize any important files, then use
    file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
The following EXEs were found in /bin or /debug/bin. EXEs are not valid distribution targets.

    D:/packages/ncnn_x86-windows/bin/darknet2ncnn.exe
    D:/packages/ncnn_x86-windows/bin/mxnet2ncnn.exe
    D:/packages/ncnn_x86-windows/bin/ncnn2int8.exe
    D:/packages/ncnn_x86-windows/bin/ncnn2mem.exe
    D:/packages/ncnn_x86-windows/bin/ncnn2table.exe
    D:/packages/ncnn_x86-windows/bin/ncnnmerge.exe
    D:/packages/ncnn_x86-windows/bin/ncnnoptimize.exe

The following EXEs were found in /bin or /debug/bin. EXEs are not valid distribution targets.

    D:/packages/ncnn_x86-windows/debug/bin/darknet2ncnn.exe
    D:/packages/ncnn_x86-windows/debug/bin/mxnet2ncnn.exe
    D:/packages/ncnn_x86-windows/debug/bin/ncnn2int8.exe
    D:/packages/ncnn_x86-windows/debug/bin/ncnn2mem.exe
    D:/packages/ncnn_x86-windows/debug/bin/ncnn2table.exe
    D:/packages/ncnn_x86-windows/debug/bin/ncnnmerge.exe
    D:/packages/ncnn_x86-windows/debug/bin/ncnnoptimize.exe

JonLiu1993 avatar Jun 17 '22 02:06 JonLiu1993

Please don't git push this branch, I'm fixing bugs

JonLiu1993 avatar Jun 17 '22 02:06 JonLiu1993

Please don't git push this branch, I'm fixing bugs

ok, I add some ncnn cmake options to avoid exe generation

holylong avatar Jun 17 '22 03:06 holylong

This is error log, please take a look:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.32.31326\include\emmintrin.h(20): fatal error C1189: #error:  This header is specific to X86, X64 and ARM64EC targets
[11/158] C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\arm\cl.exe   /TP -DNOMINMAX -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -ID:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src\layer\x86 -ID:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src -ID:\buildtrees\ncnn\arm-uwp-dbg\src -ID:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src\layer /DWIN32 /D_WINDOWS /D_UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB__ /nologo /Z7 /MP /GS /Gd /Gm- /W3 /WX- /Zc:wchar_t /Zc:inline /Zc:forScope /fp:precise /Oy- /EHsc  /utf-8  /D_DEBUG /Od /RTC1 /MDd  -MDd -DNCNN_STATIC_DEFINE -fno-rtti /arch:SSE2 /D__SSE2__ -openmp /showIncludes /Fosrc\CMakeFiles\ncnn.dir\layer\x86\bias_x86.cpp.obj /Fdsrc\CMakeFiles\ncnn.dir\ncnn.pdb /FS -c D:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src\layer\x86\bias_x86.cpp
FAILED: src/CMakeFiles/ncnn.dir/layer/x86/bias_x86.cpp.obj 
C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\arm\cl.exe   /TP -DNOMINMAX -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -ID:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src\layer\x86 -ID:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src -ID:\buildtrees\ncnn\arm-uwp-dbg\src -ID:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src\layer /DWIN32 /D_WINDOWS /D_UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB__ /nologo /Z7 /MP /GS /Gd /Gm- /W3 /WX- /Zc:wchar_t /Zc:inline /Zc:forScope /fp:precise /Oy- /EHsc  /utf-8  /D_DEBUG /Od /RTC1 /MDd  -MDd -DNCNN_STATIC_DEFINE -fno-rtti /arch:SSE2 /D__SSE2__ -openmp /showIncludes /Fosrc\CMakeFiles\ncnn.dir\layer\x86\bias_x86.cpp.obj /Fdsrc\CMakeFiles\ncnn.dir\ncnn.pdb /FS -c D:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src\layer\x86\bias_x86.cpp
cl : Command line warning D9002 : ignoring unknown option '-fno-rtti'
cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.32.31326\include\emmintrin.h(20): fatal error C1189: #error:  This header is specific to X86, X64 and ARM64EC targets
[12/158] C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1432~1.313\bin\Hostx64\arm\cl.exe   /TP -DNOMINMAX -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -ID:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src\layer\x86 -ID:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src -ID:\buildtrees\ncnn\arm-uwp-dbg\src -ID:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src\layer /DWIN32 /D_WINDOWS /D_UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB__ /nologo /Z7 /MP /GS /Gd /Gm- /W3 /WX- /Zc:wchar_t /Zc:inline /Zc:forScope /fp:precise /Oy- /EHsc  /utf-8  /D_DEBUG /Od /RTC1 /MDd  -MDd -DNCNN_STATIC_DEFINE -fno-rtti /arch:SSE2 /D__SSE2__ -openmp /showIncludes /Fosrc\CMakeFiles\ncnn.dir\mat.cpp.obj /Fdsrc\CMakeFiles\ncnn.dir\ncnn.pdb /FS -c D:\buildtrees\ncnn\src\20220420-dbbb03d16a.clean\src\mat.cpp
FAILED: src/CMakeFiles/ncnn.dir/mat.cpp.obj 

JonLiu1993 avatar Jun 17 '22 05:06 JonLiu1993

You can modify it normally

JonLiu1993 avatar Jun 17 '22 05:06 JonLiu1993

I'm not have toolchain to compile for arm platform

error: in triplet arm64-windows: Unable to find a valid toolchain for requested target architecture arm64.
The selected Visual Studio instance is at: D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
The available toolchain combinations are: x86, amd64, x86_amd64, amd64_x86
See https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md#VCPKG_VISUAL_STUDIO_PATH for more information.
note: updating vcpkg by rerunning bootstrap-vcpkg may resolve this failure.

holylong avatar Jun 17 '22 06:06 holylong

I change vcpkg.json like mnn not sopport mobile and arm

"supports": "!(arm | uwp | ios | android)",

holylong avatar Jun 17 '22 06:06 holylong

I change vcpkg.json like mnn not sopport mobile and arm

"supports": "!(arm | uwp | ios | android)",

ncnn support these platforms natively?

JonLiu1993 avatar Jun 17 '22 06:06 JonLiu1993

I change vcpkg.json like mnn not sopport mobile and arm

"supports": "!(arm | uwp | ios | android)",

ncnn support these platforms natively? ncnn is a inference library like mnn, The method of compiling the arm version with visual studio not supported now.

holylong avatar Jun 17 '22 07:06 holylong

But I add cmake options to avoid generate exes,there has no exes to clean or copy.

---- Replied Message ---- | From | @.> | | Date | 06/18/2022 06:02 | | To | @.> | | Cc | @.@.> | | Subject | Re: [microsoft/vcpkg] [ncnn] Add new port (PR #25276) |

@Thomas1664 commented on this pull request.

In ports/ncnn/portfile.cmake:

+file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*.exe") +if(EXES)

  • file(COPY ${EXES} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/shapelib")
  • file(COPY ${EXES} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/shapelib")
  • file(REMOVE ${EXES}) +endif()

+file(GLOB DEBUG_EXES "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe") +if(DEBUG_EXES)

  • file(REMOVE ${DEBUG_EXES}) +endif()

@holylong<tool_names> was meant as a placeholder for the names of the executables. Please replace it with their file names (without file extension. Furthermore, I recommend to read the docs about vcpkg_copy_tools().

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

holylong avatar Jun 17 '22 22:06 holylong

But I add cmake options to avoid generate exes,there has no exes to clean or copy. ---- Replied Message ---- | From | @.> | | Date | 06/18/2022 06:02 | | To | @.> | | Cc | @.@.> | | Subject | Re: [microsoft/vcpkg] [ncnn] Add new port (PR #25276) | @Thomas1664 commented on this pull request. In ports/ncnn/portfile.cmake: +file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/.exe") +if(EXES) + file(COPY ${EXES} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/shapelib") + file(COPY ${EXES} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/shapelib") + file(REMOVE ${EXES}) +endif() + +file(GLOB DEBUG_EXES "${CURRENT_PACKAGES_DIR}/debug/bin/.exe") +if(DEBUG_EXES) + file(REMOVE ${DEBUG_EXES}) +endif() @holylong<tool_names> was meant as a placeholder for the names of the executables. Please replace it with their file names (without file extension. Furthermore, I recommend to read the docs about vcpkg_copy_tools(). — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

But I add cmake options to avoid generate exes,there has no exes to clean or copy. so function vcpkg_copy_tools() is it a little superfluous

holylong avatar Jun 18 '22 01:06 holylong

Ping @holylong for response

JonLiu1993 avatar Aug 05 '22 08:08 JonLiu1993

Duplicate of #26557

JonLiu1993 avatar Sep 02 '22 10:09 JonLiu1993