Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop dependency on distutils #651

Merged
merged 14 commits into from
Jan 24, 2024
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(CMAKE_CXX_STANDARD 11)
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)
NoureldinYosri marked this conversation as resolved.
Show resolved Hide resolved

# Set APPLE_ARM to TRUE if running on Apple Silicon
if(APPLE)
Expand Down
2 changes: 1 addition & 1 deletion pybind_interface/GetPybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (pybind11_FOUND)
# The pybind11_add_module doesn't correctly set the CXX_INCLUDES properly if a system pybind11 is found.
# Using `include_directories(${pybind11_INCLUDE_DIRS})` doesn't result in anything in
# CXX_INCLUDES. e.g., `pybind_interface/basic/CMakeFiles/qsim_basic.dir/flags.make` would only
# have `CXX_INCLUDES = -isystem $PREFIX/include/python3.11` and would miss `$PREFIX/include`.
# have `CXX_INCLUDES = -isystem $PREFIX/include/python3.12` and would miss `$PREFIX/include`.
# This problem would result in `fatal error: pybind11/complex.h: No such file or directory`
# This is a hack to get around that by passing `-I/path/to/include` to CXX_FLAGS
# Iterate over each include directory and add it as a compile option
Expand Down
2 changes: 1 addition & 1 deletion pybind_interface/avx2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)
project(qsim)

IF (WIN32)
Expand Down
2 changes: 1 addition & 1 deletion pybind_interface/avx512/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)
project(qsim)


Expand Down
2 changes: 1 addition & 1 deletion pybind_interface/basic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)
project(qsim)

if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion pybind_interface/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)
project(qsim LANGUAGES CXX CUDA)

if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion pybind_interface/custatevec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)
project(qsim LANGUAGES CXX CUDA)

if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion pybind_interface/decide/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)

if(WIN32)
set(CMAKE_CXX_FLAGS "/O2 /openmp")
Expand Down
2 changes: 1 addition & 1 deletion pybind_interface/sse/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)
project(qsim)

IF (WIN32)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ cirq-core~=1.0
numpy~=1.16
pybind11
typing_extensions
packaging
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion


class CMakeExtension(Extension):
Expand All @@ -27,10 +26,12 @@ def run(self):
)

if platform.system() == "Windows":
cmake_version = LooseVersion(
from packaging.version import parse

cmake_version = parse(
re.search(r"version\s*([\d.]+)", out.decode()).group(1)
)
if cmake_version < "3.1.0":
if cmake_version < parse("3.1.0"):
raise RuntimeError("CMake >= 3.1.0 is required on Windows")

for ext in self.extensions:
Expand Down
Loading