-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Added support for _POSIX_MAPPED_FILES if defined in source #564
Conversation
I have created my own library for mingw32 that includes the POSIX functions that the source needs to compile. That is how I will support llama.cpp for windows using mingw32 compilation in mys2. Compiled successfully using: make LDFLAGS='-D_POSIX_MAPPED_FILES -lmingw32_extended'
Since you're one of the few using mingw32 , could you please look into this first ? #551 Where does the |
I'd be reluctant to merge this because mmap() is a mandatory feature.
I have a working mmap() implementation now for MSVC which I intend to push soon. Would it be sufficient for your purposes if we just got rid of the MINGW |
Yes, mmap() is a mandatory feature in POSIX.1-2017, but not in older POSIX versions, and MSVC does not fully support POSIX.1-2017 and _POSIX_MAPPED_FILES is not defined in MSVC. |
Would you be interested in sharing your feedback on the mmap() polyfill I've just added to the mmap branch? https://github.com/ggerganov/llama.cpp/blob/mmap/mmap.c |
Sucessfully compiled mmap branch and sucessfully compiled resolved conflicts. |
My real goal of this pull request is if mmap exists then _POSIX_MAPPED_FILES will be defined due to POSIX and it overrides any implementation in mmap.h. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK let's do it. Thank you for this change.
Thank you, I use https://github.com/CoderRC/libmingw32_extended to compile this, thanks. |
Docker improvements
* .sh script V1 * koboldcpp.sh polish * koboldcpp.sh dist generator * Include html's in dist * RWKV in Linux Dist * Lower dependency requirements * Eliminate wget dependency * More distinct binary name I know its technically amd64, but I don't want to cause confusion among nvidia users. * Use System OpenCL Unsure how this will behave in the pyinstaller build, but pocl ended up CPU only. With a bit of luck the pyinstaller uses the one from the actual system if compiled in a system without opencl, while conda now includes it for that specific system. * Add cblas dependency Missing this causes compile failures on some system's * ICD workaround Ideally we find a better solution, but conda forces ICD and needs this for the successful compile. However, pyinstaller then embeds the ICD causing it to be limited to the system it was compiled for. By temporarily removing the ICD pyinstaller can't find it and everything remains functional. Ideally we do this on a pyinstaller level, but I could not find any good options to do so yet. * Fix & Nocuda * Automatically build Linux Binary * Auto build on v tag * Better on release * Fix missing jobs: * More distinct name * I am to retro... * Fix release upload * Another upload attempt * Another upload attempt * Also rebuild on release edit * Placebo commit to maybe fix CI --------- Co-authored-by: root <root@DESKTOP-DQ1QRAG>
I have created my own library for mingw32 that includes the POSIX functions that the source needs to compile. That is how I will support llama.cpp for windows using mingw32 compilation in mys2. Compiled successfully using:
make LDFLAGS='-D_POSIX_MAPPED_FILES -lmingw32_extended'