I've figured out that to use a static build of the library with Go on Windows I must use mingw-w64 to build it, builds from msvc are not supported.
So I've setup MSYS2 and building with gcc, however, I get a load of similar errors such as:
...
[ 3%] Building CXX object CMakeFiles/rapidyenc.dir/src/platform.cc.obj
In file included from C:\[snip]\rapidyenc\src\common.h:123,
from C:\[snip]\rapidyenc\src\platform.cc:1:
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h: In function '__m128i _mm_hadd_epi16(__m128i, __m128i)':
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h:42:20: error: '__builtin_ia32_phaddw128' was not declared in this scope; did you mean '__builtin_ia32_paddw128'?
42 | return (__m128i) __builtin_ia32_phaddw128 ((__v8hi)__X, (__v8hi)__Y);
...
From what I can gather GCC isn't letting it use intrinsics without the relevant compiler flags -march=native or -msse4 etc.
If I pass -DCMAKE_CXX_FLAGS=-msse4 I can build it, but I don't know if that's any better than -march=native.
If I understand correctly then the problem is that common.h is getting included in files which don't actually need intrinsics?
I've no idea why I've successfully made Linux x64 builds with gcc but on Windows it complains.
I'm attempting to build with:
msys2-x86_64-20231026.exe and add C:\msys64\mingw64\bin to PATH
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
I've figured out that to use a static build of the library with Go on Windows I must use mingw-w64 to build it, builds from msvc are not supported.
So I've setup MSYS2 and building with gcc, however, I get a load of similar errors such as:
From what I can gather GCC isn't letting it use intrinsics without the relevant compiler flags -march=native or -msse4 etc. If I pass
-DCMAKE_CXX_FLAGS=-msse4
I can build it, but I don't know if that's any better than-march=native
.If I understand correctly then the problem is that common.h is getting included in files which don't actually need intrinsics?
I've no idea why I've successfully made Linux x64 builds with gcc but on Windows it complains.
I'm attempting to build with:
msys2-x86_64-20231026.exe and add C:\msys64\mingw64\bin to PATH pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
Thanks for the looking, this should be the last platform giving me problems.