-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
base: develop
Are you sure you want to change the base?
Native Windows build #38872
Conversation
Documentation preview for this PR (built with commit 0445ffb; changes) is ready! 🎉 |
../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
@saraedum Thanks for the feedback. Cysignals is now using meson and builds nicely on Windows. NTL is still not available on conda (as far as I know), but we can use the flexibility of meson to just not build the parts of sage that make use of it (a similar strategy is employed for various other dependencies which don't provide windows build / or are not installable from conda yet). This PR is now in a working stage, at least to the extend that it should compile nicely on Windows. Instructions on how to test are under the |
Turns out `mtx.lib` exists on Windows as "Microsoft Transaction Server". Thus, we also check for the existence of the header `meataxe.h`.
cysignals and gmpy2 issues should be fixed now |
They are indeed, thanks a lot! |
Testreport on Windows 11 proI tried to follow your instructions on the documentation page. Since I'm not really familiar with the build system on Windows, it wasn't easy. First of all, it looks like the "Windows" tab is almost a clone of the other tabs with very few Windows-specific changes. Even your example of the "VS x64 Native Tools Command Prompt" doesn't look like what it looked like in my test:
I ran the test on Windows 11 Pro, freshly installed a few months ago. None of the required prerequisites were present on that system. Here I give a summary of what I had to do to get the test working (hoping it helps someone else starting at a similar point as me):
After that, I started the VS x64 Native Tools prompt (I suspect that's essentially a regular Finally, I was able to follow your instructions:
Now I'm not quite sure how to use Sage? There was nothing in the terminal environment to start Sage by name. Then I tried to use Sage in an IPython session by importing its global names...
|
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:
set LIB
includes the conda env (e.g....\.conda\envs\sage-dev\Library\lib
). If not, runconda deactivate
followed byconda activate sage-dev
and then check again.set LIB=%CONDA_PREFIX%\Library\lib;%LIB%
LIB
meson setup builddir -Dbuildtype=release
<path to conda>\sage-dev\include\pyconfig.h
uncomment://# define Py_DEBUG
and changepython311_d.lib
topython311.lib
pyconfig.h
c-compiler
on Windows, VS 2022 Build Tools init file is not installed conda-forge/compilers-feedstock#66LNK2019: unresolved external symbol
on Windows conda-forge/m4ri-feedstock#15Upstream issues
Singular
Flint:
small
macro fromrpcndr
flintlib/flint#2100pid_t
mingw-w64/mingw-w64#65 (indirectly since pthread is flint dependency). Would be fixed by winpthreads-related issue when compiling against flint conda-forge/libflint-feedstock#38.-> Workaround: Change
typedef __int64 pid_t;
totypedef int pid_t;
in.conda\envs\sage-dev\Library\include\pthread_compat.h
-> Workaround: disable compilation of fraction_field_FpT for now
Cysignals:
📝 Checklist
⌛ Dependencies