Skip to content

dynet38: Add version 2.2 - #2316

Open
luhenry wants to merge 2 commits into
mainfrom
dynet38
Open

luhenry wants to merge 2 commits into
mainfrom
dynet38

Conversation

@luhenry

@luhenry luhenry commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Compiles the DyNet C++ library (CMake, pinned Eigen snapshot) and its Cython _dynet extension; this is a prerequisite for a separate nagisa port, which depends on dynet38. Upstream publishes no riscv64 wheel and no sdist.

Mirrors upstream's build_macos_wheels.yml.

Differs from upstream

  • Pinned to commit 3c9f35de - upstream pushes no 2.2 tag; this is the tree its latest 2.2 wheels came from
  • musllinux dropped

Matrix: cp312, cp313, cp314 - upstream builds no free-threaded wheel.

Testing

  • same as upstream (tests/python/test.py, from its Travis job)

License: Wheel bundles Eigen headers (MPL-2.0); upstream ships no licence text at all, so the build adds DyNet's and Eigen's.

Patches

  • 0001-cmake-don-t-pass-march-native-on-RISC-V.patch - To upstream. riscv64 GCC rejects -march=native. riscv64-only.
  • 0002-mem-fall-back-to-posix_memalign-when-mm_malloc.h-is-.patch - To upstream. <mm_malloc.h> is x86-only in GCC. riscv64-only.
  • 0003-setup.py-ship-DyNet-s-and-Eigen-s-licences-in-the-wh.patch - To upstream. Wheel ships no licences. Reproduces on x86.

Built on cp312; 60 passed, 0 skipped.

Build taishi-i/dynet (the dynet38 PyPI distribution, a Python 3.8+
wheel fork of clab/dynet) for riscv64. setup.py downloads DyNet's
pinned Eigen snapshot, builds libdynet with CMake and the Cython
_dynet extension against it; cibuildwheel drives that as upstream's own
wheel workflow does, and the test step runs upstream's
tests/python/test.py as its Travis job did.

The fork pushes no 2.2 tag. Pin the build_macos_wheels branch tip,
3c9f35de, whose only differences from master are the CMake 4 and
Cython 3 compatibility fixes the latest 2.2 wheels (cp314) needed, and
which still declares version="2.2".

Three patches:
- skip -march=native on RISC-V, which riscv64 GCC rejects outright;
- give mem.cc a posix_memalign() fallback, since GCC ships
  <mm_malloc.h> for x86 only;
- point license_files at the real LICENSE.txt plus Eigen's MPL-2.0
  text, since upstream's "../LICENSE.txt" matches nothing and its
  wheels ship no licence at all.

cp314t is left out, as upstream builds no free-threaded wheel.
luhenry added a commit that referenced this pull request Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://riseproject-dev.github.io/python-wheels/pr-preview/pr-2316/

Built to branch gh-pages at 2026-09-25 18:49 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

All three 2.2 jobs compiled libdynet and _dynet, then died in
bdist_wheel with "[Errno 2] No such file or directory: 'LICENSE.txt'".
setuptools resolves license_files against the working directory, and
DyNet's build_py os.chdir()s into build/<py>-64bit/python for the rest
of the build, so the relative LICENSE.txt/LICENSE.eigen-mpl2 names from
the licence patch only exist from the source root. Absolute paths are
rejected by setuptools ("should be relative"), so the patch now copies
both files into that directory right after the chdir.

This branch has not been deployed

No deployments
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.

1 participant