add -Wextra and remove a lot of warnings for C code #478
Workflow file for this run
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
name: Darknet Pull Requests | |
on: [pull_request] | |
env: | |
VCPKG_BINARY_SOURCES: 'clear;nuget,vcpkgbinarycache,read' | |
VCPKG_FORCE_DOWNLOADED_BINARIES: "TRUE" | |
jobs: | |
ubuntu-makefile: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update apt | |
run: sudo apt update | |
- name: Install dependencies | |
run: sudo apt install libopencv-dev libgles2-mesa-dev | |
- name: 'Install CUDA' | |
run: ${{ github.workspace }}/scripts/deploy-cuda.sh | |
- name: 'Create softlinks for CUDA' | |
run: | | |
source ${{ github.workspace }}/scripts/requested_cuda_version.sh | |
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so.1 | |
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so.1 | |
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so | |
- name: 'LIBSO=1 GPU=0 CUDNN=0 OPENCV=0' | |
run: | | |
make LIBSO=1 GPU=0 CUDNN=0 OPENCV=0 -j 8 | |
make clean | |
- name: 'LIBSO=1 GPU=0 CUDNN=0 OPENCV=0 DEBUG=1' | |
run: | | |
make LIBSO=1 GPU=0 CUDNN=0 OPENCV=0 DEBUG=1 -j 8 | |
make clean | |
- name: 'LIBSO=1 GPU=0 CUDNN=0 OPENCV=0 AVX=1' | |
run: | | |
make LIBSO=1 GPU=0 CUDNN=0 OPENCV=0 AVX=1 -j 8 | |
make clean | |
- name: 'LIBSO=1 GPU=0 CUDNN=0 OPENCV=1' | |
run: | | |
make LIBSO=1 GPU=0 CUDNN=0 OPENCV=1 -j 8 | |
make clean | |
- name: 'LIBSO=1 GPU=1 CUDNN=1 OPENCV=1' | |
run: | | |
export PATH=/usr/local/cuda/bin:$PATH | |
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH | |
make LIBSO=1 GPU=1 CUDNN=1 OPENCV=1 -j 8 | |
make clean | |
- name: 'LIBSO=1 GPU=1 CUDNN=1 OPENCV=1 CUDNN_HALF=1' | |
run: | | |
export PATH=/usr/local/cuda/bin:$PATH | |
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH | |
make LIBSO=1 GPU=1 CUDNN=1 OPENCV=1 CUDNN_HALF=1 -j 8 | |
make clean | |
- name: 'LIBSO=1 GPU=1 CUDNN=1 OPENCV=1 CUDNN_HALF=1 USE_CPP=1' | |
run: | | |
export PATH=/usr/local/cuda/bin:$PATH | |
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH | |
make LIBSO=1 GPU=1 CUDNN=1 OPENCV=1 CUDNN_HALF=1 USE_CPP=1 -j 8 | |
make clean | |
ubuntu-vcpkg-opencv4-cuda: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: Update apt | |
run: sudo apt update | |
- name: Install dependencies | |
run: sudo apt-get install -y --no-install-recommends yasm nasm gperf automake autoconf libtool pkg-config autoconf-archive libgles2-mesa-dev libx11-dev libxft-dev libxext-dev libxrandr-dev libxi-dev libxcursor-dev libxdamage-dev libxinerama-dev libdbus-1-dev libxtst-dev | |
- name: Clean downloads | |
run: sudo apt-get clean | |
- name: 'Install CUDA' | |
run: ${{ github.workspace }}/scripts/deploy-cuda.sh | |
- name: 'Create softlinks for CUDA' | |
run: | | |
source ${{ github.workspace }}/scripts/requested_cuda_version.sh | |
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so.1 | |
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so.1 | |
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so | |
- name: 'Setup vcpkg and NuGet artifacts backend' | |
shell: bash | |
run: > | |
git clone --depth 1 https://github.com/microsoft/vcpkg ; | |
./vcpkg/bootstrap-vcpkg.sh ; | |
mono $(./vcpkg/vcpkg fetch nuget | tail -n 1) sources add | |
-Name "vcpkgbinarycache" | |
-Source http://93.49.111.10:5555/v3/index.json | |
- name: 'Build' | |
shell: pwsh | |
env: | |
CUDACXX: "/usr/local/cuda/bin/nvcc" | |
CUDA_PATH: "/usr/local/cuda" | |
CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda" | |
LD_LIBRARY_PATH: "/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH" | |
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -EnableCUDA -EnableCUDNN -DisableInteractive -DoNotUpdateTOOL | |
ubuntu-vcpkg-opencv3: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: Update apt | |
run: sudo apt update | |
- name: Install dependencies | |
run: sudo apt-get install -y --no-install-recommends yasm nasm gperf automake autoconf libtool pkg-config autoconf-archive libgles2-mesa-dev libx11-dev libxft-dev libxext-dev libxrandr-dev libxi-dev libxcursor-dev libxdamage-dev libxinerama-dev libdbus-1-dev libxtst-dev | |
- name: Clean downloads | |
run: sudo apt-get clean | |
- name: 'Setup vcpkg and NuGet artifacts backend' | |
shell: bash | |
run: > | |
git clone https://github.com/microsoft/vcpkg ; | |
./vcpkg/bootstrap-vcpkg.sh ; | |
mono $(./vcpkg/vcpkg fetch nuget | tail -n 1) sources add | |
-Name "vcpkgbinarycache" | |
-Source http://93.49.111.10:5555/v3/index.json | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -ForceOpenCVVersion 3 -DisableInteractive -DoNotUpdateTOOL | |
ubuntu-vcpkg-opencv2: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: Update apt | |
run: sudo apt update | |
- name: Install dependencies | |
run: sudo apt-get install -y --no-install-recommends yasm nasm gperf automake autoconf libtool pkg-config autoconf-archive libgles2-mesa-dev libx11-dev libxft-dev libxext-dev libxrandr-dev libxi-dev libxcursor-dev libxdamage-dev libxinerama-dev libdbus-1-dev libxtst-dev | |
- name: Clean downloads | |
run: sudo apt-get clean | |
- name: 'Setup vcpkg and NuGet artifacts backend' | |
shell: bash | |
run: > | |
git clone https://github.com/microsoft/vcpkg ; | |
./vcpkg/bootstrap-vcpkg.sh ; | |
mono $(./vcpkg/vcpkg fetch nuget | tail -n 1) sources add | |
-Name "vcpkgbinarycache" | |
-Source http://93.49.111.10:5555/v3/index.json | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -ForceOpenCVVersion 2 -DisableInteractive -DoNotUpdateTOOL | |
ubuntu: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update apt | |
run: sudo apt update | |
- name: Install dependencies | |
run: sudo apt install libopencv-dev | |
- uses: lukka/get-cmake@latest | |
- name: 'Build' | |
shell: pwsh | |
env: | |
CUDACXX: "/usr/local/cuda/bin/nvcc" | |
CUDA_PATH: "/usr/local/cuda" | |
CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda" | |
LD_LIBRARY_PATH: "/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH" | |
run: ${{ github.workspace }}/build.ps1 -EnableOPENCV -DisableInteractive -DoNotUpdateTOOL | |
ubuntu-cuda: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update apt | |
run: sudo apt update | |
- name: Install dependencies | |
run: sudo apt install libopencv-dev libgles2-mesa-dev | |
- uses: lukka/get-cmake@latest | |
- name: 'Install CUDA' | |
run: ${{ github.workspace }}/scripts/deploy-cuda.sh | |
- name: 'Create softlinks for CUDA' | |
run: | | |
source ${{ github.workspace }}/scripts/requested_cuda_version.sh | |
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so.1 | |
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so.1 | |
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so | |
- name: 'Build' | |
shell: pwsh | |
env: | |
CUDACXX: "/usr/local/cuda/bin/nvcc" | |
CUDA_PATH: "/usr/local/cuda" | |
CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda" | |
LD_LIBRARY_PATH: "/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH" | |
run: ${{ github.workspace }}/build.ps1 -EnableOPENCV -EnableCUDA -EnableCUDNN -DisableInteractive -DoNotUpdateTOOL | |
ubuntu-no-ocv-cpp: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -ForceCPP -DisableInteractive -DoNotUpdateTOOL | |
- name: Test on data/dog.jpg | |
shell: bash | |
run: > | |
wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights -O ${{ github.workspace }}/yolov4-tiny.weights; | |
${{ github.workspace }}/build_release/darknet detect ${{ github.workspace }}/cfg/yolov4-tiny.cfg ${{ github.workspace }}/yolov4-tiny.weights ${{ github.workspace }}/data/dog.jpg -dont_show | |
ubuntu-setup-sh: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Setup vcpkg and NuGet artifacts backend' | |
shell: bash | |
run: > | |
git clone --depth 1 https://github.com/microsoft/vcpkg ; | |
./vcpkg/bootstrap-vcpkg.sh ; | |
mono $(./vcpkg/vcpkg fetch nuget | tail -n 1) sources add | |
-Name "vcpkgbinarycache" | |
-Source http://93.49.111.10:5555/v3/index.json | |
- name: 'Setup' | |
shell: bash | |
run: ${{ github.workspace }}/scripts/setup.sh -InstallTOOLS -InstallCUDA -BypassDRIVER | |
osx-vcpkg: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: brew install libomp yasm nasm pkg-config automake autoconf-archive | |
- uses: lukka/get-cmake@latest | |
- name: 'Setup vcpkg and NuGet artifacts backend' | |
shell: bash | |
run: > | |
git clone --depth 1 https://github.com/microsoft/vcpkg ; | |
./vcpkg/bootstrap-vcpkg.sh ; | |
mono $(./vcpkg/vcpkg fetch nuget | tail -n 1) sources add | |
-Name "vcpkgbinarycache" | |
-Source http://93.49.111.10:5555/v3/index.json | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -DisableInteractive -DoNotUpdateTOOL | |
osx: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: brew install opencv libomp | |
- uses: lukka/get-cmake@latest | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -EnableOPENCV -DisableInteractive -DoNotUpdateTOOL | |
osx-no-ocv-no-omp-cpp: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -ForceCPP -DisableInteractive -DoNotUpdateTOOL | |
win-vcpkg: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: 'Setup vcpkg and NuGet artifacts backend' | |
shell: bash | |
run: > | |
git clone --depth 1 https://github.com/microsoft/vcpkg ; | |
./vcpkg/bootstrap-vcpkg.sh ; | |
$(./vcpkg/vcpkg fetch nuget | tail -n 1) sources add | |
-Name "vcpkgbinarycache" | |
-Source http://93.49.111.10:5555/v3/index.json | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -ForceLocalVCPKG -DoNotUpdateVCPKG -EnableOPENCV -DisableInteractive -DoNotUpdateTOOL | |
win-intlibs: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -DisableInteractive -DoNotUpdateTOOL | |
win-setup-ps1: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Setup vcpkg and NuGet artifacts backend' | |
shell: bash | |
run: > | |
git clone --depth 1 https://github.com/microsoft/vcpkg ; | |
./vcpkg/bootstrap-vcpkg.sh ; | |
$(./vcpkg/vcpkg fetch nuget | tail -n 1) sources add | |
-Name "vcpkgbinarycache" | |
-Source http://93.49.111.10:5555/v3/index.json | |
- name: 'Setup' | |
shell: pwsh | |
run: ${{ github.workspace }}/scripts/setup.ps1 -InstallCUDA | |
win-vcpkg-base-cpp: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: 'Setup vcpkg and NuGet artifacts backend' | |
shell: bash | |
run: > | |
git clone --depth 1 https://github.com/microsoft/vcpkg ; | |
./vcpkg/bootstrap-vcpkg.sh ; | |
$(./vcpkg/vcpkg fetch nuget | tail -n 1) sources add | |
-Name "vcpkgbinarycache" | |
-Source http://93.49.111.10:5555/v3/index.json | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -ForceLocalVCPKG -DoNotUpdateVCPKG -ForceCPP -DisableInteractive -DoNotUpdateTOOL | |
- name: Download yolov4-tiny.weights | |
run: curl.exe -L https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights -o ${{ github.workspace }}\yolov4-tiny.weights | |
- name: Test on data/dog.jpg | |
run: ${{ github.workspace }}\build_release\darknet.exe detect ${{ github.workspace }}\cfg\yolov4-tiny.cfg ${{ github.workspace }}\yolov4-tiny.weights ${{ github.workspace }}\data\dog.jpg | |
win-csharp: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: 'Build' | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -EnableCSharpWrapper -DisableInteractive -DoNotUpdateTOOL | |
win-intlibs-cuda: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Install CUDA' | |
run: ${{ github.workspace }}/scripts/deploy-cuda.ps1 | |
- uses: lukka/get-cmake@latest | |
- name: 'Build' | |
env: | |
CUDA_PATH: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6" | |
CUDA_TOOLKIT_ROOT_DIR: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6" | |
CUDACXX: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\bin\\nvcc.exe" | |
shell: pwsh | |
run: ${{ github.workspace }}/build.ps1 -EnableCUDA -DisableInteractive -DoNotUpdateTOOL | |
win-powershell51: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: 'Build' | |
shell: powershell | |
run: ${{ github.workspace }}/build.ps1 -DisableInteractive -DoNotUpdateTOOL | |
mingw: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: lukka/get-cmake@latest | |
- name: 'Build with CMake' | |
run: | | |
mkdir build_release | |
cd build_release | |
cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF | |
cmake --build . --config Release --target install |