mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Merge pull request #2599 from cenit/dev/cenit/stb
move Stb lib to 3rdparty folder
This commit is contained in:
BIN
3rdparty/dll/x86/pthreadGC2.dll
vendored
BIN
3rdparty/dll/x86/pthreadGC2.dll
vendored
Binary file not shown.
BIN
3rdparty/dll/x86/pthreadGCE2.dll
vendored
BIN
3rdparty/dll/x86/pthreadGCE2.dll
vendored
Binary file not shown.
BIN
3rdparty/dll/x86/pthreadVC2.dll
vendored
BIN
3rdparty/dll/x86/pthreadVC2.dll
vendored
Binary file not shown.
BIN
3rdparty/dll/x86/pthreadVCE2.dll
vendored
BIN
3rdparty/dll/x86/pthreadVCE2.dll
vendored
Binary file not shown.
BIN
3rdparty/dll/x86/pthreadVSE2.dll
vendored
BIN
3rdparty/dll/x86/pthreadVSE2.dll
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libpthreadGC2.a
vendored
BIN
3rdparty/lib/x86/libpthreadGC2.a
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libpthreadGCE2.a
vendored
BIN
3rdparty/lib/x86/libpthreadGCE2.a
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/pthreadVC2.lib
vendored
BIN
3rdparty/lib/x86/pthreadVC2.lib
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/pthreadVCE2.lib
vendored
BIN
3rdparty/lib/x86/pthreadVCE2.lib
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/pthreadVSE2.lib
vendored
BIN
3rdparty/lib/x86/pthreadVSE2.lib
vendored
Binary file not shown.
@ -73,14 +73,12 @@ if(ENABLE_CUDA AND NOT CUDA_COMPUTE_MODEL)
|
||||
endif()
|
||||
|
||||
if(USE_INTEGRATED_LIBS)
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR}/3rdparty/include)
|
||||
set(PThreads_windows_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/3rdparty/include)
|
||||
set(PThreads_windows_LIBRARY ${CMAKE_CURRENT_LIST_DIR}/3rdparty/lib/x64/pthreadVC2.lib)
|
||||
set(PThreads_windows_DIR ${CMAKE_CURRENT_LIST_DIR}/3rdparty/pthreads CACHE PATH "Path where pthreads for windows can be located")
|
||||
add_definitions(-D_TIMESPEC_DEFINED)
|
||||
endif()
|
||||
set(Stb_DIR ${CMAKE_CURRENT_LIST_DIR}/3rdparty/stb CACHE PATH "Path where Stb image library can be located")
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX d)
|
||||
|
||||
add_definitions(-DUSE_CMAKE_LIBS)
|
||||
|
||||
if(MSVC)
|
||||
@ -108,6 +106,7 @@ set(ENABLE_OPENCV "TRUE" CACHE BOOL "Enable OpenCV integration")
|
||||
if(ENABLE_OPENCV)
|
||||
find_package(OpenCV)
|
||||
endif()
|
||||
find_package(Stb REQUIRED)
|
||||
|
||||
set(SKIP_USELIB_TRACK "FALSE" CACHE BOOL "Skip building uselib_track" FORCE)
|
||||
if(OpenCV_FOUND)
|
||||
@ -260,7 +259,7 @@ if(OpenCV_VERSION VERSION_GREATER "3.0" AND NOT SKIP_USELIB_TRACK)
|
||||
add_executable(uselib_track ${CMAKE_CURRENT_LIST_DIR}/src/yolo_console_dll.cpp)
|
||||
target_compile_definitions(uselib_track PRIVATE TRACK_OPTFLOW=1)
|
||||
set_target_properties(uselib_track PROPERTIES LINKER_LANGUAGE CXX)
|
||||
target_include_directories(uselib_track PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:include>)
|
||||
target_include_directories(uselib_track PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${Stb_INCLUDE_DIR}>)
|
||||
target_link_libraries(uselib_track PRIVATE ${OpenCV_LIBS})
|
||||
endif()
|
||||
|
||||
@ -271,9 +270,9 @@ add_executable(darknet ${CMAKE_CURRENT_LIST_DIR}/src/darknet.c ${sources} ${head
|
||||
set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/src/darknet.c PROPERTIES LANGUAGE CXX)
|
||||
set_target_properties(darknet PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
||||
target_include_directories(darknet PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:include>)
|
||||
target_include_directories(darklib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:include>)
|
||||
target_include_directories(uselib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:include>)
|
||||
target_include_directories(darknet PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${Stb_INCLUDE_DIR}>)
|
||||
target_include_directories(darklib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${Stb_INCLUDE_DIR}>)
|
||||
target_include_directories(uselib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${Stb_INCLUDE_DIR}>)
|
||||
|
||||
if(CUDNN_FOUND)
|
||||
target_link_libraries(darknet PRIVATE CuDNN::CuDNN)
|
||||
|
@ -20,9 +20,8 @@
|
||||
"cmakeCommandArgs": "",
|
||||
"configurationType": "Debug",
|
||||
"generator": "Visual Studio 15 2017 Win64",
|
||||
"name": "x64-Debug",
|
||||
"variables": [
|
||||
{
|
||||
"name": "x64-Debug static",
|
||||
"variables": [{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
|
||||
},
|
||||
@ -35,16 +34,14 @@
|
||||
"value": "${env.VCPKG_DEFAULT_TRIPLET}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
}, {
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"configurationType": "Release",
|
||||
"generator": "Visual Studio 15 2017 Win64",
|
||||
"name": "x64-Release",
|
||||
"variables": [
|
||||
{
|
||||
"name": "x64-Release static",
|
||||
"variables": [{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
|
||||
},
|
||||
@ -57,6 +54,159 @@
|
||||
"value": "${env.VCPKG_DEFAULT_TRIPLET}"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"configurationType": "Debug",
|
||||
"generator": "Visual Studio 15 2017 Win64",
|
||||
"name": "x64-Debug static w/ CUDA",
|
||||
"variables": [{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "USE_INTEGRATED_LIBS",
|
||||
"value": "FALSE"
|
||||
},
|
||||
{
|
||||
"name": "CUDA_COMPUTE_MODEL",
|
||||
"value": "30"
|
||||
},
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "${env.VCPKG_DEFAULT_TRIPLET}"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"configurationType": "Release",
|
||||
"generator": "Visual Studio 15 2017 Win64",
|
||||
"name": "x64-Release static w/ CUDA",
|
||||
"variables": [{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "USE_INTEGRATED_LIBS",
|
||||
"value": "FALSE"
|
||||
},
|
||||
{
|
||||
"name": "CUDA_COMPUTE_MODEL",
|
||||
"value": "30"
|
||||
},
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "${env.VCPKG_DEFAULT_TRIPLET}"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"configurationType": "Debug",
|
||||
"generator": "Visual Studio 15 2017 Win64",
|
||||
"name": "x64-Debug dynamic",
|
||||
"variables": [{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "USE_INTEGRATED_LIBS",
|
||||
"value": "FALSE"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "TRUE"
|
||||
},
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "${env.VCPKG_DEFAULT_TRIPLET}"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"configurationType": "Release",
|
||||
"generator": "Visual Studio 15 2017 Win64",
|
||||
"name": "x64-Release dynamic",
|
||||
"variables": [{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "USE_INTEGRATED_LIBS",
|
||||
"value": "FALSE"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "TRUE"
|
||||
},
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "${env.VCPKG_DEFAULT_TRIPLET}"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"configurationType": "Debug",
|
||||
"generator": "Visual Studio 15 2017 Win64",
|
||||
"name": "x64-Debug dynamic w/ CUDA",
|
||||
"variables": [{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "USE_INTEGRATED_LIBS",
|
||||
"value": "FALSE"
|
||||
},
|
||||
{
|
||||
"name": "CUDA_COMPUTE_MODEL",
|
||||
"value": "30"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "TRUE"
|
||||
},
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "${env.VCPKG_DEFAULT_TRIPLET}"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"configurationType": "Release",
|
||||
"generator": "Visual Studio 15 2017 Win64",
|
||||
"name": "x64-Release dynamic w/ CUDA",
|
||||
"variables": [{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
|
||||
},
|
||||
{
|
||||
"name": "USE_INTEGRATED_LIBS",
|
||||
"value": "FALSE"
|
||||
},
|
||||
{
|
||||
"name": "CUDA_COMPUTE_MODEL",
|
||||
"value": "30"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "TRUE"
|
||||
},
|
||||
{
|
||||
"name": "VCPKG_TARGET_TRIPLET",
|
||||
"value": "${env.VCPKG_DEFAULT_TRIPLET}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -6,10 +6,15 @@
|
||||
# Compute paths
|
||||
get_filename_component(Darknet_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
set(Darknet_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
|
||||
list(APPEND CMAKE_MODULE_PATH "${Darknet_CMAKE_DIR}")
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(OpenCV REQUIRED)
|
||||
if(@ENABLE_OPENCV@)
|
||||
find_dependency(OpenCV REQUIRED)
|
||||
endif()
|
||||
|
||||
find_dependency(Stb REQUIRED HINTS "@Stb_DIR@")
|
||||
|
||||
if(@ENABLE_CUDA@)
|
||||
find_dependency(CUDNN)
|
||||
@ -18,11 +23,11 @@ endif()
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
||||
find_dependency(Threads)
|
||||
|
||||
if(@MSVC@)
|
||||
if(MSVC)
|
||||
find_dependency(PThreads_windows)
|
||||
endif()
|
||||
|
||||
if("@CMAKE_VERSION@" VERSION_GREATER "3.9.0")
|
||||
if("${CMAKE_VERSION}" VERSION_GREATER "3.9.0")
|
||||
find_dependency(OpenMP)
|
||||
endif()
|
||||
|
||||
|
23
Makefile
23
Makefile
@ -33,7 +33,7 @@ OS := $(shell uname)
|
||||
# GTX 1080, GTX 1070, GTX 1060, GTX 1050, GTX 1030, Titan Xp, Tesla P40, Tesla P4
|
||||
# ARCH= -gencode arch=compute_61,code=sm_61 -gencode arch=compute_61,code=compute_61
|
||||
|
||||
# GP100/Tesla P100 DGX-1
|
||||
# GP100/Tesla P100 - DGX-1
|
||||
# ARCH= -gencode arch=compute_60,code=sm_60
|
||||
|
||||
# For Jetson TX1, Tegra X1, DRIVE CX, DRIVE PX - uncomment:
|
||||
@ -54,30 +54,30 @@ endif
|
||||
|
||||
CC=gcc
|
||||
CPP=g++
|
||||
NVCC=nvcc
|
||||
NVCC=nvcc
|
||||
OPTS=-Ofast
|
||||
LDFLAGS= -lm -pthread
|
||||
COMMON= -Iinclude/
|
||||
LDFLAGS= -lm -pthread
|
||||
COMMON= -Iinclude/ -I3rdparty/stb/include
|
||||
CFLAGS=-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
ifeq ($(DEBUG), 1)
|
||||
#OPTS= -O0 -g
|
||||
#OPTS= -Og -g
|
||||
COMMON+= -DDEBUG
|
||||
CFLAGS+= -DDEBUG
|
||||
else
|
||||
ifeq ($(AVX), 1)
|
||||
ifeq ($(AVX), 1)
|
||||
CFLAGS+= -ffp-contract=fast -mavx -mavx2 -msse3 -msse4.1 -msse4.2 -msse4a
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS+=$(OPTS)
|
||||
|
||||
ifeq ($(OPENCV), 1)
|
||||
ifeq ($(OPENCV), 1)
|
||||
COMMON+= -DOPENCV
|
||||
CFLAGS+= -DOPENCV
|
||||
LDFLAGS+= `pkg-config --libs opencv`
|
||||
COMMON+= `pkg-config --cflags opencv`
|
||||
LDFLAGS+= `pkg-config --libs opencv`
|
||||
COMMON+= `pkg-config --cflags opencv`
|
||||
endif
|
||||
|
||||
ifeq ($(OPENMP), 1)
|
||||
@ -129,12 +129,12 @@ DEPS = $(wildcard src/*.h) Makefile include/darknet.h
|
||||
|
||||
all: obj backup results setchmod $(EXEC) $(LIBNAMESO) $(APPNAMESO)
|
||||
|
||||
ifeq ($(LIBSO), 1)
|
||||
ifeq ($(LIBSO), 1)
|
||||
CFLAGS+= -fPIC
|
||||
|
||||
$(LIBNAMESO): $(OBJS) include/yolo_v2_class.hpp src/yolo_v2_class.cpp
|
||||
$(CPP) -shared -std=c++11 -fvisibility=hidden -DLIB_EXPORTS $(COMMON) $(CFLAGS) $(OBJS) src/yolo_v2_class.cpp -o $@ $(LDFLAGS)
|
||||
|
||||
|
||||
$(APPNAMESO): $(LIBNAMESO) include/yolo_v2_class.hpp src/yolo_console_dll.cpp
|
||||
$(CPP) -std=c++11 $(COMMON) $(CFLAGS) -o $@ src/yolo_console_dll.cpp $(LDFLAGS) -L ./ -l:$(LIBNAMESO)
|
||||
endif
|
||||
@ -164,4 +164,3 @@ setchmod:
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJS) $(EXEC) $(LIBNAMESO) $(APPNAMESO)
|
||||
|
||||
|
@ -183,9 +183,9 @@ PS \> cd $env:VCPKG_ROOT
|
||||
PS Code\vcpkg> .\vcpkg install pthreads opencv #replace with opencv[cuda] in case you want to use cuda-accelerated openCV
|
||||
```
|
||||
|
||||
8. [necessary only with CUDA] Customize the CMakeLists.txt with the preferred compute capability
|
||||
8. [necessary only with CUDA] Customize the `build.ps1` script enabling the appropriate `my_cuda_compute_model` line. If not manually defined, CMake toolchain will automatically use the very low 3.0 CUDA compute model
|
||||
|
||||
9. Build with the Powershell script `build.ps1` or use the "Open Folder" functionality of Visual Studio 2017. In the first option, if you want to use Visual Studio, you will find a custom solution created for you by CMake after the build containing all the appropriate config flags for your system.
|
||||
9. Build with the Powershell script `build.ps1`. If you want to use Visual Studio, you will find a custom solution created for you by CMake after the build containing all the appropriate config flags for your system.
|
||||
|
||||
### How to compile on Windows (legacy way)
|
||||
|
||||
|
63
build.ps1
63
build.ps1
@ -2,12 +2,25 @@
|
||||
|
||||
$number_of_build_workers=8
|
||||
#$shared_lib="-DBUILD_SHARED_LIBS:BOOL=ON"
|
||||
$force_using_include_libs=$false
|
||||
|
||||
if (Test-Path env:VCPKG_ROOT) {
|
||||
#$my_cuda_compute_model=75 #Compute capability for Tesla T4, RTX 2080
|
||||
#$my_cuda_compute_model=72 #Compute capability for Jetson Xavier
|
||||
#$my_cuda_compute_model=70 #Compute capability for Tesla V100
|
||||
#$my_cuda_compute_model=62 #Compute capability for Jetson TX2
|
||||
#$my_cuda_compute_model=61 #Compute capability for Tesla P40
|
||||
#$my_cuda_compute_model=60 #Compute capability for Tesla P100
|
||||
#$my_cuda_compute_model=53 #Compute capability for Jetson TX1
|
||||
#$my_cuda_compute_model=52 #Compute capability for Tesla M40/M60
|
||||
#$my_cuda_compute_model=37 #Compute capability for Tesla K80
|
||||
#$my_cuda_compute_model=35 #Compute capability for Tesla K20/K40
|
||||
#$my_cuda_compute_model=30 #Compute capability for Tesla K10, Quadro K4000
|
||||
|
||||
if ((Test-Path env:VCPKG_ROOT) -and -not $force_using_include_libs) {
|
||||
$vcpkg_path = "$env:VCPKG_ROOT"
|
||||
Write-Host "Found vcpkg in VCPKG_ROOT: $vcpkg_path"
|
||||
}
|
||||
elseif (Test-Path "${env:WORKSPACE}\vcpkg") {
|
||||
elseif ((Test-Path "${env:WORKSPACE}\vcpkg") -and -not $force_using_include_libs) {
|
||||
$vcpkg_path = "${env:WORKSPACE}\vcpkg"
|
||||
Write-Host "Found vcpkg in WORKSPACE\vcpkg: $vcpkg_path"
|
||||
}
|
||||
@ -67,39 +80,39 @@ if (Test-Path env:CUDA_PATH) {
|
||||
}
|
||||
}
|
||||
|
||||
if (Test-Path $vcpkg_path) {
|
||||
# RELEASE
|
||||
New-Item -Path .\build_win_release -ItemType directory -Force
|
||||
Set-Location build_win_release
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Release" $shared_lib ..
|
||||
cmake --build . --config Release --parallel ${number_of_build_workers} --target install
|
||||
Remove-Item DarknetConfig.cmake
|
||||
Remove-Item DarknetConfigVersion.cmake
|
||||
Set-Location ..
|
||||
# Remove-Item -Force DarknetConfig.cmake
|
||||
# Remove-Item -Force DarknetConfigVersion.cmake
|
||||
if($my_cuda_compute_model) {
|
||||
$additional_build_setup = "-DCUDA_COMPUTE_MODEL=${my_cuda_compute_model}"
|
||||
}
|
||||
|
||||
if ($vcpkg_path) {
|
||||
# DEBUG
|
||||
New-Item -Path .\build_win_debug -ItemType directory -Force
|
||||
Set-Location build_win_debug
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Debug" $shared_lib ..
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Debug" $shared_lib $additional_build_setup ..
|
||||
cmake --build . --config Debug --parallel ${number_of_build_workers} --target install
|
||||
Remove-Item DarknetConfig.cmake
|
||||
Remove-Item DarknetConfigVersion.cmake
|
||||
Set-Location ..
|
||||
# Remove-Item -Force DarknetConfig.cmake
|
||||
# Remove-Item -Force DarknetConfigVersion.cmake
|
||||
}
|
||||
else {
|
||||
# USE LOCAL PTHREAD LIB, NO VCPKG, ONLY RELEASE
|
||||
# if you want to manually force this case, remove VCPKG_ROOT env variable and remember to use "vcpkg integrate remove" in case you had enabled user-wide vcpkg integration
|
||||
New-Item -Path .\build_win_release_novcpkg -ItemType directory -Force
|
||||
Set-Location build_win_release_novcpkg
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" $shared_lib ..
|
||||
|
||||
# RELEASE
|
||||
New-Item -Path .\build_win_release -ItemType directory -Force
|
||||
Set-Location build_win_release
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Release" $shared_lib $additional_build_setup ..
|
||||
cmake --build . --config Release --parallel ${number_of_build_workers} --target install
|
||||
Remove-Item DarknetConfig.cmake
|
||||
Remove-Item DarknetConfigVersion.cmake
|
||||
Copy-Item *.dll ..
|
||||
Set-Location ..
|
||||
}
|
||||
else {
|
||||
# USE LOCAL PTHREAD LIB AND LOCAL STB HEADER, NO VCPKG, ONLY RELEASE MODE SUPPORTED
|
||||
# if you want to manually force this case, remove VCPKG_ROOT env variable and remember to use "vcpkg integrate remove" in case you had enabled user-wide vcpkg integration
|
||||
New-Item -Path .\build_win_release_novcpkg -ItemType directory -Force
|
||||
Set-Location build_win_release_novcpkg
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" $shared_lib $additional_build_setup ..
|
||||
cmake --build . --config Release --parallel ${number_of_build_workers} --target install
|
||||
Remove-Item DarknetConfig.cmake
|
||||
Remove-Item DarknetConfigVersion.cmake
|
||||
Copy-Item ..\3rdparty\pthreads\bin\pthreadVC2.dll ..
|
||||
Set-Location ..
|
||||
# Remove-Item -Force DarknetConfig.cmake
|
||||
# Remove-Item -Force DarknetConfigVersion.cmake
|
||||
}
|
||||
|
14
build.sh
14
build.sh
@ -18,11 +18,10 @@ cd build_release
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release ${additional_defines}
|
||||
cmake --build . --target install -- -j${number_of_build_workers}
|
||||
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
|
||||
rm DarknetConfig.cmake
|
||||
rm DarknetConfigVersion.cmake
|
||||
rm -f DarknetConfig.cmake
|
||||
rm -f DarknetConfigVersion.cmake
|
||||
cd ..
|
||||
rm DarknetConfig.cmake
|
||||
rm DarknetConfigVersion.cmake
|
||||
cp cmake/Modules/*.cmake share/darknet
|
||||
|
||||
# DEBUG
|
||||
mkdir -p build_debug
|
||||
@ -30,8 +29,7 @@ cd build_debug
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug ${additional_defines}
|
||||
cmake --build . --target install -- -j${number_of_build_workers}
|
||||
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
|
||||
rm DarknetConfig.cmake
|
||||
rm DarknetConfigVersion.cmake
|
||||
rm -f DarknetConfig.cmake
|
||||
rm -f DarknetConfigVersion.cmake
|
||||
cd ..
|
||||
rm DarknetConfig.cmake
|
||||
rm DarknetConfigVersion.cmake
|
||||
cp cmake/Modules/*.cmake share/darknet
|
||||
|
@ -1,43 +0,0 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License.
|
||||
# Copyright Stefano Sinigardi
|
||||
|
||||
#.rst:
|
||||
# FindDarknet
|
||||
# ------------
|
||||
#
|
||||
# Find the Darknet includes and library.
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# ``Darknet_FOUND``
|
||||
# True if Darknet library found
|
||||
#
|
||||
# ``Darknet_INCLUDE_DIR``
|
||||
# Location of Darknet headers
|
||||
#
|
||||
# ``Darknet_LIBRARY``
|
||||
# List of libraries to link with when using Darknet
|
||||
#
|
||||
|
||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
|
||||
|
||||
if(NOT Darknet_INCLUDE_DIR)
|
||||
find_path(Darknet_INCLUDE_DIR NAMES darknet.h PATHS darknet darknet/include)
|
||||
endif()
|
||||
|
||||
# Allow libraries to be set manually
|
||||
if(NOT Darknet_LIBRARY)
|
||||
find_library(Darknet_LIBRARY_RELEASE NAMES darklib PATHS darknet darknet/lib)
|
||||
find_library(Darknet_LIBRARY_DEBUG NAMES darklibd PATHS darknet darknet/lib)
|
||||
select_library_configurations(Darknet)
|
||||
endif()
|
||||
|
||||
set(Darknet_INCLUDE_DIRS "${Darknet_INCLUDE_DIR}")
|
||||
set(Darknet_LIBRARIES "${Darknet_LIBRARY}")
|
||||
|
||||
find_package_handle_standard_args(Darknet DEFAULT_MSG Darknet_LIBRARY Darknet_INCLUDE_DIR)
|
||||
mark_as_advanced(Darknet_INCLUDE_DIR Darknet_INCLUDE_DIRS Darknet_LIBRARY Darknet_LIBRARIES)
|
@ -26,13 +26,13 @@ include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
|
||||
|
||||
if(NOT PThreads_windows_INCLUDE_DIR)
|
||||
find_path(PThreads_windows_INCLUDE_DIR NAMES pthread.h)
|
||||
find_path(PThreads_windows_INCLUDE_DIR NAMES pthread.h PATHS ${PThreads_windows_DIR} PATH_SUFFIXES include)
|
||||
endif()
|
||||
|
||||
# Allow libraries to be set manually
|
||||
if(NOT PThreads_windows_LIBRARY)
|
||||
find_library(PThreads_windows_LIBRARY_RELEASE NAMES pthreadsVC2 pthreadVC2)
|
||||
find_library(PThreads_windows_LIBRARY_DEBUG NAMES pthreadsVC2d pthreadVC2d)
|
||||
find_library(PThreads_windows_LIBRARY_RELEASE NAMES pthreadsVC2 pthreadVC2 PATHS ${PThreads_windows_DIR} PATH_SUFFIXES lib)
|
||||
find_library(PThreads_windows_LIBRARY_DEBUG NAMES pthreadsVC2d pthreadVC2d PATHS ${PThreads_windows_DIR} PATH_SUFFIXES lib)
|
||||
select_library_configurations(PThreads_windows)
|
||||
endif()
|
||||
|
||||
@ -70,7 +70,7 @@ if( PThreads_windows_FOUND AND NOT TARGET PThreads_windows::PThreads_windows )
|
||||
else()
|
||||
add_library( PThreads_windows::PThreads_windows UNKNOWN IMPORTED )
|
||||
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${PThreads_windows_LIBRARY}"
|
||||
IMPORTED_LOCATION_RELEASE "${PThreads_windows_LIBRARY_RELEASE}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PThreads_windows_INCLUDE_DIR}"
|
||||
IMPORTED_CONFIGURATIONS Release
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
|
||||
|
30
cmake/Modules/FindStb.cmake
Executable file
30
cmake/Modules/FindStb.cmake
Executable file
@ -0,0 +1,30 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License.
|
||||
# Copyright Stefano Sinigardi
|
||||
|
||||
#.rst:
|
||||
# FindStb
|
||||
# ------------
|
||||
#
|
||||
# Find the Stb include headers.
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# ``Stb_FOUND``
|
||||
# True if Stb library found
|
||||
#
|
||||
# ``Stb_INCLUDE_DIR``
|
||||
# Location of Stb headers
|
||||
#
|
||||
|
||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
|
||||
|
||||
if(NOT Stb_INCLUDE_DIR)
|
||||
find_path(Stb_INCLUDE_DIR NAMES stb_image.h PATHS ${Stb_DIR} PATH_SUFFIXES include)
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(Stb DEFAULT_MSG Stb_INCLUDE_DIR)
|
||||
mark_as_advanced(Stb_INCLUDE_DIR)
|
0
image_yolov2.sh
Normal file → Executable file
0
image_yolov2.sh
Normal file → Executable file
0
image_yolov3.sh
Normal file → Executable file
0
image_yolov3.sh
Normal file → Executable file
0
json_mjpeg_streams.sh
Normal file → Executable file
0
json_mjpeg_streams.sh
Normal file → Executable file
0
net_cam_v3.sh
Normal file → Executable file
0
net_cam_v3.sh
Normal file → Executable file
0
video_v2.sh
Normal file → Executable file
0
video_v2.sh
Normal file → Executable file
0
video_yolov3.sh
Normal file → Executable file
0
video_yolov3.sh
Normal file → Executable file
Reference in New Issue
Block a user