Skip to content

build(cmake): support MSVC toolchains#1110

Open
IvanaGyro wants to merge 1 commit into
masterfrom
codex/windows-msvc-pypi
Open

build(cmake): support MSVC toolchains#1110
IvanaGyro wants to merge 1 commit into
masterfrom
codex/windows-msvc-pypi

Conversation

@IvanaGyro

@IvanaGyro IvanaGyro commented Jul 22, 2026

Copy link
Copy Markdown
Member

Stack

#1109#1110#1116#1117#1118#1119#1113

This is the first split layer and remains based on #1109. Review only this PR's CMake/compiler portability diff; Pixi, CUDA dispatch, wheel packaging, release metadata, and workflow integration are isolated in the later PRs.

Summary

  • add native MSVC compiler, sanitizer, GoogleTest, and small Windows-only test compatibility;
  • keep MinGW and non-Windows compiler flags on their existing paths;
  • make Boost, Python/pybind11, LAPACK/ARPACK, CUDA device-runtime, cuTENSOR, and cuQuantum discovery/export portable to Windows;
  • keep CUDA response files enabled only where Windows command-line limits require them;
  • keep installed CMake targets relocatable instead of exporting Pixi build paths;
  • give the Python module's Windows import library a non-conflicting archive name;
  • configure Type.cpp through lapacke_config.h so MSVC does not parse LAPACK 3.11 C99 complex declarations.

The __blasINTsize__ global is otherwise unused internally; its planned removal and the eventual deletion of this temporary Type.cpp header dependency are tracked in #1115.

Linux and macOS

All new platform behavior is guarded by WIN32/MSVC or preserves the prior non-Windows branch. The previous full stack passed macOS 14, macOS 15 Intel, Ubuntu x86-64, and Ubuntu ARM wheel jobs; the split will rerun those checks independently.

Validation

Part of #1114.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Comment thread pytests/prepare_cuda_release_test.py Outdated
Comment thread cytnx/__init__.py Outdated
Comment thread include/Type.hpp Outdated
Comment thread src/backend/linalg_internal_cpu/Det_internal.cpp Outdated
Comment thread .github/workflows/release_pypi.yml Outdated
@IvanaGyro
IvanaGyro force-pushed the codex/windows-msvc-pypi branch from 10d5878 to a618721 Compare July 22, 2026 13:43
Comment thread CytnxBKNDCMakeLists.cmake Outdated
Keep Linux, macOS, and MinGW behavior unchanged while adding native MSVC compiler, dependency, export, and test configuration. Configure LAPACKE complex types before MSVC consumes the OpenBLAS headers.

Co-Authored-By: OpenAI Codex <codex@openai.com>
@IvanaGyro
IvanaGyro force-pushed the codex/windows-msvc-pypi branch from def374a to 1fc237f Compare July 23, 2026 00:43
@IvanaGyro IvanaGyro changed the title build(windows): support MSVC development and PyPI wheels build(cmake): support MSVC toolchains Jul 23, 2026
@IvanaGyro
IvanaGyro marked this pull request as ready for review July 23, 2026 01:59
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1fc237fa81

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

set(_cytnx_had_bla_vendor FALSE)
endif()
set(BLA_VENDOR "@BLA_VENDOR@")
find_dependency(LAPACK REQUIRED)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-find LAPACKE for installed OpenBLAS targets

When a Windows build uses the default OpenBLAS backend, this re-finds only LAPACK, while CytnxBKNDCMakeLists.cmake:162 still publicly links the build-time ${LAPACK_LIBRARIES} and ${LAPACKE_LIBRARIES} without the BUILD_INTERFACE guard used by the MKL path. Consequently, after the Pixi/build environment is removed or the installation is relocated, CytnxTargets.cmake still references the old .lib paths; appending LAPACK::LAPACK neither removes those paths nor guarantees the separately discovered LAPACKE symbols. Make the Windows OpenBLAS link entries build-only and resolve LAPACKE in the consumer environment as well. CLAUDE.mdL105-L106

Useful? React with 👍 / 👎.

Base automatically changed from codex/portable-binding-types to master July 24, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants