From 8f3cd2840e0440bacf812b340e559987f21f0816 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Sat, 20 Feb 2021 17:05:27 +0100 Subject: [PATCH] fixes --- .github/workflows/ccpp.yml | 14 ++++----- .travis.yml | 61 +++++--------------------------------- build.ps1 | 8 +++++ build.sh | 10 +++++++ 4 files changed, 32 insertions(+), 61 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 1c30fb8a1db..e4c45e8a47a 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -125,7 +125,7 @@ jobs: useVcpkgToolchainFile: true buildDirectory: '${{ runner.workspace }}/buildDirectory' cmakeBuildType: 'Release' - cmakeAppendedArgs: "-DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=OFF" + cmakeAppendedArgs: "-DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release" buildWithCMakeArgs: '--target install' - uses: actions/upload-artifact@v2 @@ -264,7 +264,7 @@ jobs: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' useVcpkgToolchainFile: true buildDirectory: '${{ runner.workspace }}/buildDirectory' - cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF" + cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" cmakeBuildType: 'Release' buildWithCMakeArgs: '--target install' @@ -371,7 +371,7 @@ jobs: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' useVcpkgToolchainFile: true buildDirectory: '${{ runner.workspace }}/buildDirectory' - cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF" + cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" cmakeBuildType: 'Release' buildWithCMakeArgs: '--target install' @@ -440,7 +440,7 @@ jobs: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' useVcpkgToolchainFile: true buildDirectory: '${{ runner.workspace }}/buildDirectory' - cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=OFF" + cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" cmakeBuildType: 'Release' buildWithCMakeArgs: '--config Release --target install' @@ -480,7 +480,7 @@ jobs: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' useVcpkgToolchainFile: true buildDirectory: '${{ runner.workspace }}/buildDirectory' - cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF" + cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" cmakeBuildType: 'Release' buildWithCMakeArgs: '--config Release --target install' @@ -510,7 +510,7 @@ jobs: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' useVcpkgToolchainFile: true buildDirectory: '${{ runner.workspace }}/buildDirectory' - cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=ON" + cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" cmakeBuildType: 'Release' buildWithCMakeArgs: '--config Release --target install' @@ -529,6 +529,6 @@ jobs: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' useVcpkgToolchainFile: true buildDirectory: '${{ runner.workspace }}/buildDirectory' - cmakeAppendedArgs: "-G\"MinGW Makefiles\" -DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=OFF" + cmakeAppendedArgs: "-G\"MinGW Makefiles\" -DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" cmakeBuildType: 'Release' buildWithCMakeArgs: '--config Release --target install' diff --git a/.travis.yml b/.travis.yml index 56dc996055a..447a72a179d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ matrix: name: macOS - gcc (llvm backend) osx_image: xcode12.3 env: - - additional_defines=" -DENABLE_CUDA=OFF" + - additional_defines=" -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" - MATRIX_EVAL="" - os: osx @@ -47,7 +47,7 @@ matrix: name: macOS - clang osx_image: xcode12.3 env: - - additional_defines=" -DENABLE_CUDA=OFF" + - additional_defines=" -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" - MATRIX_EVAL="" - os: osx @@ -55,7 +55,7 @@ matrix: name: macOS - clang - C++ mode osx_image: xcode12.3 env: - - additional_defines="-DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF" + - additional_defines="-DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" - MATRIX_EVAL="" - os: osx @@ -92,22 +92,12 @@ matrix: - additional_defines=" -DENABLE_CUDA=OFF" - MATRIX_EVAL="brew install opencv libomp" - - os: osx - name: macOS - clang - vcpkg - osx_image: xcode12.3 - env: - - additional_defines="-DBUILD_SHARED_LIBS=OFF -DENABLE_CUDA=OFF" - - MATRIX_EVAL="brew install yasm nasm libomp && unset CC && unset CXX" - - USE_VCPKG=true - - VCPKG_ROOT="$HOME/vcpkg" - - VCPKG_DEFINES="-DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake" - - os: linux compiler: clang dist: bionic name: ubuntu 18.04 - clang env: - - additional_defines=" -DENABLE_CUDA=OFF" + - additional_defines=" -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" - MATRIX_EVAL="" - os: linux @@ -115,7 +105,7 @@ matrix: dist: bionic name: ubuntu 18.04 - gcc env: - - additional_defines=" -DENABLE_CUDA=OFF" + - additional_defines=" -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" - MATRIX_EVAL="" - os: linux @@ -123,7 +113,7 @@ matrix: dist: bionic name: ubuntu 18.04 - g++ env: - - additional_defines="-DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF" + - additional_defines="-DBUILD_AS_CPP:BOOL=TRUE -DENABLE_CUDA=OFF -DENABLE_CUDNN=OFF -DENABLE_OPENCV=OFF" - MATRIX_EVAL="" - os: linux @@ -188,31 +178,6 @@ matrix: - LD_LIBRARY_PATH="/usr/local/cuda-${INSTALL_CUDA_VERSION}/lib64:/usr/local/cuda-${INSTALL_CUDA_VERSION}/lib64/stubs:${LD_LIBRARY_PATH}" - MATRIX_EVAL="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-get -y 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-${INSTALL_CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${INSTALL_CUDA_VERSION}/lib64/stubs/libcuda.so.1" - - os: linux - compiler: gcc - dist: bionic - name: ubuntu 18.04 - gcc - CUDA 10 - vcpkg - addons: - apt: - update: true - packages: - - yasm - - nasm - env: - - additional_defines="-DBUILD_SHARED_LIBS=OFF" - - USE_VCPKG=true - - VCPKG_ROOT="$HOME/vcpkg" - - VCPKG_DEFINES="-DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake" - - INSTALL_CUDA_VERSION="10.2" - - CUDACXX=/usr/local/cuda-${INSTALL_CUDA_VERSION}/bin/nvcc - - CUDA_PATH=/usr/local/cuda-${INSTALL_CUDA_VERSION} - - CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-${INSTALL_CUDA_VERSION} - - LD_LIBRARY_PATH="/usr/local/cuda-${INSTALL_CUDA_VERSION}/lib64:/usr/local/cuda-${INSTALL_CUDA_VERSION}/lib64/stubs:${LD_LIBRARY_PATH}" - - MATRIX_EVAL="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-get -y 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-${INSTALL_CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${INSTALL_CUDA_VERSION}/lib64/stubs/libcuda.so.1" - - allow_failures: - - name: macOS - clang - vcpkg - before_install: - travis_retry eval "${MATRIX_EVAL}" @@ -221,23 +186,11 @@ install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then wget --no-check-certificate https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2-Linux-x86_64.tar.gz ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then tar -xzf cmake-3.19.2-Linux-x86_64.tar.gz ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then export PATH=$PWD/cmake-3.19.2-Linux-x86_64/bin:$PATH ; fi - - pushd $HOME - - if [ -d "$HOME/vcpkg/.git" ] ; then echo vcpkg cached ; else rm -rf vcpkg ; git clone https://github.com/Microsoft/vcpkg ; fi - - cd vcpkg - - git checkout . - - git pull - - 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-linux.cmake ; fi - - if [ "${USE_VCPKG}" = true ] ; then rm -rf buildtrees; fi - - if [ "${USE_VCPKG}" = true ] ; then rm -rf installed; fi - - if [ "${USE_VCPKG}" = true ] ; then rm -rf packages; fi - - popd before_script: - mkdir build_release - cd build_release - - travis_wait 50 cmake .. -DCMAKE_BUILD_TYPE="Release" ${additional_defines} + - cmake .. -DCMAKE_BUILD_TYPE="Release" ${additional_defines} - cd .. script: diff --git a/build.ps1 b/build.ps1 index a213bbe48a8..b07e3d27599 100755 --- a/build.ps1 +++ b/build.ps1 @@ -188,6 +188,14 @@ if (-Not($enable_cuda)) { $additional_build_setup = $additional_build_setup + " -DENABLE_CUDA:BOOL=OFF" } +if (-Not($enable_cudnn)) { + $additional_build_setup = $additional_build_setup + " -DENABLE_CUDNN:BOOL=OFF" +} + +if (-Not($enable_opencv)) { + $additional_build_setup = $additional_build_setup + " -DENABLE_OPENCV:BOOL=OFF" +} + if ($use_vcpkg) { New-Item -Path .\build_win_release -ItemType directory -Force Set-Location build_win_release diff --git a/build.sh b/build.sh index 51275834932..41d7634e0a9 100755 --- a/build.sh +++ b/build.sh @@ -4,6 +4,8 @@ number_of_build_workers=8 use_vcpkg=false force_cpp_build=false enable_cuda=false +enable_cudnn=false +enable_opencv=false if [[ "$OSTYPE" == "darwin"* ]]; then vcpkg_triplet="x64-osx" @@ -40,6 +42,14 @@ if [ "$enable_cuda" = false ] then additional_build_setup=${additional_build_setup}" -DENABLE_CUDA:BOOL=FALSE" fi +if [ "$enable_cudnn" = false ] +then + additional_build_setup=${additional_build_setup}" -DENABLE_CUDNN:BOOL=FALSE" +fi +if [ "$enable_opencv" = false ] +then + additional_build_setup=${additional_build_setup}" -DENABLE_OPENCV:BOOL=FALSE" +fi ## DEBUG #mkdir -p build_debug