Skip to content

Commit

Permalink
circumvent current upstream bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
cenit committed Apr 15, 2021
1 parent 56cd9c6 commit e1c02e0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
- name: 'Build'
shell: pwsh
run: ./build.ps1 -UseVCPKG -EnableOPENCV
run: ./build.ps1 -UseVCPKG

- uses: actions/upload-artifact@v2
with:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
15 changes: 14 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
}
Expand Down

0 comments on commit e1c02e0

Please sign in to comment.