diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 997dd9d1..6d430e2a 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -8,28 +8,21 @@ jobs: steps: - uses: actions/checkout@v2 - # Install system dependencies - name: Update apt run: sudo apt update - name: Install dependencies run: sudo apt install yasm - # Install latest CMake. - uses: lukka/get-cmake@latest - # Restore from cache the previously built ports. If "cache miss", then provision vcpkg, install desired ports, finally cache everything for the next run. - name: Restore from cache and run vcpkg env: vcpkgResponseFile: ${{ github.workspace }}/cmake/vcpkg_linux.diff uses: lukka/run-vcpkg@v2 with: - # Response file stored in source control, it provides the list of ports and triplet(s). vcpkgArguments: '@${{ env.vcpkgResponseFile }}' - # Location of the vcpkg as submodule of the repository. vcpkgDirectory: '${{ github.workspace }}/vcpkg' vcpkgGitCommitId: '2bc6cd714f931c32d3299a137d5abe0f86f803e1' - # Since the cache must be invalidated when content of the response file changes, let's - # compute its hash and append this to the computed cache's key. appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }} - name: 'Build with CMake and Ninja' @@ -66,13 +59,11 @@ jobs: steps: - uses: actions/checkout@v2 - # Install system dependencies - name: Update apt run: sudo apt update - name: Install dependencies run: sudo apt install libopencv-dev - # Install latest CMake. - uses: lukka/get-cmake@latest - name: 'Build with CMake and Ninja' @@ -104,12 +95,76 @@ jobs: path: ${{ github.workspace }}/uselib* + linux-build-with-cuda: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Update apt + run: sudo apt update + - name: Install dependencies + run: sudo apt install libopencv-dev + + - uses: lukka/get-cmake@latest + + - name: 'Install CUDA' + env: + INSTALL_CUDA_VERSION: "10.2" + CUDACXX: "/usr/local/cuda-10.2/bin/nvcc" + CUDA_PATH: "/usr/local/cuda-10.2" + CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda-10.2" + LD_LIBRARY_PATH: "/usr/local/cuda-10.2/lib64:/usr/local/cuda-10.2/lib64/stubs:$LD_LIBRARY_PATH" + run: | + wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.2.89-1_amd64.deb + sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub + sudo dpkg -i cuda-repo-ubuntu1804_10.2.89-1_amd64.deb + wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb + sudo dpkg -i nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb + sudo apt update + sudo apt-get install -y --no-install-recommends cuda-compiler-10-2 cuda-libraries-dev-10-2 cuda-driver-dev-10-2 cuda-cudart-dev-10-2 cuda-curand-dev-10-2 + sudo apt-get install -y --no-install-recommends libcudnn7-dev + sudo ln -s /usr/local/cuda-${{ env.INSTALL_CUDA_VERSION }}/lib64/stubs/libcuda.so /usr/local/cuda-${{ env.INSTALL_CUDA_VERSION }}/lib64/stubs/libcuda.so.1 + + - name: 'Build with CMake and Ninja' + env: + INSTALL_CUDA_VERSION: "10.2" + CUDACXX: "/usr/local/cuda-10.2/bin/nvcc" + CUDA_PATH: "/usr/local/cuda-10.2" + CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda-10.2" + LD_LIBRARY_PATH: "/usr/local/cuda-10.2/lib64:/usr/local/cuda-10.2/lib64/stubs:$LD_LIBRARY_PATH" + uses: lukka/run-cmake@v2 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + useVcpkgToolchainFile: true + buildDirectory: '${{ runner.workspace }}/buildDirectory' + cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release" + cmakeBuildType: 'Release' + buildWithCMakeArgs: '--target install' + + - uses: actions/upload-artifact@v2 + with: + name: darknet-${{ runner.os }} + path: cfg + - uses: actions/upload-artifact@v2 + with: + name: darknet-${{ runner.os }} + path: data + - uses: actions/upload-artifact@v2 + with: + name: darknet-${{ runner.os }} + path: ${{ github.workspace }}/*dark* + - uses: actions/upload-artifact@v2 + with: + name: darknet-${{ runner.os }} + path: ${{ github.workspace }}/uselib* + + linux-build-no-opencv-cpp-mode: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # Install latest CMake. - uses: lukka/get-cmake@latest - name: 'Build with CMake and Ninja' @@ -129,26 +184,19 @@ jobs: steps: - uses: actions/checkout@v2 - # Install system dependencies - name: Install dependencies run: brew install libomp yasm - # Install latest CMake. - uses: lukka/get-cmake@latest - # Restore from cache the previously built ports. If "cache miss", then provision vcpkg, install desired ports, finally cache everything for the next run. - name: Restore from cache and run vcpkg env: vcpkgResponseFile: ${{ github.workspace }}/cmake/vcpkg_osx.diff uses: lukka/run-vcpkg@v2 with: - # Response file stored in source control, it provides the list of ports and triplet(s). vcpkgArguments: '@${{ env.vcpkgResponseFile }}' - # Location of the vcpkg as submodule of the repository. vcpkgDirectory: '${{ github.workspace }}/vcpkg' vcpkgGitCommitId: '2bc6cd714f931c32d3299a137d5abe0f86f803e1' - # Since the cache must be invalidated when content of the response file changes, let's - # compute its hash and append this to the computed cache's key. appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }} - name: 'Build with CMake and Ninja' @@ -185,11 +233,9 @@ jobs: steps: - uses: actions/checkout@v2 - # Install system dependencies - name: Install dependencies run: brew install opencv libomp - # Install latest CMake. - uses: lukka/get-cmake@latest - name: 'Build with CMake and Ninja' @@ -226,7 +272,6 @@ jobs: steps: - uses: actions/checkout@v2 - # Install latest CMake. - uses: lukka/get-cmake@latest - name: 'Build with CMake and Ninja' @@ -246,22 +291,16 @@ jobs: steps: - uses: actions/checkout@v2 - # Install latest CMake. - uses: lukka/get-cmake@latest - # Restore from cache the previously built ports. If "cache miss", then provision vcpkg, install desired ports, finally cache everything for the next run. - name: Restore from cache and run vcpkg env: vcpkgResponseFile: ${{ github.workspace }}/cmake/vcpkg_windows.diff uses: lukka/run-vcpkg@v2 with: - # Response file stored in source control, it provides the list of ports and triplet(s). vcpkgArguments: '@${{ env.vcpkgResponseFile }}' - # Location of the vcpkg as submodule of the repository. vcpkgDirectory: '${{ github.workspace }}/vcpkg' vcpkgGitCommitId: '2bc6cd714f931c32d3299a137d5abe0f86f803e1' - # Since the cache must be invalidated when content of the response file changes, let's - # compute its hash and append this to the computed cache's key. appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }} - name: 'Build with CMake and Ninja' @@ -273,7 +312,75 @@ jobs: buildDirectory: '${{ runner.workspace }}/buildDirectory' cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release" cmakeBuildType: 'Release' - buildWithCMakeArgs: '--target install' + buildWithCMakeArgs: '--config Release --target install' + + - uses: actions/upload-artifact@v2 + with: + name: darknet-vcpkg-${{ runner.os }} + path: cfg + - uses: actions/upload-artifact@v2 + with: + name: darknet-vcpkg-${{ runner.os }} + path: data + - uses: actions/upload-artifact@v2 + with: + name: darknet-vcpkg-${{ runner.os }} + path: ${{ github.workspace }}/*dark* + - uses: actions/upload-artifact@v2 + with: + name: darknet-vcpkg-${{ runner.os }} + path: ${{ github.workspace }}/buildDirectory/*.dll + - uses: actions/upload-artifact@v2 + with: + name: darknet-vcpkg-${{ runner.os }} + path: ${{ github.workspace }}/uselib* + + + windows-build-vcpkg-with-cuda: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: 'Install CUDA' + run: | + choco install cuda -y + $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.." + Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" + refreshenv + + - uses: lukka/get-cmake@latest + + - name: Restore from cache and run vcpkg + env: + vcpkgResponseFile: ${{ github.workspace }}/cmake/vcpkg_windows_cuda.diff + INSTALL_CUDA_VERSION: "10.2" + CUDA_PATH: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" + CUDA_PATH_V10_2: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" + CUDA_TOOLKIT_ROOT_DIR: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" + CUDACXX: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2\\bin\\nvcc.exe" + + uses: lukka/run-vcpkg@v2 + with: + vcpkgArguments: '@${{ env.vcpkgResponseFile }}' + vcpkgDirectory: '${{ github.workspace }}/vcpkg' + vcpkgGitCommitId: '2bc6cd714f931c32d3299a137d5abe0f86f803e1' + appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }} + + - name: 'Build with CMake and Ninja' + env: + INSTALL_CUDA_VERSION: "10.2" + CUDA_PATH: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" + CUDA_PATH_V10_2: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" + CUDA_TOOLKIT_ROOT_DIR: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" + CUDACXX: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2\\bin\\nvcc.exe" + uses: lukka/run-cmake@v2 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + useVcpkgToolchainFile: true + buildDirectory: '${{ runner.workspace }}/buildDirectory' + cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release" + cmakeBuildType: 'Release' + buildWithCMakeArgs: '--config Release --target install' - uses: actions/upload-artifact@v2 with: @@ -302,7 +409,6 @@ jobs: steps: - uses: actions/checkout@v2 - # Install latest CMake. - uses: lukka/get-cmake@latest - name: 'Build with CMake and Ninja' @@ -314,7 +420,7 @@ jobs: buildDirectory: '${{ runner.workspace }}/buildDirectory' cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release" cmakeBuildType: 'Release' - buildWithCMakeArgs: '--target install' + buildWithCMakeArgs: '--config Release --target install' - uses: actions/upload-artifact@v2 with: @@ -337,12 +443,12 @@ jobs: name: darknet-vcpkg-${{ runner.os }} path: ${{ github.workspace }}/uselib* + windows-build-integrated-libs-cpp-mode: runs-on: windows-latest steps: - uses: actions/checkout@v2 - # Install latest CMake. - uses: lukka/get-cmake@latest - name: 'Build with CMake and Ninja' @@ -354,4 +460,59 @@ jobs: buildDirectory: '${{ runner.workspace }}/buildDirectory' cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DBUILD_AS_CPP:BOOL=TRUE" cmakeBuildType: 'Release' - buildWithCMakeArgs: '--target install' + buildWithCMakeArgs: '--config Release --target install' + + + windows-build-integrated-libs-with-cuda: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: 'Install CUDA' + run: | + choco install cuda -y + $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.." + Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" + refreshenv + + - uses: lukka/get-cmake@latest + + - name: 'Build with CMake and Ninja' + env: + INSTALL_CUDA_VERSION: "10.2" + CUDA_PATH: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" + CUDA_PATH_V10_2: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" + CUDA_TOOLKIT_ROOT_DIR: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" + CUDACXX: "C:\\Program\ Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2\\bin\\nvcc.exe" + uses: lukka/run-cmake@v2 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + useVcpkgToolchainFile: true + buildDirectory: '${{ runner.workspace }}/buildDirectory' + cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release" + cmakeBuildType: 'Release' + buildWithCMakeArgs: '--config Release --target install' + + + windows-mingw: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: fixPath + run: | + set PATH=%PATH:C:\Program Files\Git\bin;=% + set PATH=%PATH:C:\Program Files\Git\usr\bin;=% + shell: cmd + + - uses: lukka/get-cmake@latest + + - name: 'Build with CMake and Ninja' + uses: lukka/run-cmake@v2 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + useVcpkgToolchainFile: true + buildDirectory: '${{ runner.workspace }}/buildDirectory' + cmakeAppendedArgs: "-G\"MinGW Makefiles\" -DCMAKE_BUILD_TYPE=Release" + cmakeBuildType: 'Release' + buildWithCMakeArgs: '--config Release --target install' diff --git a/CMakeLists.txt b/CMakeLists.txt index c2c7f7ae..5400cbbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,7 +256,7 @@ list(APPEND headers ${CMAKE_CURRENT_LIST_DIR}/include/darknet.h ) #remove windows only files -if(NOT WIN32) +if(NOT MSVC) list(REMOVE_ITEM headers ${CMAKE_CURRENT_LIST_DIR}/src/gettimeofday.h ${CMAKE_CURRENT_LIST_DIR}/src/getopt.h @@ -276,7 +276,7 @@ list(REMOVE_ITEM sources ${CMAKE_CURRENT_LIST_DIR}/src/darknet.c ) #remove windows only files -if(NOT WIN32) +if(NOT MSVC) list(REMOVE_ITEM sources ${CMAKE_CURRENT_LIST_DIR}/src/gettimeofday.c ${CMAKE_CURRENT_LIST_DIR}/src/getopt.c diff --git a/README.md b/README.md index d3fae87e..cb14f148 100644 --- a/README.md +++ b/README.md @@ -242,14 +242,10 @@ The `CMakeLists.txt` will attempt to find installed optional dependencies like CUDA, cudnn, ZED and build against those. It will also create a shared object library file to use `darknet` for code development. -Do inside the cloned repository: +Open a bash terminal inside the cloned repository and launch: -``` -mkdir build-release -cd build-release -cmake .. -make -make install +```bash +./build.sh ``` ### How to compile on Linux (using `make`) @@ -270,51 +266,34 @@ Before make, you can set such options in the `Makefile`: [link](https://github.c To run Darknet on Linux use examples from this article, just use `./darknet` instead of `darknet.exe`, i.e. use this command: `./darknet detector test ./cfg/coco.data ./cfg/yolov4.cfg ./yolov4.weights` -### How to compile on Windows (using `CMake-GUI`) +### How to compile on Windows (using `CMake`) This is the recommended approach to build Darknet on Windows if you have already installed Visual Studio 2015/2017/2019, CUDA > 10.0, cuDNN > 7.0, and OpenCV > 2.4. -Use `CMake-GUI` as shown here on this [**IMAGE**](https://user-images.githubusercontent.com/4096485/55107892-6becf380-50e3-11e9-9a0a-556a943c429a.png): +Open a Powershell terminal inside the cloned repository and launch: -1. Configure -2. Optional platform for generator (Set: x64) -3. Finish -4. Generate -5. Open Project -6. Set: x64 & Release -7. Build -8. Build solution +```PowerShell +.\build.ps1 +``` ### How to compile on Windows (using `vcpkg`) -If you have already installed Visual Studio 2015/2017/2019, CUDA > 10.0, -cuDNN > 7.0, OpenCV > 2.4, then to compile Darknet it is recommended to use -[CMake-GUI](#how-to-compile-on-windows-using-cmake-gui). - -Otherwise, follow these steps: - 1. Install or update Visual Studio to at least version 2017, making sure to have it fully patched (run again the installer if not sure to automatically update to latest version). If you need to install from scratch, download VS from here: [Visual Studio Community](http://visualstudio.com) -2. Install CUDA and cuDNN +2. Install CUDA -3. Install `git` and `cmake`. Make sure they are on the Path at least for the current account +3. Install [vcpkg](https://github.com/Microsoft/vcpkg) and try to install a test library to make sure everything is working, for example `vcpkg install opengl` -4. Install [vcpkg](https://github.com/Microsoft/vcpkg) and try to install a test library to make sure everything is working, for example `vcpkg install opengl` - -5. Define an environment variables, `VCPKG_ROOT`, pointing to the install path of `vcpkg` - -6. Define another environment variable, with name `VCPKG_DEFAULT_TRIPLET` and value `x64-windows` - -7. Open Powershell and type these commands: +4. Open Powershell and type these commands: ```PowerShell -PS \> cd $env:VCPKG_ROOT -PS Code\vcpkg> .\vcpkg install pthreads opencv[ffmpeg] #replace with opencv[cuda,ffmpeg] in case you want to use cuda-accelerated openCV +PS \> cd vcpkg +PS Code\vcpkg> .\vcpkg install darknet[full]:x64-windows #replace with darknet[opencv-base,weights]:x64-windows for a quicker install; use --head if you want to build latest commit on master branch and not latest release ``` -8. Open Powershell, go to the `darknet` folder and build with the command `.\build.ps1`. If you want to use Visual Studio, you will find two custom solutions created for you by CMake after the build, one in `build_win_debug` and the other in `build_win_release`, containing all the appropriate config flags for your system. +5. You will find darknet inside the vcpkg\installed\x64-windows\tools\darknet folder, together with all the necessary weight and cfg files ### How to compile on Windows (legacy way) diff --git a/appveyor.yml b/appveyor.yml index 68aea5d5..d2153460 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,13 +24,13 @@ environment: # configuration: Release # VCPKG_ROOT: C:\Tools\vcpkg # VCPKG_DEFAULT_TRIPLET: x64-windows - #- platform: Win64 - # USE_CUDA: yes - # INSTALL_CUDA_VERSION: 10.2 - # COMPILER: vs - # configuration: Release - # VCPKG_ROOT: C:\Tools\vcpkg - # VCPKG_DEFAULT_TRIPLET: x64-windows + - platform: Win64 + USE_CUDA: yes + INSTALL_CUDA_VERSION: 10.2 + COMPILER: vs + configuration: Release + VCPKG_ROOT: C:\Tools\vcpkg + VCPKG_DEFAULT_TRIPLET: x64-windows #- platform: Win64 # USE_CUDA: no # COMPILER: vs @@ -58,8 +58,8 @@ install: - cd %WORKSPACE%\ - if [%USE_CUDA%]==[yes] if [%INSTALL_CUDA_VERSION%]==[10.0] curl -L https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_411.31_win10 -o setup.exe - if [%USE_CUDA%]==[yes] if [%INSTALL_CUDA_VERSION%]==[10.1] curl -L https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_418.96_win10.exe -o setup.exe - - if [%USE_CUDA%]==[yes] if [%INSTALL_CUDA_VERSION%]==[10.2] curl -L http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_441.22_win10.exe -o setup.exe - - if [%USE_CUDA%]==[yes] .\setup.exe -s nvcc_%INSTALL_CUDA_VERSION% cuobjdump_%INSTALL_CUDA_VERSION% nvprune_%INSTALL_CUDA_VERSION% cupti_%INSTALL_CUDA_VERSION% gpu_library_advisor_%INSTALL_CUDA_VERSION% memcheck_%INSTALL_CUDA_VERSION% nvdisasm_%INSTALL_CUDA_VERSION% nvprof_%INSTALL_CUDA_VERSION% visual_profiler_%INSTALL_CUDA_VERSION% visual_studio_integration_%INSTALL_CUDA_VERSION% cublas_%INSTALL_CUDA_VERSION% cublas_dev_%INSTALL_CUDA_VERSION% cudart_%INSTALL_CUDA_VERSION% cufft_%INSTALL_CUDA_VERSION% cufft_dev_%INSTALL_CUDA_VERSION% curand_%INSTALL_CUDA_VERSION% curand_dev_%INSTALL_CUDA_VERSION% cusolver_%INSTALL_CUDA_VERSION% cusolver_dev_%INSTALL_CUDA_VERSION% cusparse_%INSTALL_CUDA_VERSION% cusparse_dev_%INSTALL_CUDA_VERSION% nvgraph_%INSTALL_CUDA_VERSION% nvgraph_dev_%INSTALL_CUDA_VERSION% npp_%INSTALL_CUDA_VERSION% npp_dev_%INSTALL_CUDA_VERSION% nvrtc_%INSTALL_CUDA_VERSION% nvrtc_dev_%INSTALL_CUDA_VERSION% nvml_dev_%INSTALL_CUDA_VERSION% occupancy_calculator_%INSTALL_CUDA_VERSION% fortran_examples_%INSTALL_CUDA_VERSION% + - if [%USE_CUDA%]==[yes] if [%INSTALL_CUDA_VERSION%]==[10.2] choco install cuda -y + - if [%USE_CUDA%]==[yes] if NOT [%INSTALL_CUDA_VERSION%]==[10.2] .\setup.exe -s nvcc_%INSTALL_CUDA_VERSION% cuobjdump_%INSTALL_CUDA_VERSION% nvprune_%INSTALL_CUDA_VERSION% cupti_%INSTALL_CUDA_VERSION% gpu_library_advisor_%INSTALL_CUDA_VERSION% memcheck_%INSTALL_CUDA_VERSION% nvdisasm_%INSTALL_CUDA_VERSION% nvprof_%INSTALL_CUDA_VERSION% visual_profiler_%INSTALL_CUDA_VERSION% visual_studio_integration_%INSTALL_CUDA_VERSION% cublas_%INSTALL_CUDA_VERSION% cublas_dev_%INSTALL_CUDA_VERSION% cudart_%INSTALL_CUDA_VERSION% cufft_%INSTALL_CUDA_VERSION% cufft_dev_%INSTALL_CUDA_VERSION% curand_%INSTALL_CUDA_VERSION% curand_dev_%INSTALL_CUDA_VERSION% cusolver_%INSTALL_CUDA_VERSION% cusolver_dev_%INSTALL_CUDA_VERSION% cusparse_%INSTALL_CUDA_VERSION% cusparse_dev_%INSTALL_CUDA_VERSION% nvgraph_%INSTALL_CUDA_VERSION% nvgraph_dev_%INSTALL_CUDA_VERSION% npp_%INSTALL_CUDA_VERSION% npp_dev_%INSTALL_CUDA_VERSION% nvrtc_%INSTALL_CUDA_VERSION% nvrtc_dev_%INSTALL_CUDA_VERSION% nvml_dev_%INSTALL_CUDA_VERSION% occupancy_calculator_%INSTALL_CUDA_VERSION% fortran_examples_%INSTALL_CUDA_VERSION% - if [%USE_CUDA%]==[yes] set CUDA_PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%INSTALL_CUDA_VERSION% - if [%USE_CUDA%]==[yes] if [%INSTALL_CUDA_VERSION%]==[10.0] set CUDA_PATH_V10_0=%CUDA_PATH% - if [%USE_CUDA%]==[yes] if [%INSTALL_CUDA_VERSION%]==[10.1] set CUDA_PATH_V10_1=%CUDA_PATH% diff --git a/cmake/vcpkg_linux_cuda.diff b/cmake/vcpkg_linux_cuda.diff new file mode 100644 index 00000000..635bd5f1 --- /dev/null +++ b/cmake/vcpkg_linux_cuda.diff @@ -0,0 +1,8 @@ +cuda +cudnn +stb +pthreads +ffmpeg +opencv[ffmpeg] +--triplet +x64-linux \ No newline at end of file diff --git a/cmake/vcpkg_windows_cuda.diff b/cmake/vcpkg_windows_cuda.diff new file mode 100644 index 00000000..b757b8d0 --- /dev/null +++ b/cmake/vcpkg_windows_cuda.diff @@ -0,0 +1,8 @@ +cuda +cudnn +stb +pthreads +ffmpeg +opencv[ffmpeg] +--triplet +x64-windows \ No newline at end of file diff --git a/src/gemm.c b/src/gemm.c index bc43b87f..61f574bb 100644 --- a/src/gemm.c +++ b/src/gemm.c @@ -513,10 +513,9 @@ static inline int popcnt_32(uint32_t val32) { } //---------------------------- - #if (defined(__AVX__) && defined(__x86_64__)) || (defined(_WIN64) && !defined(__MINGW32__)) -#ifdef _WIN64 +#if (defined(_WIN64) && !defined(__MINGW64__)) #include #include #include @@ -2863,4 +2862,4 @@ int test_gpu_blas() void init_cpu() { is_avx(); is_fma_avx2(); -} \ No newline at end of file +} diff --git a/src/getopt.c b/src/getopt.c index 2707e0a8..45d2b8e6 100644 --- a/src/getopt.c +++ b/src/getopt.c @@ -1,4 +1,4 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #include "getopt.h" #ifdef __cplusplus diff --git a/src/getopt.h b/src/getopt.h index 66ab5dfb..8266c734 100644 --- a/src/getopt.h +++ b/src/getopt.h @@ -1,4 +1,4 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #ifndef __GETOPT_H__ /** * DISCLAIMER diff --git a/src/gettimeofday.c b/src/gettimeofday.c index 1db060cb..74f6789b 100644 --- a/src/gettimeofday.c +++ b/src/gettimeofday.c @@ -1,4 +1,4 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #include "gettimeofday.h" int gettimeofday(struct timeval* tp, struct timezone* tzp) diff --git a/src/gettimeofday.h b/src/gettimeofday.h index 2e96dd2b..86fef101 100644 --- a/src/gettimeofday.h +++ b/src/gettimeofday.h @@ -1,4 +1,4 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #define WIN32_LEAN_AND_MEAN #include #include