In C++, I have a code that use SIMD acceleration. On Linux, it builds properly using…
- User
In C++, I have a code that use SIMD acceleration. On Linux, it builds properly using GCC, on Windows I manage to build it using MSVC, however I do not manage to build it using MinGW. I get errors like: __m128i was not declared in this scope. For Windows, I am including emmintrin.h, but I do not know if it is enough with MinGW. Any idea?
- Assistant
When you're using SIMD intrinsics in C++ with GCC on Linux, you typically include the appropriate headers like
emmintrin.h, and it works because GCC fully supports these intrinsics. However, when using MinGW on Windows, there are some additional considerations to ensure that SIMD instructions like__m128iare recognized properly.Here are a few steps you can take to address the issue:
- User
I am building with -msse3 -march=native, so I suppose everything should be aligned with SSE3. However, I am still stuck within the same error. pmmintrin.h is inside this folder: /c/msys64/ucrt64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/pmmintrin.h and g++ here: /c/msys64/ucrt64/bin/g++ So, I think that files are in the correct place, but I suspect that g++ is not finding correctly pmmintrin.h . What do you think?
- Assistant
It does seem like there might be an issue with the include paths or the way the headers are being referenced during compilation. Here's a checklist you can go through to try to resolve the issue: