-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Remove dependency on openlibm #42299
base: master
Are you sure you want to change the base?
Conversation
How do I prevent the system image building step from trying to look for a libm?
|
SpecialFunctions.jl needs this - that's the main big package, without which everything that depends on it will fail. But we will have it depend directly on |
|
f274420
to
39c5340
Compare
Looks like tests are failing because this is still pulling in OpenLibm_jll as a stdlib |
Linux32 seems to have a ton of issues when using the system libm. So we do need to remove all calls to libm (#26434) if we want to get rid of this dependency. Luckily it's just a couple of functions, and only a couple of hundred lines of code. Of course, there's no urgency - and this PR shows what needs to happen when we are ready to excise. |
Is the failure of the |
Yeah, I think it is. My guess is that |
I thought LLVM will find the system libm. Do we link LLVM to openlibm? |
f35452d
to
dd56051
Compare
It builds fine on linux for me, but not on my mac
My suspicion is that this has something to do with llvm not finding libm and perhaps a |
There is no
|
Right - but I don't know where the linking to libm is happening and I need to intervene for mac. |
I think if you link with |
But wouldn't that do the right thing on Mac and find libSystem? |
e0b9b80
to
2b7e6a8
Compare
One of the last steps here is to remove |
https://build.julialang.org/#/builders/90/builds/4890/steps/8/logs/stdio |
It seems there's still a couple libm functions we call on windows, and I imagine other places as well. I would expect that maybe 32bit windows would need those libm functions, but x86 has native instructions for that since the first Core 2 CPUs. |
The windows builds timed out. |
Yeah, I took a deeper look, the missing functions we were seeing are supposed to be in msvcrt, but I think we are linking to some version of it that does not have the symbols. I think it's |
I don't think you can link in msvcrt.a statically, since that is a Microsoft library and we don't have license to redistribute. |
@gbaraldi See some of @inkydragon 's notes in this thread starting at #42299 (comment) |
We already link it for pkgimgs, but we link the one from mingw. The lib I was talking there is also from mingw. Not sure if being from mingw means it's legal or not, but that's what we do. |
Ok, that sounds fine then. I had done some very cursory scanning on stack overflow. |
|
It needs to be added to the CSL like the normal libmsvcrt, I will try and do that tomorrow. |
Also we should probably look more strongly into making julia with ucrt a thing. It's a much more reasonable way of doing things. By reasonable I mean, you can rely on the system to have a decent libc. |
@vchuravy conviced me that shipping a versione mscvrt is a bad idea, which leaves the question. |
Do we have a way to install openlibm only on win32, and nowhere else? |
4b7918f
to
7416f04
Compare
UCRT is available on Windows 10 and later (what we support), can be download for older, I believe here: I'm not on Windows, and don't know much about this, but I think the problem may be that you're [cross-]compiling with MinGW32, i.e. not on Windows and not thus with UCRT available? https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-170
I added the bold. Are you trying to statically link UCRT with Julia? It's possible using libucrt.lib though unclear if allowed (to redistribute), but that seems ok, since you should use "ucrt.lib ucrtbase.dll DLL import library for the UCRT."? |
Is the problem only 32-bit and even just win32? Can we then just NOT support win32, in 1.12/master (at least for now with binaries), or as suggested to "install openlibm only on win32, and nowhere else"? I didn't look more into "Cannot find -lucrt" but that's another workaround? I do not want to waste more time on that if the above is ok. I understand we have replaced ALL of openlibm already with pure Julia, but another question on that, the replacement is currently in Base? Can all of it be moved to (upgradeable) stdlib Julialibm (eventually), and it excised from Base (might need 2.0, or not with juliax)? For now in 1.11 not do that, just get rid of openlibm. It could still be kept in 1.10 that will become LTS, in case people want to support win32 for a long time that way. There just doesn't seem any point to support win32 otherwise for the future, as opposed to 32-bit for Arm, and maybe some other microcontrollers. |
Any progress on this, should we just remove it and not promise it for 1.10 (not release binaries for win32 until we figure it out)? |
It is not promised for 1.10. And no, we should not stop win32 binaries for this reason. |
18799f8
to
489c700
Compare
Link to the system libm
489c700
to
028992f
Compare
Windows failure:
|
Languages, at least Go, have dropped support for 32-bit Windows, and it's very unclear we shouldn't too, for at least 1.12. Thus we can drop openlibm already, only 32-bit windows is stopping that, we will still support 32-bit Arm, and 32-bit Windows on LTS. We would revisit this and add openlibm and/or 32-bit Windows back, or even go further, and drop it from 1.11, but for now just on master. |
The windows issues are on both 32 and 64-bit. |
Fix #26434