-
Notifications
You must be signed in to change notification settings - Fork 44
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 support #31
Comments
@eiennohito Does jumanpp continue to use boost? (I think first version used it) |
Nope, no boost, please. The Windows impl should be only around 60-70 lines of code with perfect error handling. |
Considering #20 I assume you would like to avoid strict dependency on C++17 |
Yes, no C++17 for us (yet). Windows has https://msdn.microsoft.com/en-us/library/8z34s9c6.aspx, which should solve the problem. |
Even better idea would be to use https://msdn.microsoft.com/en-us/library/windows/desktop/aa366887(v=vs.85).aspx with actual large pages support, but I don't mind at least somehow working implementation. It's much better than nothing already. |
@eiennohito If we would go VirtualAlloc route, then wouldn't we also use linux's valloc? Not sure about its availability as it is part of glibc, not posix. P.s. You cannot though specify alignment with VirtualAlloc, if it is needed. |
If you try to dig the history of memory.cpp, then you will find out that it was using mmap before! But the thing is, if you want to be a page to use huge tlb on Linux without defragmentation, you must align it on 2M boundary, and the best API to do that is posix_memalign. Memory allocator itself should be ok with 4096/2M alignment which the VirtualAlloc will return. You should use _aligned_malloc for MallocEalloc (a bad name) nevertheless though. |
Now I hit quite strange problem with soa.h: https://github.com/ku-nlp/jumanpp/blob/master/src/util/soa.h#L50 It uses ManagedVector which is vector with your own custom allocator https://github.com/ku-nlp/jumanpp/blob/master/src/util/memory.hpp#L166-L192 But it seems this allocator misses custom copy constructor? To be honest MSVC is really bad with this error(I tried clang-cl though and it is not really helpful too)
I'll try to poke around how custom allocators are supposed to be implemented, might take some time. |
Actually, there shouldn't be any use of soa.h inside the project now, it is an artifact of the past. If there is I will fix it. |
Ah yeah, it is not used anywhere. I guess soa.h and soa_test.cc can be removed |
Yep, to the better world should they go. |
I got interesting errors on my clang-cl:
It seems by default clang treats this warning as error. |
I wonder what the warning/error means in the context. Need to dig a bit deeper, probably. |
@eiennohito I'm not sure of details but i assume it might be ABI issue. For now i decided to disable treating it as error. |
ABI compatibility for debug builds should not be a top priority. And these macros are a noop in debug builds. Or maybe we should take parameters inside the assert macros by const&. |
should fix warnings described in #31
Should fix those warnings at least for assert stuff. |
Seems like it can be closed? Congrats on getting windows support complete! |
Yep, I wanna do a rc2 release with the readme update and stuff. |
It should be possible to compile Juman++ on windows.
We need to port memory mapping and memory management utils to native Windows API for that.
The text was updated successfully, but these errors were encountered: