-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into cuda-builds
- Loading branch information
Showing
12 changed files
with
33 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ cirq-core~=1.0 | |
numpy~=1.16 | ||
pybind11 | ||
typing_extensions | ||
setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,10 @@ | |
import shutil | ||
import platform | ||
import subprocess | ||
import sysconfig | ||
|
||
from setuptools import setup, Extension | ||
from setuptools.command.build_ext import build_ext | ||
from distutils.version import LooseVersion | ||
|
||
|
||
class CMakeExtension(Extension): | ||
|
@@ -27,21 +27,25 @@ 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: | ||
self.build_extension(ext) | ||
|
||
def build_extension(self, ext): | ||
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name))) | ||
python_include_dir = sysconfig.get_path("include") | ||
cmake_args = [ | ||
"-DCMAKE_CUDA_COMPILER=nvcc", | ||
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=" + extdir, | ||
"-DPYTHON_EXECUTABLE=" + sys.executable, | ||
"-DPYTHON_INCLUDE_DIR=" + python_include_dir, | ||
] | ||
|
||
cfg = "Debug" if self.debug else "Release" | ||
|
@@ -114,8 +118,9 @@ def build_extension(self, ext): | |
url="https://github.com/quantumlib/qsim", | ||
author="Vamsi Krishna Devabathini", | ||
author_email="[email protected]", | ||
python_requires=">=3.7.0,<3.12.0", | ||
python_requires=">=3.7.0", | ||
install_requires=requirements, | ||
setup_requires=["packaging"], | ||
extras_require={ | ||
"dev": dev_requirements, | ||
}, | ||
|