diff --git a/.github/scripts/install_cuda_windows.ps1 b/.github/scripts/install_cuda_windows.ps1 index 5fc57fe6d..8df59fc48 100755 --- a/.github/scripts/install_cuda_windows.ps1 +++ b/.github/scripts/install_cuda_windows.ps1 @@ -47,6 +47,13 @@ $CUDA_KNOWN_URLS = @{ "12.2.1" = "https://developer.download.nvidia.com/compute/cuda/12.2.1/network_installers/cuda_12.2.1_windows_network.exe"; "12.2.2" = "https://developer.download.nvidia.com/compute/cuda/12.2.2/network_installers/cuda_12.2.2_windows_network.exe"; "12.3.0" = "https://developer.download.nvidia.com/compute/cuda/12.3.0/network_installers/cuda_12.3.0_windows_network.exe"; + "12.3.1" = "https://developer.download.nvidia.com/compute/cuda/12.3.1/network_installers/cuda_12.3.1_windows_network.exe"; + "12.3.2" = "https://developer.download.nvidia.com/compute/cuda/12.3.2/network_installers/cuda_12.3.2_windows_network.exe"; + "12.4.0" = "https://developer.download.nvidia.com/compute/cuda/12.4.0/network_installers/cuda_12.4.0_windows_network.exe"; + "12.4.1" = "https://developer.download.nvidia.com/compute/cuda/12.4.1/network_installers/cuda_12.4.1_windows_network.exe"; + "12.5.0" = "https://developer.download.nvidia.com/compute/cuda/12.5.0/network_installers/cuda_12.5.0_windows_network.exe"; + "12.5.1" = "https://developer.download.nvidia.com/compute/cuda/12.5.1/network_installers/cuda_12.5.1_windows_network.exe"; + "12.6.0" = "https://developer.download.nvidia.com/compute/cuda/12.6.0/network_installers/cuda_12.6.0_windows_network.exe"; } # @todo - change this to be based on _MSC_VER intead, or invert it to be CUDA keyed instead diff --git a/.github/workflows/Draft-Release.yml b/.github/workflows/Draft-Release.yml index 586a54baa..e10f5f8e1 100644 --- a/.github/workflows/Draft-Release.yml +++ b/.github/workflows/Draft-Release.yml @@ -41,6 +41,10 @@ jobs: matrix: # CUDA_ARCH values are reduced compared to wheels due to CI memory issues while compiling the test suite. cudacxx: + - cuda: "12.6" + cuda_arch: "50-real;90-real;90-virtual;" + hostcxx: gcc-12 + os: ubuntu-22.04 - cuda: "12.0" cuda_arch: "50-real;90-real;90-virtual;" hostcxx: gcc-11 @@ -115,23 +119,26 @@ jobs: - name: Install Visualisation Dependencies if: ${{ startswith(env.OS, 'ubuntu') && env.VISUALISATION == 'ON' }} run: | + # Install ubuntu-22.04 packages + if [ "$OS" == 'ubuntu-22.04' ]; then + sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev + fi # Install ubuntu-20.04 packages - if [ "$OS" == 'ubuntu-20.04' ]; then + if [ "$OS" == 'ubuntu-20.04' ]; then sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev fi # Install Ubuntu 18.04 packages - if [ "$OS" == 'ubuntu-18.04' ]; then + if [ "$OS" == 'ubuntu-18.04' ]; then sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype6-dev libgl1-mesa-dev fi - name: Install Swig >= 4.0.2 run: | # Remove existing swig install, so CMake finds the correct swig - if [ "$OS" == 'ubuntu-20.04' ]; then + if [ "$OS" == 'ubuntu-20.04' ]; then sudo apt-get remove -y swig swig4.0 fi - # Install Ubuntu 18.04 packages - if [ "$OS" == 'ubuntu-18.04' ]; then + if [ "$OS" == 'ubuntu-18.04' ]; then sudo apt-get remove -y swig fi # Install additional apt-based dependencies required to build swig 4.0.2 @@ -194,10 +201,14 @@ jobs: matrix: # CUDA_ARCH values are reduced compared to wheels due to CI memory issues while compiling the test suite. cudacxx: - - cuda: "12.0.0" + - cuda: "12.6.0" cuda_arch: "50-real;90-real;90-virtual" hostcxx: "Visual Studio 17 2022" os: windows-2022 + - cuda: "12.0.0" + cuda_arch: "50-real;90-real;90-virtual" + hostcxx: "Visual Studio 16 2019" + os: windows-2019 - cuda: "11.8.0" cuda_arch: "35-real;90-real;90-virtual" hostcxx: "Visual Studio 16 2019" @@ -234,6 +245,8 @@ jobs: FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }} PYTHON: ${{ matrix.python}} VISUALISATION: ${{ matrix.VISUALISATION }} + # Ensure MSVC >= 1940 works with CUDA <= 12.3 + CUDAFLAGS: -allow-unsupported-compiler steps: - uses: actions/checkout@v3 @@ -358,6 +371,8 @@ jobs: FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }} PYTHON: ${{ matrix.python}} VISUALISATION: ${{ matrix.VISUALISATION }} + # Short term fix to use node16 not node20 for actions. This will stop working eventually, forcing our hand in dropping manylinux2014 support. + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: - uses: actions/checkout@v3 @@ -515,6 +530,8 @@ jobs: FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }} PYTHON: ${{ matrix.python}} VISUALISATION: ${{ matrix.VISUALISATION }} + # Ensure MSVC >= 1940 works with CUDA <= 12.3 + CUDAFLAGS: -allow-unsupported-compiler steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/Manylinux2014.yml b/.github/workflows/Manylinux2014.yml index a0ab50492..352e9f302 100644 --- a/.github/workflows/Manylinux2014.yml +++ b/.github/workflows/Manylinux2014.yml @@ -77,6 +77,8 @@ jobs: FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }} PYTHON: ${{ matrix.python}} VISUALISATION: ${{ matrix.VISUALISATION }} + # Short term fix to use node16 not node20 for actions. This will stop working eventually, forcing our hand in dropping manylinux2014 support. + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/Ubuntu.yml b/.github/workflows/Ubuntu.yml index 646e33a6c..0f99e3c5d 100644 --- a/.github/workflows/Ubuntu.yml +++ b/.github/workflows/Ubuntu.yml @@ -29,7 +29,11 @@ jobs: # optional exclude: can be partial, include: must be specific matrix: cudacxx: - - cuda: "12.3" + - cuda: "12.6" + cuda_arch: "50" + hostcxx: gcc-12 + os: ubuntu-22.04 + - cuda: "12.0" cuda_arch: "50" hostcxx: gcc-12 os: ubuntu-22.04 @@ -54,11 +58,18 @@ jobs: - "ON" - "OFF" exclude: - # Exclude VIS=ON for oldest cuda. + # Exclude VIS=ON for oldest cuda of each major version + - cudacxx: + cuda: "12.0" + VISUALISATION: "ON" - cudacxx: cuda: "11.0" VISUALISATION: "ON" - # Exclude beltsoff builds for old cuda's + # Exclude beltsoff builds for all but the most recent cuda + - cudacxx: + cuda: "12.0" + config: + name: "Beltsoff" - cudacxx: cuda: "11.8" config: @@ -129,10 +140,11 @@ jobs: - name: Install Visualisation Dependencies if: ${{ startswith(env.OS, 'ubuntu') && env.VISUALISATION == 'ON' }} run: | - # Install ubuntu-20.04 packages + # Install ubuntu-22.04 packages if [ "$OS" == 'ubuntu-22.04' ]; then sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev fi + # Install ubuntu-20.04 packages if [ "$OS" == 'ubuntu-20.04' ]; then sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev fi @@ -147,7 +159,6 @@ jobs: if [ "$OS" == 'ubuntu-20.04' ]; then sudo apt-get remove -y swig swig4.0 fi - # Install Ubuntu 18.04 packages if [ "$OS" == 'ubuntu-18.04' ]; then sudo apt-get remove -y swig fi diff --git a/.github/workflows/Windows-Tests.yml b/.github/workflows/Windows-Tests.yml index 4762c62e7..cef081791 100644 --- a/.github/workflows/Windows-Tests.yml +++ b/.github/workflows/Windows-Tests.yml @@ -23,14 +23,17 @@ jobs: matrix: # CUDA_ARCH values are reduced compared to wheels due to CI memory issues while compiling the test suite. cudacxx: - - cuda: "12.0.0" + - cuda: "12.6.0" cuda_arch: "50" hostcxx: "Visual Studio 17 2022" - os: windows-2022 + - cuda: "12.0.0" + cuda_arch: "50" + hostcxx: "Visual Studio 16 2019" + os: windows-2019 - cuda: "11.8.0" cuda_arch: "35" - hostcxx: "Visual Studio 17 2022" - os: windows-2022 + hostcxx: "Visual Studio 16 2019" + os: windows-2019 - cuda: "11.0.3" cuda_arch: "35" hostcxx: "Visual Studio 16 2019" @@ -59,6 +62,8 @@ jobs: CONFIG: ${{ matrix.config.config }} FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }} VISUALISATION: ${{ matrix.VISUALISATION }} + # Ensure MSVC >= 1940 works with CUDA <= 12.3 + CUDAFLAGS: -allow-unsupported-compiler steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 4511c3538..b6f1b5380 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -29,14 +29,18 @@ jobs: # optional exclude: can be partial, include: must be specific matrix: cudacxx: - - cuda: "12.3.0" + - cuda: "12.6.0" cuda_arch: "50" hostcxx: "Visual Studio 17 2022" os: windows-2022 + - cuda: "12.0.0" + cuda_arch: "50" + hostcxx: "Visual Studio 16 2019" + os: windows-2019 - cuda: "11.8.0" cuda_arch: "35" - hostcxx: "Visual Studio 17 2022" - os: windows-2022 + hostcxx: "Visual Studio 16 2019" + os: windows-2019 - cuda: "11.0.3" cuda_arch: "35" hostcxx: "Visual Studio 16 2019" @@ -54,11 +58,18 @@ jobs: - "ON" - "OFF" exclude: - # Exclude VIS=ON for oldest cuda. + # Exclude VIS=ON for oldest cuda of each major version + - cudacxx: + cuda: "12.0.0" + VISUALISATION: "ON" - cudacxx: cuda: "11.0.3" VISUALISATION: "ON" - # Exclude beltsoff builds for old cuda's + # Exclude beltsoff builds for all but the most recent cuda + - cudacxx: + cuda: "12.0.0" + config: + name: "Beltsoff" - cudacxx: cuda: "11.8.0" config: @@ -98,6 +109,8 @@ jobs: FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }} PYTHON: ${{ matrix.python}} VISUALISATION: ${{ matrix.VISUALISATION }} + # Ensure MSVC >= 1940 works with CUDA <= 12.3 + CUDAFLAGS: -allow-unsupported-compiler steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index f634809aa..25101133d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,7 @@ set(MINIMUM_SUPPORTED_CUDA_VERSION 11.0) set(MINIMUM_CUDA_VERSION 11.0) # If the CUDA compiler is too old, trigger a docs only build. -if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS ${MINIMUM_CUDA_VERSION}) +if(NOT DOCUMENTATION_ONLY_BUILD AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS ${MINIMUM_CUDA_VERSION}) set(DOCUMENTATION_ONLY_BUILD ON) message(STATUS "Documentation-only build: CUDA ${MINIMUM_SUPPORTED_CUDA_VERSION} or greater is required for compilation.") endif() diff --git a/cmake/CheckCompilerFunctionality.cmake b/cmake/CheckCompilerFunctionality.cmake index bdf9b881c..0fc4cf865 100644 --- a/cmake/CheckCompilerFunctionality.cmake +++ b/cmake/CheckCompilerFunctionality.cmake @@ -20,7 +20,46 @@ function(flamegpu_check_compiler_functionality) enable_language(CXX) check_language(CUDA) if(NOT CMAKE_CUDA_COMPILER) - message(WARNING "CUDA Language Support Not Found") + # MSVC 1941 (VS2022 17.11) requires CUDA 12.4 or greater - see https://github.com/microsoft/STL/pull/4475 + if(MSVC AND MSVC_VERSION VERSION_GREATER_EQUAL "1941") + message(WARNING + " CUDA Language Support Not Found (with MSVC ${MSVC_VERSION} >= 1941)\n" + " \n" + " The MSVC STL included with MSVC 1941 requires CUDA 12.4 or newer\n" + " If you have CUDA <= 12.3 installed you must either:\n" + " - Upgrade CUDA to >= 12.4\n" + " - Downgrade MSVC to 1940 and set the CUDAFLAGS environment variable to contain '-allow-unsupported-compiler'\n" + " - Downgrade MSVC to 1939 or older\n" + " You must then clear the CMake cache before reconfiguring\n" + ) + # If using MSVC >= 1940 then CUDA <= 12.3 support requires -allow-unsupported-compiler, so warn about this + elseif(MSVC AND MSVC_VERSION VERSION_GREATER_EQUAL "1940") + # If this is the case, then CMake >= 3.29.4 is also required, otherwise CMake does not pass -allow-unsupported-compiler along, warn as appropriate + if(CMAKE_VERSION VERSION_LESS "3.29.4") + message(WARNING + " CUDA Language Support Not Found (with MSVC ${MSVC_VERSION} >= 1940)\n" + " \n" + " If you have CUDA <= 12.3 installed:\n" + " - You must upgrade CMake to be >= 3.29.4\n" + " The CUDAFLAGS environment variable must include '-allow-unsupported-compiler'\n" + " You must clear the CMake Cache before reconfiguring this project\n" + " \n" + " - Alternatively you may upgrade CUDA to >= 12.4 and clear the CMake Cache before reconfiguring\n" + ) + else() + message(WARNING + " CUDA Language Support Not Found (with MSVC ${MSVC_VERSION} >= 1940)\n" + " \n" + " If you have CUDA <= 12.3 installed:\n" + " - The CUDAFLAGS environment variable must include '-allow-unsupported-compiler'\n" + " You must clear the CMake Cache before reconfiguring this project\n" + " \n" + " - Alternatively you may upgrade CUDA to >= 12.4 and clear the CMake Cache before reconfiguring\n" + ) + endif() + else() + message(WARNING "CUDA Language Support Not Found") + endif() set(FLAMEGPU_CheckCompilerFunctionality_RESULT "NO" PARENT_SCOPE) return() endif() diff --git a/cmake/dependencies/Jitify.cmake b/cmake/dependencies/Jitify.cmake index d5aa509c2..da737d457 100644 --- a/cmake/dependencies/Jitify.cmake +++ b/cmake/dependencies/Jitify.cmake @@ -5,6 +5,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH}) include(FetchContent) cmake_policy(SET CMP0079 NEW) +# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223 +if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) +endif() # Change the source-dir to allow inclusion via jitify/jitify.hpp rather than jitify.hpp FetchContent_Declare( diff --git a/cmake/dependencies/Thrust.cmake b/cmake/dependencies/Thrust.cmake index 3f8bc8690..3f1088c7c 100644 --- a/cmake/dependencies/Thrust.cmake +++ b/cmake/dependencies/Thrust.cmake @@ -6,6 +6,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH}) include(FetchContent) cmake_policy(SET CMP0079 NEW) +# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223 +if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) +endif() # Set the minimum supported cub/thrust version, and the version to fetch # Thrust minimum version to 1.16 to avoid windows.h related issues and pull in bug fixes, but fetch the most recent 1.x release otherwise (at the time of writing). diff --git a/cmake/dependencies/Tinyxml2.cmake b/cmake/dependencies/Tinyxml2.cmake index ad8cad118..2524078a1 100644 --- a/cmake/dependencies/Tinyxml2.cmake +++ b/cmake/dependencies/Tinyxml2.cmake @@ -6,6 +6,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH}) include(FetchContent) cmake_policy(SET CMP0079 NEW) +# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223 +if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) +endif() # Change the source_dir to allow inclusion via tinyxml2/tinyxml2.h rather than tinyxml2.h FetchContent_Declare( diff --git a/cmake/dependencies/flamegpu2-visualiser.cmake b/cmake/dependencies/flamegpu2-visualiser.cmake index 88f5a02c6..9b2265170 100644 --- a/cmake/dependencies/flamegpu2-visualiser.cmake +++ b/cmake/dependencies/flamegpu2-visualiser.cmake @@ -5,9 +5,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH}) include(FetchContent) cmake_policy(SET CMP0079 NEW) +# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223 +if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) +endif() # Set the visualiser repo and tag to use unless overridden by the user. -set(DEFAULT_FLAMEGPU_VISUALISATION_GIT_VERSION "flamegpu-2.0.0-rc.1") +set(DEFAULT_FLAMEGPU_VISUALISATION_GIT_VERSION "3befb5964fc5e24c375e872ebbb5d903e878b5e0") set(DEFAULT_FLAMEGPU_VISUALISATION_REPOSITORY "https://github.com/FLAMEGPU/FLAMEGPU2-visualiser.git") # Set a VISUSLAITION_ROOT cache entry so it is available in the GUI to override the location if required diff --git a/cmake/dependencies/glm.cmake b/cmake/dependencies/glm.cmake index d328c9545..9e9b45ef1 100644 --- a/cmake/dependencies/glm.cmake +++ b/cmake/dependencies/glm.cmake @@ -6,6 +6,10 @@ if(POLICY CMP0135) cmake_policy(SET CMP0135 NEW) endif() +# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223 +if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) +endif() set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH}) include(FetchContent) diff --git a/cmake/dependencies/googletest.cmake b/cmake/dependencies/googletest.cmake index 824337a87..d30fa8327 100644 --- a/cmake/dependencies/googletest.cmake +++ b/cmake/dependencies/googletest.cmake @@ -5,6 +5,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH}) include(FetchContent) cmake_policy(SET CMP0079 NEW) +# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223 +if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) +endif() FetchContent_Declare( googletest diff --git a/cmake/dependencies/rapidjson.cmake b/cmake/dependencies/rapidjson.cmake index a83127541..3a3819606 100644 --- a/cmake/dependencies/rapidjson.cmake +++ b/cmake/dependencies/rapidjson.cmake @@ -6,6 +6,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH}) include(FetchContent) include(ExternalProject) cmake_policy(SET CMP0079 NEW) +# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223 +if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) +endif() # a95e013b97ca6523f32da23f5095fcc9dd6067e5 is the last commit before a change which breaks our method of finding rapid json without running a cmake install first. # but we also need to patch this to avoid a cmake >= 3.26.4 deprecation, but this is handled manually post-population diff --git a/examples/cpp/circles_bruteforce/src/main.cu b/examples/cpp/circles_bruteforce/src/main.cu index c008b38ee..a0517b5c3 100644 --- a/examples/cpp/circles_bruteforce/src/main.cu +++ b/examples/cpp/circles_bruteforce/src/main.cu @@ -1,3 +1,4 @@ +#include #include "flamegpu/flamegpu.h" FLAMEGPU_AGENT_FUNCTION(output_message, flamegpu::MessageNone, flamegpu::MessageBruteForce) { diff --git a/examples/cpp/circles_spatial3D/src/main.cu b/examples/cpp/circles_spatial3D/src/main.cu index e91f6e6df..524bdad69 100644 --- a/examples/cpp/circles_spatial3D/src/main.cu +++ b/examples/cpp/circles_spatial3D/src/main.cu @@ -1,3 +1,4 @@ +#include #include "flamegpu/flamegpu.h" FLAMEGPU_AGENT_FUNCTION(output_message, flamegpu::MessageNone, flamegpu::MessageSpatial3D) { diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index 902071824..848f7aeaf 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -1,7 +1,10 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) include(FetchContent) - +# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223 +if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) +endif() # Set some policy behaviours for SWIG