JishinMaster/simd_utils

Multiple definitions regression

XapaJIaMnu opened this issue · 3 comments

Trying to upgrade I have some multiple definition issue:

In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:74:22: error: redefinition of ‘__m128i _mm_aesdec_si128(__m128i, __m128i)’
   74 | FORCE_INLINE __m128i _mm_aesdec_si128(__m128i a, __m128i RoundKey)
      |                      ^~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:11,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon.h:8969:22: note: ‘__m128i _mm_aesdec_si128(__m128i, __m128i)’ previously defined here
 8969 | FORCE_INLINE __m128i _mm_aesdec_si128(__m128i a, __m128i RoundKey)
      |                      ^~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:79:22: error: redefinition of ‘__m128i _mm_aesdeclast_si128(__m128i, __m128i)’
   79 | FORCE_INLINE __m128i _mm_aesdeclast_si128(__m128i a, __m128i RoundKey)
      |                      ^~~~~~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:11,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon.h:8989:22: note: ‘__m128i _mm_aesdeclast_si128(__m128i, __m128i)’ previously defined here
 8989 | FORCE_INLINE __m128i _mm_aesdeclast_si128(__m128i a, __m128i RoundKey)
      |                      ^~~~~~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:84:16: error: redefinition of ‘__m128i _mm_aesimc_si128(__m128i)’
   84 | inline __m128i _mm_aesimc_si128(__m128i a)
      |                ^~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:11,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon.h:8998:22: note: ‘__m128i _mm_aesimc_si128(__m128i)’ previously defined here
 8998 | FORCE_INLINE __m128i _mm_aesimc_si128(__m128i a)

However when using 6960362 this problem doesn't appear.
Ideas?

The latest commit should fix this (Thanks to @JoachimSchurig). sse2neon now inlcudes aes intrinsics.
I do not see the link between that and the _mm_stream_pd function.
It seems @jerinphilip did not propose this patch to sse2neon directly yet. I have reapplied the fix.

Do those patches need to be proposed to the sse2neon project explicitly?

For the AES ones they are now included in the sse2neon project. The _mm_stream_pd patch could be directly proposed to sse2neon.