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

Add support for building the library on Windows using MSVC. #56

Merged
merged 19 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,20 @@ jobs:
- name: cp39-musllinux_x86_64
os: ubuntu-22.04

# Windows builds
- name: cp37-win_amd64
os: windows-2022
- name: cp38-win_amd64
os: windows-2022
- name: cp39-win_amd64
os: windows-2022
- name: cp310-win_amd64
os: windows-2022
- name: cp311-win_amd64
os: windows-2022
- name: cp312-win_amd64
os: windows-2022

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "src/clp"]
path = src/clp
url = https://github.com/y-scope/clp.git
url = https://github.com/junhaoliao/clp.git
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shall not be merged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is merged with the latest CLP code: #55

branch = clp-ffi-py-windows
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ python3 -m pip install --upgrade clp-ffi-py
Note:

- Python 3.7 or higher is required.
- Only Linux and macOS are supported at present.
- Tested only on Linux, macOS and Windows.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need work "only", lol

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol i was thinking about Solaris and FreeBSD when i wrote this, but yeah the word seems a bit unnecessary here


To install an older version or download the prebuilt `whl` package, check the
project homepage on PyPI [here][16].
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ musllinux-x86_64-image = "musllinux_1_2"
skip = "pp*"

test-command = [
"cd {package}/tests",
"python -m unittest -fv",
"python -m unittest discover --failfast --verbose --start-directory={package}/tests"
]
test-requires = [
"smart_open==6.4.0"
Expand All @@ -68,6 +67,9 @@ archs = ["auto", "aarch64"]
[tool.cibuildwheel.macos]
archs = ["x86_64", "universal2", "arm64"]

[tool.cibuildwheel.windows]
archs = ["AMD64"]

[tool.docformatter]
make-summary-multi-line = true
pre-summary-newline = true
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"src/clp_ffi_py/utils.cpp",
],
extra_compile_args=[
"/std:c++20",
"/O2,"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not O3?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O3 isn't a valid option for MSVC.

MSVC's /O2, which "sets a combination of optimizations that optimizes code for maximum speed", is roughly the equivalent of GCC's -O3.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kk, good to know that, thx!

] if "nt" == os.name else [
"-std=c++20",
"-O3",
],
Expand Down
2 changes: 1 addition & 1 deletion src/clp
Loading