From 750d8926e426fe83c5d6bd86f2f18984a82dd985 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 30 Jan 2024 15:49:46 -0800 Subject: [PATCH] rm patch: https://github.com/quantumlib/qsim/pull/645 --- recipe/meta.yaml | 4 - ...of-constructor-qsim-StateSpaceCUDA-F.patch | 33 -------- ...nd11_INCLUDE_DIRS-correctly-for-CUDA.patch | 30 ------- ...CHITECTURES-all-cmake-policy-CMP0104.patch | 84 ------------------- ...pport-for-additional-CMake-arguments.patch | 27 ------ 5 files changed, 178 deletions(-) delete mode 100644 recipe/patches/0001-Fix-no-instance-of-constructor-qsim-StateSpaceCUDA-F.patch delete mode 100644 recipe/patches/0003-Set-pybind11_INCLUDE_DIRS-correctly-for-CUDA.patch delete mode 100644 recipe/patches/0006-Set-CUDA_ARCHITECTURES-all-cmake-policy-CMP0104.patch delete mode 100644 recipe/patches/0008-Add-support-for-additional-CMake-arguments.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 74839cb..f267532 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,11 +18,7 @@ source: url: https://github.com/quantumlib/qsim/archive/refs/tags/v{{ version }}.tar.gz sha256: 81101fe9e6356e54125f703956e787aa366717c1e6e77aea794879b53c84ff60 patches: - - patches/0001-Fix-no-instance-of-constructor-qsim-StateSpaceCUDA-F.patch # [cuda_compiler != "None"] - - patches/0003-Set-pybind11_INCLUDE_DIRS-correctly-for-CUDA.patch # [cuda_compiler != "None"] - - patches/0006-Set-CUDA_ARCHITECTURES-all-cmake-policy-CMP0104.patch # [cuda_compiler != "None"] - patches/0007-Always-skip-test_cirq_qsim_gpu_amplitudes-because-no.patch # [cuda_compiler != "None"] - - patches/0008-Add-support-for-additional-CMake-arguments.patch - patches/0009-Use-CMAKE_SYSTEM_NAME-and-CMAKE_SYSTEM_PROCESSOR-for.patch - patches/0010-Do-not-set-includes-on-Apple-arm64-in-basis.patch diff --git a/recipe/patches/0001-Fix-no-instance-of-constructor-qsim-StateSpaceCUDA-F.patch b/recipe/patches/0001-Fix-no-instance-of-constructor-qsim-StateSpaceCUDA-F.patch deleted file mode 100644 index 2111e84..0000000 --- a/recipe/patches/0001-Fix-no-instance-of-constructor-qsim-StateSpaceCUDA-F.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c54a130df240418deeffbc59860163b830559211 Mon Sep 17 00:00:00 2001 -From: Bas Nijholt -Date: Wed, 29 Nov 2023 10:16:09 -0800 -Subject: [PATCH 1/6] Fix 'no instance of constructor - "qsim::StateSpaceCUDA::Parameter::Parameter [with FP=float]" matches the - argument list' - -Full error: -./pybind_interface/cuda/pybind_main_cuda.cpp(30): error: no instance of constructor "qsim::StateSpaceCUDA::Parameter::Parameter [with FP=float]" matches the argument list ---- - pybind_interface/cuda/pybind_main_cuda.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/pybind_interface/cuda/pybind_main_cuda.cpp b/pybind_interface/cuda/pybind_main_cuda.cpp -index 57b0ba8..7480140 100644 ---- a/pybind_interface/cuda/pybind_main_cuda.cpp -+++ b/pybind_interface/cuda/pybind_main_cuda.cpp -@@ -27,8 +27,10 @@ namespace qsim { - unsigned num_sim_threads, - unsigned num_state_threads, - unsigned num_dblocks -- ) : ss_params{num_state_threads, num_dblocks} {} -- -+ ) { -+ ss_params.num_threads = num_state_threads; -+ ss_params.num_dblocks = num_dblocks; -+ } - StateSpace CreateStateSpace() const { - return StateSpace(ss_params); - } --- -2.43.0 - diff --git a/recipe/patches/0003-Set-pybind11_INCLUDE_DIRS-correctly-for-CUDA.patch b/recipe/patches/0003-Set-pybind11_INCLUDE_DIRS-correctly-for-CUDA.patch deleted file mode 100644 index f5d5484..0000000 --- a/recipe/patches/0003-Set-pybind11_INCLUDE_DIRS-correctly-for-CUDA.patch +++ /dev/null @@ -1,30 +0,0 @@ -From ef0f8b996af41178689676f4d6b262d9c3c9786c Mon Sep 17 00:00:00 2001 -From: Bas Nijholt -Date: Wed, 29 Nov 2023 15:10:09 -0500 -Subject: [PATCH 3/6] Set pybind11_INCLUDE_DIRS correctly for CUDA - ---- - pybind_interface/cuda/CMakeLists.txt | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/pybind_interface/cuda/CMakeLists.txt b/pybind_interface/cuda/CMakeLists.txt -index e5644d4..d1d4b3f 100644 ---- a/pybind_interface/cuda/CMakeLists.txt -+++ b/pybind_interface/cuda/CMakeLists.txt -@@ -18,7 +18,12 @@ INCLUDE(../GetPybind11.cmake) - find_package(PythonLibs 3.7 REQUIRED) - find_package(CUDA REQUIRED) - --include_directories(${PYTHON_INCLUDE_DIRS} ${pybind11_SOURCE_DIR}/include) -+include_directories(${PYTHON_INCLUDE_DIRS}) -+if(pybind11_FOUND) -+ include_directories(${pybind11_INCLUDE_DIRS}) -+else() # means pybind11 has been fetched in GetPybind11.cmake -+ include_directories(${pybind11_SOURCE_DIR}/include) -+endif() - - cuda_add_library(qsim_cuda MODULE pybind_main_cuda.cpp) - set_target_properties(qsim_cuda PROPERTIES --- -2.43.0 - diff --git a/recipe/patches/0006-Set-CUDA_ARCHITECTURES-all-cmake-policy-CMP0104.patch b/recipe/patches/0006-Set-CUDA_ARCHITECTURES-all-cmake-policy-CMP0104.patch deleted file mode 100644 index e058553..0000000 --- a/recipe/patches/0006-Set-CUDA_ARCHITECTURES-all-cmake-policy-CMP0104.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 2a166f63ba5544c86c0961e13300717e5f60db29 Mon Sep 17 00:00:00 2001 -From: Bas Nijholt -Date: Wed, 29 Nov 2023 15:07:28 -0500 -Subject: [PATCH 6/6] Set CUDA_ARCHITECTURES to use CUDAARCHS (cmake-policy CMP0104) - ---- - pybind_interface/cuda/CMakeLists.txt | 7 ++++--- - pybind_interface/custatevec/CMakeLists.txt | 4 ++-- - pybind_interface/decide/CMakeLists.txt | 11 ++++++----- - 3 files changed, 12 insertions(+), 10 deletions(-) - -diff --git a/pybind_interface/cuda/CMakeLists.txt b/pybind_interface/cuda/CMakeLists.txt -index d1d4b3f..3a42e9d 100644 ---- a/pybind_interface/cuda/CMakeLists.txt -+++ b/pybind_interface/cuda/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.11) -+cmake_minimum_required(VERSION 3.18) - project(qsim LANGUAGES CXX CUDA) - - if(WIN32) -@@ -27,8 +27,9 @@ endif() - - cuda_add_library(qsim_cuda MODULE pybind_main_cuda.cpp) - set_target_properties(qsim_cuda PROPERTIES -- PREFIX "${PYTHON_MODULE_PREFIX}" -- SUFFIX "${PYTHON_MODULE_EXTENSION}" -+ CUDA_ARCHITECTURES "$ENV{CUDAARCHS}" -+ PREFIX "${PYTHON_MODULE_PREFIX}" -+ SUFFIX "${PYTHON_MODULE_EXTENSION}" - ) - set_source_files_properties(pybind_main_cuda.cpp PROPERTIES LANGUAGE CUDA) - -diff --git a/pybind_interface/custatevec/CMakeLists.txt b/pybind_interface/custatevec/CMakeLists.txt -index 8c1d387..acc4347 100644 ---- a/pybind_interface/custatevec/CMakeLists.txt -+++ b/pybind_interface/custatevec/CMakeLists.txt -@@ -40,8 +40,8 @@ cuda_add_library(qsim_custatevec MODULE pybind_main_custatevec.cpp) - target_link_libraries(qsim_custatevec -lcustatevec -lcublas) - - set_target_properties(qsim_custatevec PROPERTIES -- PREFIX "${PYTHON_MODULE_PREFIX}" -- SUFFIX "${PYTHON_MODULE_EXTENSION}" -+ PREFIX "${PYTHON_MODULE_PREFIX}" -+ SUFFIX "${PYTHON_MODULE_EXTENSION}" - ) - set_source_files_properties(pybind_main_custatevec.cpp PROPERTIES LANGUAGE CUDA) - -diff --git a/pybind_interface/decide/CMakeLists.txt b/pybind_interface/decide/CMakeLists.txt -index 6b36282..3720678 100644 ---- a/pybind_interface/decide/CMakeLists.txt -+++ b/pybind_interface/decide/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.11) -+cmake_minimum_required(VERSION 3.18) - - if(WIN32) - set(CMAKE_CXX_FLAGS "/O2 /openmp") -@@ -26,8 +26,9 @@ if(has_nvcc) - find_package(Python3 3.7 REQUIRED COMPONENTS Interpreter Development) - include_directories(${PYTHON_INCLUDE_DIRS} ${pybind11_SOURCE_DIR}/include) - set_target_properties(qsim_decide PROPERTIES -- PREFIX "${PYTHON_MODULE_PREFIX}" -- SUFFIX "${PYTHON_MODULE_EXTENSION}" -+ CUDA_ARCHITECTURES "$ENV{CUDAARCHS}" -+ PREFIX "${PYTHON_MODULE_PREFIX}" -+ SUFFIX "${PYTHON_MODULE_EXTENSION}" - ) - set_source_files_properties(decide.cpp PROPERTIES LANGUAGE CUDA) - target_link_libraries(qsim_decide OpenMP::OpenMP_CXX) -@@ -39,8 +40,8 @@ elseif(has_hipcc) - find_package(Python3 3.7 REQUIRED COMPONENTS Interpreter Development) - include_directories(${PYTHON_INCLUDE_DIRS} ${pybind11_SOURCE_DIR}/include) - set_target_properties(qsim_decide PROPERTIES -- PREFIX "${PYTHON_MODULE_PREFIX}" -- SUFFIX "${PYTHON_MODULE_EXTENSION}" -+ PREFIX "${PYTHON_MODULE_PREFIX}" -+ SUFFIX "${PYTHON_MODULE_EXTENSION}" - ) - target_link_libraries(qsim_decide PUBLIC OpenMP::OpenMP_CXX) - else() --- -2.43.0 - diff --git a/recipe/patches/0008-Add-support-for-additional-CMake-arguments.patch b/recipe/patches/0008-Add-support-for-additional-CMake-arguments.patch deleted file mode 100644 index 30a2d0a..0000000 --- a/recipe/patches/0008-Add-support-for-additional-CMake-arguments.patch +++ /dev/null @@ -1,27 +0,0 @@ -From b036c571ab83d883590eebab601aa08734896dfc Mon Sep 17 00:00:00 2001 -From: Bas Nijholt -Date: Fri, 8 Dec 2023 23:17:54 -0800 -Subject: [PATCH] Add support for additional CMake arguments - ---- - setup.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/setup.py b/setup.py -index ed4720c..cece6ca 100644 ---- a/setup.py -+++ b/setup.py -@@ -44,6 +44,10 @@ class CMakeBuild(build_ext): - "-DPYTHON_EXECUTABLE=" + sys.executable, - ] - -+ additional_cmake_args = os.environ.get("CMAKE_ARGS", "") -+ if additional_cmake_args: -+ cmake_args += additional_cmake_args.split() -+ - cfg = "Debug" if self.debug else "Release" - build_args = ["--config", cfg] - --- -2.43.0 -