Merge pull request #2912 from cenit/dev/cenit/setup

add setup prerequisite script scaffolding
pull/6241/head
Alexey 6 years ago committed by GitHub
commit 213b82a1bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .travis.yml
  2. 2
      appveyor.yml
  3. 40
      scripts/setup.ps1
  4. 48
      scripts/setup.sh

@ -79,7 +79,7 @@ matrix:
osx_image: xcode10.1 osx_image: xcode10.1
env: env:
- additional_defines="-DBUILD_SHARED_LIBS=OFF" - additional_defines="-DBUILD_SHARED_LIBS=OFF"
- MATRIX_EVAL="brew install gcc && brew install yasm && unset CC && unset CXX" - MATRIX_EVAL="brew install yasm && unset CC && unset CXX"
- USE_VCPKG=true - USE_VCPKG=true
- VCPKG_DEFINES="-DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake" - VCPKG_DEFINES="-DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake"
@ -217,6 +217,7 @@ install:
- pushd $HOME - pushd $HOME
- if [ -d "$HOME/vcpkg/.git" ] ; then echo vcpkg cached ; else rm -rf vcpkg ; git clone https://github.com/Microsoft/vcpkg ; fi - if [ -d "$HOME/vcpkg/.git" ] ; then echo vcpkg cached ; else rm -rf vcpkg ; git clone https://github.com/Microsoft/vcpkg ; fi
- cd vcpkg - cd vcpkg
- git checkout .
- git pull - git pull
- if [ "${USE_VCPKG}" = true ] ; then ./bootstrap-vcpkg.sh ; fi - if [ "${USE_VCPKG}" = true ] ; then ./bootstrap-vcpkg.sh ; fi
- if [ "${USE_VCPKG}" = true ] ; then echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x64-osx.cmake ; fi - if [ "${USE_VCPKG}" = true ] ; then echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x64-osx.cmake ; fi
@ -226,6 +227,7 @@ install:
#- if [ "${USE_VCPKG}" = true ] && [[ ! -z "${CUDACXX}" ]] ; then travis_wait 45 ./vcpkg install opencv[ffmpeg,cuda] --recurse; fi #- if [ "${USE_VCPKG}" = true ] && [[ ! -z "${CUDACXX}" ]] ; then travis_wait 45 ./vcpkg install opencv[ffmpeg,cuda] --recurse; fi
#- if [ "${USE_VCPKG}" = true ] && [[ -z "${CUDACXX}" ]] ; then travis_wait 45 ./vcpkg install opencv[ffmpeg] --recurse; fi #- if [ "${USE_VCPKG}" = true ] && [[ -z "${CUDACXX}" ]] ; then travis_wait 45 ./vcpkg install opencv[ffmpeg] --recurse; fi
- if [ "${USE_VCPKG}" = true ] ; then travis_wait 45 ./vcpkg install opencv[ffmpeg] --recurse; fi - if [ "${USE_VCPKG}" = true ] ; then travis_wait 45 ./vcpkg install opencv[ffmpeg] --recurse; fi
- if [ "${USE_VCPKG}" = true ] ; then rm -rf buildtrees; fi
- popd - popd
before_script: before_script:

@ -57,6 +57,7 @@ install:
- if [%COMPILER%]==[cygwin] %CYGSH% 'make install' - if [%COMPILER%]==[cygwin] %CYGSH% 'make install'
- if [%COMPILER%]==[cygwin] cd %WORKSPACE% - if [%COMPILER%]==[cygwin] cd %WORKSPACE%
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] cd %VCPKG_ROOT% - if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] cd %VCPKG_ROOT%
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] git checkout .
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] git pull - if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] git pull
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] .\bootstrap-vcpkg.bat - if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] .\bootstrap-vcpkg.bat
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] echo set(VCPKG_BUILD_TYPE release) >> triplets\%VCPKG_DEFAULT_TRIPLET%.cmake - if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] echo set(VCPKG_BUILD_TYPE release) >> triplets\%VCPKG_DEFAULT_TRIPLET%.cmake
@ -64,6 +65,7 @@ install:
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] vcpkg install stb pthreads --recurse - if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] vcpkg install stb pthreads --recurse
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] vcpkg install ffmpeg --recurse - if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] vcpkg install ffmpeg --recurse
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] vcpkg install opencv[ffmpeg] --recurse ## opencv[ffmpeg,cuda] is too big to build, timing out (>1h). We use plain openCV also for CUDA builds (toolchain can manage this strange situation anyway) - if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] vcpkg install opencv[ffmpeg] --recurse ## opencv[ffmpeg,cuda] is too big to build, timing out (>1h). We use plain openCV also for CUDA builds (toolchain can manage this strange situation anyway)
- if [%COMPILER%]==[vs] if NOT [%USE_INTEGRATED_LIBS%]==[yes] rmdir "buildtrees" /S /Q
- cd %WORKSPACE%\darknet\ - cd %WORKSPACE%\darknet\
- if [%COMPILER%]==[cygwin] mkdir build_debug && cd build_debug - if [%COMPILER%]==[cygwin] mkdir build_debug && cd build_debug
- if [%COMPILER%]==[cygwin] %CYGSH% 'cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug"' - if [%COMPILER%]==[cygwin] %CYGSH% 'cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug"'

@ -0,0 +1,40 @@
## 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 vscode
choco-exe install -y visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.CoreBuildTools --includeRecommended --includeOptional --passive --locale en-US --lang en-US"
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;"
$features = "full"
}
else {
$features = "opencv-base,weights,weights-train"
}
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[${features}]:x64-windows

@ -0,0 +1,48 @@
#!/usr/bin/env bash
## enable or disable installed components
install_cuda=false
vcpkg_folder="."
temp_folder="./temp"
###########################
mkdir $temp_folder
cd $temp_folder
sudo apt-get install cmake git ninja-build build-essentials g++
if [ "$install_cuda" = true ] ; then
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Unable to provide CUDA on macOS"
else
# Download and install CUDA
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub
sudo dpkg -i cuda-repo-ubuntu1404_10.0.130-1_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64/nvidia-machine-learning-repo-ubuntu1404_4.0-2_amd64.deb
sudo dpkg -i nvidia-machine-learning-repo-ubuntu1404_4.0-2_amd64.deb
sudo apt-get -y update
sudo apt-get install -y --no-install-recommends cuda-compiler-10-0 cuda-libraries-dev-10-0 cuda-driver-dev-10-0 cuda-cudart-dev-10-0 cuda-cublas-dev-10-0 cuda-curand-dev-10-0
sudo apt-get install -y --no-install-recommends libcudnn7-dev
sudo ln -s /usr/local/cuda-10.0/lib64/stubs/libcuda.so /usr/local/cuda-10.0/lib64/stubs/libcuda.so.1
export CUDACXX=/usr/local/cuda-10.0/bin/nvcc
export CUDA_PATH=/usr/local/cuda-10.0
export CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.0
export LD_LIBRARY_PATH="/usr/local/cuda-10.0/lib64:/usr/local/cuda-10.0/lib64/stubs:${LD_LIBRARY_PATH}"
features = "full"
fi
else
features = "opencv-base,weights,weights-train"
fi
rm -rf $temp_folder
cd ..
cd $vcpkg_folder
git clone https://github.com/Microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg install darknet[${features}]
Loading…
Cancel
Save