-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from JDAI-CV/windows
onnx2bnn windows support
- Loading branch information
Showing
22 changed files
with
521 additions
and
78 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# It is a configuration file for [project_manager.vim](https://github.com/daquexian/project_manager.vim) | ||
name binary-nn | ||
type cpp | ||
build_dir build_x86_python | ||
cmake_options -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBNN_BUILD_PYTHON=ON |
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
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- refs/heads/* | ||
- refs/tags/* | ||
pool: | ||
vmImage: 'macOS-10.14' | ||
steps: | ||
|
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 |
---|---|---|
@@ -1,26 +1,80 @@ | ||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
steps: | ||
- checkout: self | ||
submodules: true | ||
- script: sudo apt install -y cmake protobuf-compiler libprotobuf-dev | ||
displayName: Install cmake 3.5.1 and protobuf | ||
- bash: ci/build_onnx2bnn.sh | ||
displayName: Build | ||
- bash: ci/build_appimage.sh | ||
displayName: Build AppImage | ||
- task: CopyFiles@2 | ||
inputs: | ||
contents: 'onnx2bnn.AppImage' | ||
trigger: | ||
branches: | ||
include: | ||
- refs/heads/* | ||
- refs/tags/* | ||
jobs: | ||
- job: Linux_AppImage | ||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
steps: | ||
- checkout: self | ||
submodules: true | ||
- script: sudo apt install -y protobuf-compiler libprotobuf-dev | ||
displayName: Install protobuf | ||
- bash: ci/build_onnx2bnn.sh | ||
displayName: Build | ||
- bash: ci/build_appimage.sh | ||
displayName: Build AppImage | ||
- task: CopyFiles@2 | ||
inputs: | ||
contents: 'onnx2bnn.AppImage' | ||
targetFolder: $(Build.ArtifactStagingDirectory) | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: $(Build.ArtifactStagingDirectory) | ||
artifactName: onnx2bnn AppImage | ||
- task: GitHubRelease@0 | ||
inputs: | ||
gitHubConnection: 'dabnn release' | ||
repositoryName: '$(Build.Repository.Name)' | ||
action: 'edit' | ||
tag: '$(Build.SourceBranchName)' | ||
target: '$(Build.SourceVersion)' | ||
assets: '$(Build.ArtifactStagingDirectory)/*' | ||
assetUploadMode: 'replace' | ||
- job: Windows_Python_Package | ||
pool: | ||
vmImage: 'vs2017-win2016' | ||
steps: | ||
- checkout: self | ||
submodules: true | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.7' | ||
addToPath: true | ||
architecture: 'x64' | ||
- template: template_onnx2bnn_build_python.yml | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.6' | ||
addToPath: true | ||
architecture: 'x64' | ||
- template: template_onnx2bnn_build_python.yml | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.5' | ||
addToPath: true | ||
architecture: 'x64' | ||
- template: template_onnx2bnn_build_python.yml | ||
- task: CopyFiles@2 | ||
inputs: | ||
sourceFolder: '.setuptools-cmake-build\tools\onnx2bnn\Release\' | ||
contents: 'onnx2bnn.exe' | ||
targetFolder: $(Build.ArtifactStagingDirectory) | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: $(Build.ArtifactStagingDirectory) | ||
artifactName: onnx2bnn AppImage | ||
- task: GitHubRelease@0 | ||
inputs: | ||
gitHubConnection: 'dabnn release' | ||
repositoryName: '$(Build.Repository.Name)' | ||
action: 'create' | ||
target: '$(Build.SourceVersion)' | ||
assets: '$(Build.ArtifactStagingDirectory)/onnx2bnn.AppImage' | ||
- task: GitHubRelease@0 | ||
inputs: | ||
gitHubConnection: 'dabnn release' | ||
repositoryName: '$(Build.Repository.Name)' | ||
action: 'edit' | ||
tag: '$(Build.SourceBranchName)' | ||
target: '$(Build.SourceVersion)' | ||
assets: '$(Build.ArtifactStagingDirectory)/*' | ||
assetUploadMode: 'replace' | ||
- script: python -m twine upload dist/* --verbose | ||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) | ||
displayName: Upload wheel to PyPI | ||
workingDirectory: tools/onnx2bnn/python/ | ||
env: | ||
TWINE_USERNAME: $(twineUsername) | ||
TWINE_PASSWORD: $(twinePassword) |
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,6 @@ | ||
steps: | ||
- script: python -m pip install --user --upgrade setuptools wheel twine | ||
displayName: Install setuptools, wheel and twine | ||
- script: python setup.py sdist bdist_wheel | ||
workingDirectory: tools/onnx2bnn/python/ | ||
displayName: Build onnx2bnn python package |
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,16 @@ | ||
macro(alias_protobuf) | ||
add_library(protobuf::libprotoc ALIAS libprotoc) | ||
add_library(protobuf::libprotobuf ALIAS libprotobuf) | ||
add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite) | ||
endmacro() | ||
|
||
macro(configure_protobuf) | ||
message(STATUS "Configuring protobuf...") | ||
option(protobuf_BUILD_TESTS "" OFF) | ||
option(protobuf_BUILD_EXAMPLES "" OFF) | ||
option(protobuf_BUILD_SHARED_LIBS "" OFF) | ||
option(protobuf_BUILD_PROTOC_BINARIES "" ON) | ||
add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/protobuf/cmake) | ||
alias_protobuf() | ||
endmacro() | ||
|
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,23 @@ | ||
# Copyright 2019 JD.com Inc. JD AI | ||
|
||
# Add MSVC RunTime Flag | ||
function(bnn_add_msvc_runtime_flag) | ||
if (MSVC) | ||
if(${BNN_USE_MSVC_STATIC_RUNTIME}) | ||
if(${CMAKE_BUILD_TYPE} MATCHES "Debug") | ||
add_compile_options(/MTd) | ||
else() | ||
add_compile_options(/MT) | ||
endif() | ||
else() | ||
if(${CMAKE_BUILD_TYPE} MATCHES "Debug") | ||
add_compile_options(/MDd) | ||
else() | ||
add_compile_options(/MD) | ||
endif() | ||
endif() | ||
endif() | ||
endfunction() | ||
|
||
|
||
|
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
Oops, something went wrong.