when compiling with mingw64, use __mingw_aligned_malloc() and __mingw_aligned_free() #121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
use __mingw_aligned_malloc in lieu of posix_memalign and __mingw_aligned_free in aligned_free_internal
With this change, I can successfully compile the library, and simplegrep.exe, using mingw64 (after setting env vars to point to the mingw64 toolchain) using the following steps (I'm cross-compiling from OSX, so the steps may be different / simpler on a native setup) and assuming my target PREFIX is /opt/mingw64. Note that the -DBUILD_AVX2=1 was necessary because otherwise AVX2 detection failed, and -DCMAKE_BUILD_TYPE=DEBUG fails for reasons I did not bother to investigate