add setup prerequisite script scaffolding

pull/2912/head
Stefano Sinigardi 6 years ago
parent 8c970498a2
commit 918fb0706e
  1. 4
      .gitignore
  2. 2
      DarknetConfig.cmake.in
  3. 43
      setup.ps1

4
.gitignore vendored

@ -34,6 +34,10 @@ Thumbs.db
.vs/
.vscode/
# Managed by CMake
src/version.h
# Build artifacts
lib/
include/
share/

@ -34,6 +34,8 @@ find_dependency(Threads)
if(MSVC)
find_dependency(PThreads_windows)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(CMAKE_CXX_FLAGS "/wd4018 /wd4244 /wd4267 /wd4305 ${CMAKE_CXX_FLAGS}")
endif()
if("${CMAKE_VERSION}" VERSION_GREATER "3.9.0")

@ -0,0 +1,43 @@
## enable or disable installed components
$install_cuda=$false
$vcpkg_folder=".\"
$temp_folder=".\temp"
###########################
New-Item -Path . -Name $temp_folder -ItemType "directory"
Set-Location $temp_folder
# Download and install Chocolatey
Set-ExecutionPolicy unrestricted
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco.exe install -y cmake ninja powershell git
# Download and install VS Build Tools
Invoke-WebRequest https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16 -OutFile .\vs_buildtools.exe
.\vs_buildtools.exe quiet add Microsoft.VisualStudio.Workload.VCTools includeRecommended
if ($install_cuda) {
# Download and install CUDA
Invoke-WebRequest https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_418.96_win10.exe -OutFile .\cuda_setup.exe
.\cuda_setup.exe -s nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 gpu_library_advisor_10.1 memcheck_10.1 nvdisasm_10.1 nvprof_10.1 visual_profiler_10.1 visual_studio_integration_10.1 cublas_10.1 cublas_dev_10.1 cudart_10.1 cufft_10.1 cufft_dev_10.1 curand_10.1 curand_dev_10.1 cusolver_10.1 cusolver_dev_10.1 cusparse_10.1 cusparse_dev_10.1 nvgraph_10.1 nvgraph_dev_10.1 npp_10.1 npp_dev_10.1 nvrtc_10.1 nvrtc_dev_10.1 nvml_dev_10.1 occupancy_calculator_10.1 fortran_examples_10.1
$env:CUDA_PATH = "${env:ProgramFiles}\NVIDIA GPU Computing Toolkit\CUDA\v10.1"
$env:CUDA_PATH_V10_1 = $env:CUDA_PATH
$env:CUDA_TOOLKIT_ROOT_DIR = $env:CUDA_PATH
$env:PATH += ";${env:CUDA_PATH}\bin;"
$feature = "opencv-cuda"
}
else {
$feature = "opencv"
}
Remove-Item -r $temp_folder
Set-Location ..
Set-Location $vcpkg_folder\
git.exe clone https://github.com/Microsoft/vcpkg
Set-Location vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg.exe install darknet[$feature]
Loading…
Cancel
Save