The PR makes two contributions that are partially interdependent:
Continuous Integration (CI) has been updated.
CMake files have been updated and use CUDA as a first-order language.
CUDA as a first-order language has been available since CMake 3.18 and is in a good shape now. It is no longer necessary to hack linking and target behaviour, the creation of shared or non-shared libraries and target properties.
CI has been failing for a rather long while because the Linux, Visual Studio and CUDA versions were outdated. CI is now building the following combinations:
Ubuntu 20.04 + CUDA 11.8
Ubuntu 22.04 + CUDA 12.1
Windows Visual Studio 17 2022 v143 + CUDA 12.5
Features list
CI works again (without static linking for Windows because of deprecated CMake/boost interaction)
PopSift's cmake files do no longer require manual maintenance of CUDA Compute Cabilitiies (CCs), this is inherited from new CMake versions.
Sets of CC can be selected by setting CMAKE_CUDA_ARCHITECTURES to all, all-major or native. All means of all CCs supported by the current SDK, native means just the CC of the development machine, while all-major compiles only a few CCs for each major revision. CCs can also be chosen explicitly.
CMake requirement has been increased to version 3.27. This may be too conservative, but 3.18 is the absolute minimum. On Windows, 3.31 is included in Toolset v143. On Ubuntu, 3.30 is available as a Snap (apt repo is at 3.22).
Boost requirement has been increased to 1.71. This prepares for the new handling of Boost as a CMake dependency (since Boost 1.70).
Implementation remarks
Linux CI builds PopSift static and shared. Windows builds PopSift only shared. The reason is that the static Windows build fails on Boost. This should be addressed in a separate PR that switches to CMake policy CMP0167. This new policy uses Boost's own CMake integration and will hopefully solve the static linking challenges.
CI configurations must use CMAKE_CUDA_ARCHITECTURES=all-major because the CI machines don't have any GPU
There is apparently no way to set a minimum CC for first-order CUDA
Applications using PopSift with other CUDA functions may have to link CUDA explicitly, until now they got it "for free" through PopSift. For example, popsift-demo and popsift-match could not longer call cudaDeviceReset or cudaDeviceSynchronize without linking libcudart explicitly. Instead of doing this, I added reset and sync functions to the popsift::cuda namespace. Previously, we exported the libcudart dependency as PUBLIC, but that doesn't happen with first-order CUDA.
CUDA nvtx had to be updated to the new CUDA nvtx3, and code had to be changed because I couldn't find the older nvtx library for Windows any more.
Dropped cuBlas as a dependency because PopSift doesn't use it.
Some variables have changed due to first-order CUDA. A notable example is that CUDA_INCLUDE_DIRS is now CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.
Description
The PR makes two contributions that are partially interdependent:
CUDA as a first-order language has been available since CMake 3.18 and is in a good shape now. It is no longer necessary to hack linking and target behaviour, the creation of shared or non-shared libraries and target properties.
CI has been failing for a rather long while because the Linux, Visual Studio and CUDA versions were outdated. CI is now building the following combinations:
Features list
Implementation remarks