Update build system to use Meson#206
Merged
fchapoton merged 62 commits intosagemath:mainfrom Nov 17, 2024
Merged
Conversation
This was referenced Oct 29, 2024
Contributor
Author
|
Uff, tests are finally green. |
Contributor
|
Would you agree to engage yourself to maintain this for the years to come ? |
Member
|
meson is a widely used and documented, unlike our present system to build this. besides, currently used |
Contributor
|
So we both agree that it's a good idea to merge, right ? |
Contributor
Author
That's hard to promise but yes I'm willing to (help) maintaining it. The meson build info is also pretty straightforward, so it shouldn't be too hard for someone else to modify it. Please merge #209 before this one here, and squash this PR to have a cleaner git history. Thanks! |
Contributor
Author
|
Thanks @dimpase and @fchapoton! |
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
May 17, 2025
sagemathgh-38872: Native Windows build <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> The goal of this PR is to provide a native Windows build of Sage using MSVC (using the new Meson build system). Instructions on how to test are under the `Windows` tab at https://doc- pr-38872--sagemath.netlify.app/html/en/installation/meson. Afterwards, you should be able to import some sage modules in a normal `python` install (but most modules actually don't properly import due to various errors that will be fixed peu a peu in follow-up PRs) ## State of Windows support of dependencies - m4rie: upstream (https://github.com/malb/m4rie) doesn't provide win build - ec: not sure if upstream (https://github.com/JohnCremona/eclib) provide win build - ecm: upstream (https://gitlab.inria.fr/zimmerma/ecm) doesn't provide native win build (only Cygwin) - ntl: upstream provides win build (kind of), but it's not yet available on conda (conda-forge/ntl-feedstock#16) - maxima/ecl: upstream provides win build, but it's not yet available on conda (conda-forge/maxima-feedstock#38) - GAP: only cygiwn build exists https://github.com/gap- system/gap/issues/4157 - [pari](http://pari.math.u-bordeaux.fr/pub/pari): now available on conda (conda-forge/pari-feedstock#45) - cypari2: no windows support yet sagemath/cypari2#19 - lrcalc - pplpy - primecountpy - fpylll - rw - cliquer - lcalc - ecl - braiding - gc - homfly - iml - brial_groebner ## Conda Issues: - Meson cannot find libraries without pkg-config files. - Workaround: Check that `set LIB` includes the conda env (e.g. `...\.conda\envs\sage-dev\Library\lib`). If not, run `conda deactivate` followed by `conda activate sage-dev` and then check again. - Alternatively, `set LIB=%CONDA_PREFIX%\Library\lib;%LIB%` - Possible upstream improvement: the compilers conda package should set `LIB` - If you don't have the debug version of Python installed, you may get "LINK : fatal error LNK1104: cannot open file 'python311_d.lib'" - Workaround: `meson setup builddir -Dbuildtype=release` - Alternatively, in `<path to conda>\sage-dev\include\pyconfig.h` uncomment: `//# define Py_DEBUG` and change `python311_d.lib` to `python311.lib` - Possible upstream improvement: conda should either ship a debug version of python or a correct `pyconfig.h` - conda-forge/gsl-feedstock#63 - Workaround: Fallback to find_library in meson and/or change the `gsl.pc` to match: ``` prefix=C:/Users/Tobia/.conda/envs/sage-dev/Library exec_prefix=C:/Users/Tobia/.conda/envs/sage-dev/Library libdir=C:/Users/Tobia/.conda/envs/sage-dev/Library/lib sharedlibdir=C:/Users/Tobia/.conda/envs/sage-dev/Library/lib includedir=C:/Users/Tobia/.conda/envs/sage-dev/Library/include GSL_CBLAS_LIB=-lgslcblas Name: GSL Description: GNU Scientific Library Version: 2.7 Libs: -L${libdir} -lgsl ${GSL_CBLAS_LIB} Cflags: -I${includedir} ``` - conda-forge/compilers-feedstock#66 - Workaround: Run everything in "VS x64 Native Tools Command Prompt" (for 64bit) or "Developer Command Prompt for VS2022 (or 2019)" (for 32bit) - conda-forge/libgd-feedstock#55 - Workaround: Fallback to find_library in meson - conda-forge/m4ri-feedstock#15 - Workaround: Don't try to use m4ri on windows - conda-forge/libflint-feedstock#38 - Workaround: Don't try to use flint on windows ## Upstream issues Singular - Singular/Singular#1245 - Singular/Singular#1246 - Singular/Singular#1247 Flint: - flintlib/flint#2100 - mingw-w64/mingw-w64#65 (indirectly since pthread is flint dependency). Would be fixed by conda-forge/libflint-feedstock#38. -> Workaround: Change `typedef __int64 pid_t;` to `typedef int pid_t;` in `.conda\envs\sage-dev\Library\include\pthread_compat.h` - flintlib/flint#2101: -> Workaround: disable compilation of fraction_field_FpT for now Cysignals: - sagemath/cysignals#207 - sagemath/cysignals#206 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#38872 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following the example of Scipy/Numpy and sagemath/sage#36524, the build system is migrated to Meson.
I tried to stay as close as possible to the original autoconf implementation. A few differences are:
signals.pxd, but have it at as a normal source file.Sage Developersto align with the main sage repo. I'm unsure about this one and happy to revert it.MINSIGSTKSZ_IS_CONSTANT(I had trouble making it compile and it's not constant for recent versions of glibc anyway)implementation_cygwin.cdirectly inimplementation.csince I was not able to make it compile (it's also a bit hard for me to work on the cygwin code since I only have the ci to test it.)Closes #179 (obsolete now)