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

Native Windows build #38872

Open
wants to merge 107 commits into
base: develop
Choose a base branch
from
Open

Native Windows build #38872

wants to merge 107 commits into from

Conversation

tobiasdiez
Copy link
Contributor

@tobiasdiez tobiasdiez commented Oct 28, 2024

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

Conda Issues:

Upstream issues

Singular

Flint:

Cysignals:

📝 Checklist

  • 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

Copy link

github-actions bot commented Oct 28, 2024

Documentation preview for this PR (built with commit 0bb2c5b; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

../src/sage/symbolic/ginac/upoly-ginac.cpp(219): error C2440: '<function-style-cast>': cannot convert from 'size_t' to 'GiNaC::numeric'
../src/sage/symbolic/ginac/upoly-ginac.cpp(219): note: 'GiNaC::numeric::numeric': ambiguous call to overloaded function
../src/sage/symbolic/ginac/archive.cpp(584): error C2039: 'mem_fun_ref': is not a member of 'std'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\sstream(19): note: see declaration of 'std'
../src/sage/symbolic/ginac/archive.cpp(584): error C3861: 'mem_fun_ref': identifier not found
../src/sage/symbolic/ginac/archive.cpp(584): error C2672: 'for_each': no matching overloaded function found
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\xkeycheck.h(341): warning C4005: 'register': macro redefinition
../src/sage/symbolic/ginac/constant.cpp(23): note: see previous definition of 'register'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\xkeycheck.h(343): fatal error C1189: #error:  The C++ Standard Library forbids macroizing the keyword "register". Enable warning C4005 to find the forbidden define.
ginac_lst.cpp.obj : error LNK2005: "protected: static void const * __cdecl GiNaC::container<class std::list>::get_tinfo(void)" (?get_tinfo@?$container@Vlist@std@@@ginac@@KAPEBXXZ) already defined in meson-generated_src_sage_symbolic_expression.pyx.cpp.obj
Some of them should perhaps be reverted
`os.uname` is not available on Windows
@tobiasdiez
Copy link
Contributor Author

@soehms Thanks you very much for giving this a run, and sorry for not providing enough installation instructions. I've added most of your steps now to the documentation.

Having it "compile" is currently the best I can provide. As you saw, importing sage.all is not working since it requires that all of sage's modules can actually be imported - which is not the case on Windows as not all dependencies are available to actually compile all cython modules. Locally, I have a solution for this issue (will be a new PR) but even then many other things need further work. It's just the first step, of many.
I've added a few warnings to the docs to make it clearer that you cannot expect much at the moment.

@isuruf
Copy link
Member

isuruf commented Jan 23, 2025

gsl, libgd issues are fixed now and bdw-gc and pari should be available now.

@isuruf
Copy link
Member

isuruf commented Jan 23, 2025

m4ri and libflint issues are fixed too

@dimpase
Copy link
Member

dimpase commented Jan 23, 2025

gsl, libgd issues are fixed now and bdw-gc and pari should be available now.

@isuruf - is Windows pari Cygwin-based? That is, linking to libpari needs Cygwin?

@isuruf
Copy link
Member

isuruf commented Jan 23, 2025

@isuruf - is Windows pari Cygwin-based? That is, linking to libpari needs Cygwin?

No, it's compiled using UCRT based MinGW. Since it's only C, no problem mixing with MSVC builds. We have the UCRT based MinGW toolchain and runtime libraries packaged in conda-forge.

@dimpase
Copy link
Member

dimpase commented Jan 23, 2025

@isuruf - is Windows pari Cygwin-based? That is, linking to libpari needs Cygwin?

No, it's compiled using UCRT based MinGW. Since it's only C, no problem mixing with MSVC builds. We have the UCRT based MinGW toolchain and runtime libraries packaged in conda-forge.

OK, so then the next thing would be to port cypari2 ?

@isuruf
Copy link
Member

isuruf commented Jan 24, 2025

OK, so then the next thing would be to port cypari2 ?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants