diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 09d5f070314..077b3cf99f8 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -124,7 +124,7 @@ jobs: 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: ./build.ps1 -UseVCPKG -EnableOPENCV -EnableCUDA + run: ./build.ps1 -UseVCPKG -EnableOPENCV -EnableCUDA -ForceStaticLib - uses: actions/upload-artifact@v2 with: @@ -279,7 +279,7 @@ jobs: - name: 'Build' shell: pwsh - run: ./build.ps1 -UseVCPKG -EnableOPENCV + run: ./build.ps1 -UseVCPKG - uses: actions/upload-artifact@v2 with: diff --git a/README.md b/README.md index 5bf7c0faf6b..02b729aef5c 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,7 @@ You can get cfg-files by path: `darknet/cfg/` ### Requirements * **CMake >= 3.18**: https://cmake.org/download/ +* **Powershell**: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell * **CUDA >= 10.2**: https://developer.nvidia.com/cuda-toolkit-archive (on Linux do [Post-installation Actions](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions)) * **OpenCV >= 2.4**: use your preferred package manager (brew, apt), build from source using [vcpkg](https://github.com/Microsoft/vcpkg) or download from [OpenCV official site](https://opencv.org/releases.html) (on Windows set system variable `OpenCV_DIR` = `C:\opencv\build` - where are the `include` and `x64` folders [image](https://user-images.githubusercontent.com/4096485/53249516-5130f480-36c9-11e9-8238-a6e82e48c6f2.png)) * **cuDNN >= 8.0.2** https://developer.nvidia.com/rdp/cudnn-archive (on **Linux** copy `cudnn.h`,`libcudnn.so`... as desribed here https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installlinux-tar , on **Windows** copy `cudnn.h`,`cudnn64_7.dll`, `cudnn64_7.lib` as desribed here https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installwindows ) diff --git a/build.ps1 b/build.ps1 index bb953622e7b..7a38d0d250d 100755 --- a/build.ps1 +++ b/build.ps1 @@ -8,7 +8,9 @@ param ( [switch]$UseVCPKG = $false, [switch]$DoNotSetupVS = $false, [switch]$DoNotUseNinja = $false, - [switch]$ForceCPP = $false + [switch]$ForceCPP = $false, + [switch]$ForceStaticLib = $false, + [switch]$ForceGCC8 = $false ) $number_of_build_workers = 8 @@ -18,6 +20,17 @@ if (-Not $IsWindows) { $DoNotSetupVS = $true } +if ($ForceStaticLib) { + Write-Host "Forced CMake to produce a static library" + $additional_build_setup = " -DBUILD_SHARED_LIBS=OFF " +} + +if ($IsLinux -and $ForceGCC8) { + Write-Host "Manually setting CC and CXX variables to gcc-8 and g++-8" + $env:CC = "gcc-8" + $env:CXX = "g++-8" +} + if ($IsWindows -and -Not $env:VCPKG_DEFAULT_TRIPLET) { $env:VCPKG_DEFAULT_TRIPLET = "x64-windows" }