|
53 | 53 | extra_compile_args=["/d2FH4-", "/std:c11"] if sys.platform == "win32" else [],
|
54 | 54 | )
|
55 | 55 | for name in glob(f"suitesparse_graphblas/**/*{suffix}", recursive=True)
|
| 56 | + if not name.endswith("_graphblas.c") |
56 | 57 | ]
|
| 58 | + |
57 | 59 | if use_cython:
|
58 | 60 | ext_modules = cythonize(ext_modules, include_path=include_dirs)
|
59 | 61 |
|
| 62 | +if is_win: |
| 63 | + include_dirs = [os.path.join(sys.prefix, "include")] |
| 64 | + library_dirs = [os.path.join(sys.prefix, "lib")] |
| 65 | + |
| 66 | + include_dirs.append(os.path.join(sys.prefix, "Library", "include")) |
| 67 | + library_dirs.append(os.path.join(sys.prefix, "Library", "lib")) |
| 68 | + |
| 69 | + # suitesparse.sh installs GraphBLAS.h here |
| 70 | + include_dirs.append(os.path.join("C:\\", "Program Files (x86)", "include")) |
| 71 | + # graphblas.lib and graphblas.dll.a |
| 72 | + library_dirs.append(os.path.join("C:\\", "Program Files (x86)", "lib")) |
| 73 | + # graphblas.dll |
| 74 | + library_dirs.append(os.path.join("C:\\", "Program Files (x86)", "bin")) |
| 75 | + |
| 76 | + ext_modules.append( |
| 77 | + Extension( |
| 78 | + "suitesparse_graphblas._graphblas", |
| 79 | + ["suitesparse_graphblas\\_graphblas.c"], |
| 80 | + include_dirs=include_dirs, |
| 81 | + library_dirs=library_dirs, |
| 82 | + libraries=["graphblas"], |
| 83 | + # /d2FH4- flag needed only for early Python 3.8 builds on Windows. |
| 84 | + # See https://cibuildwheel.readthedocs.io/en/stable/faq/ |
| 85 | + # (Search for flag on page. Full link causes the linter to fail the tests.) |
| 86 | + # |
| 87 | + # The /std:c11 flag is because the MSVC default is C89. |
| 88 | + extra_compile_args=["/d2FH4-", "/std:c11"], |
| 89 | + ) |
| 90 | + ) |
| 91 | +print("ext_modules:") |
| 92 | +for e in ext_modules: |
| 93 | + print(f"{e.name}: {e.sources}") |
| 94 | + |
60 | 95 | with open("README.md") as f:
|
61 | 96 | long_description = f.read()
|
62 | 97 |
|
|
76 | 111 | author_email="michel@graphegon.com,jim22k@gmail.com,erik.n.welch@gmail.com",
|
77 | 112 | url="https://github.com/GraphBLAS/python-suitesparse-graphblas",
|
78 | 113 | ext_modules=ext_modules,
|
79 |
| - cffi_modules=["suitesparse_graphblas/build.py:ffibuilder"], |
| 114 | + cffi_modules=["suitesparse_graphblas/build.py:ffibuilder"] if not is_win else [], |
80 | 115 | python_requires=">=3.8",
|
81 | 116 | install_requires=["cffi>=1.0.0", "numpy>=1.19"],
|
82 | 117 | setup_requires=["cffi>=1.0.0", "pytest-runner"],
|
|
0 commit comments