From 72688312036aed96bb5bdb306aabed1e3d315fed Mon Sep 17 00:00:00 2001 From: Titus von Koeller <9048635+Titus-von-Koeller@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:08:32 +0000 Subject: [PATCH 1/2] adjust path to prefer pip installed cmake --- .github/workflows/python-package.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index be7db0079..89ae4524e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -184,10 +184,14 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: pip - - name: Upgrade CMake + - name: Install recent CMake and adjust PATH accordingly # (needed due to old nvidia/cuda:*ubuntu20.04 being consciously used for many_linux compatibility) run: | pip install -q cmake==3.28.3 + CMAKE_BIN_PATH=$(pip show cmake | grep Location | cut -d' ' -f2)/bin + echo "CMAKE_BIN_PATH=$CMAKE_BIN_PATH" >> $GITHUB_ENV + echo "PATH=$CMAKE_BIN_PATH:$PATH" >> $GITHUB_ENV + which cmake - name: Install build package shell: bash run: pip install build From 72c5d97920a1fe935210657b158c9b1a89906400 Mon Sep 17 00:00:00 2001 From: Titus von Koeller <9048635+Titus-von-Koeller@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:09:56 +0000 Subject: [PATCH 2/2] default to CMAKE_BUILD_TYPE Release for optimized releases and better many_linux compatibility --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6384cb3c..e922d2bff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,14 @@ cmake_minimum_required(VERSION 3.22.1) project(bitsandbytes LANGUAGES CXX) +# If run without specifying a build type, default to using the Release configuration: +# optimizing the generated binaries for performance and also adds the `-DNDEBUG` flag, +# which turns off a bunch of asserts which seem to link to new symbols in libstdc++, +# worsening our many_linux compliance.. +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + if (CMAKE_COMPILER_IS_GNUCXX) add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1) endif()