simd-everywhere / simde

Implementations of SIMD instruction sets for systems which don't natively support them.
https://simd-everywhere.github.io/blog/
MIT License
2.43k stars 253 forks source link

error: ‘static To SIMDeCheckedReinterpretCastImpl [...] cannot be overloaded with ‘static To SIMDeCheckedReinterpretCastImpl [...] #230

Closed mr-c closed 4 years ago

mr-c commented 4 years ago
cd /build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu/src && /usr/lib/ccache/c++  -DHAVE_BZLIB=1 -DHAVE_POSIX_FADVISE=1 -DHAVE_POSIX_MADVISE=1 -DHAVE_ZLIB=1 -DOPENMP=1 -I/build/mmseqs2-11-e1a1c+ds/lib/tinyexpr -I/build/mmseqs2-11-e1a1c+ds/lib/microtar -I/build/mmseqs2-11-e1a1c+ds/lib -I/build/mmseqs2-11-e1a1c+ds/lib/simd -I/build/mmseqs2-11-e1a1c+ds/lib/alp -I/build/mmseqs2-11-e1a1c+ds/lib/cacode -I/build/mmseqs2-11-e1a1c+ds/lib/ksw2 -I/build/mmseqs2-11-e1a1c+ds/lib/xxhash -I/build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu/generated -I/build/mmseqs2-11-e1a1c+ds/src/alignment -I/build/mmseqs2-11-e1a1c+ds/src/clustering -I/build/mmseqs2-11-e1a1c+ds/src/commons -I/build/mmseqs2-11-e1a1c+ds/src/multihit -I/build/mmseqs2-11-e1a1c+ds/src/prefiltering -I/build/mmseqs2-11-e1a1c+ds/src/linclust -I/build/mmseqs2-11-e1a1c+ds/src/taxonomy -I/build/mmseqs2-11-e1a1c+ds/src/util -I/build/mmseqs2-11-e1a1c+ds/src/.  -g -O2 -fdebug-prefix-map=/build/mmseqs2-11-e1a1c+ds=. -fstack-protector-strong -Wformat -Werror=format-security -DSIMDE_ENABLE_OPENMP -fopenmp-simd -O3 -Wdate-time -D_FORTIFY_SOURCE=2    -std=c++0x -fno-exceptions -pedantic -Wall -Wextra -Wdisabled-optimization -fopenmp -o CMakeFiles/mmseqs-framework.dir/alignment/Alignment.cpp.o -c /build/mmseqs2-11-e1a1c+ds/src/alignment/Alignment.cpp
In file included from /usr/include/simde/x86/mmx.h:28,
                 from /usr/include/simde/x86/sse.h:32,
                 from /build/mmseqs2-11-e1a1c+ds/lib/simd/simd.h:54,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/Sequence.h:15,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/ProfileStates.h:11,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/SubstitutionMatrixProfileStates.h:5,
                 from /build/mmseqs2-11-e1a1c+ds/src/alignment/Alignment.cpp:1:
/usr/include/simde/simde-common.h: In instantiation of ‘class SIMDeCheckedReinterpretCastImpl<float*, float*>’:
/build/mmseqs2-11-e1a1c+ds/lib/simd/simd.h:628:5:   required from here
/usr/include/simde/simde-common.h:369:17: error: ‘static To SIMDeCheckedReinterpretCastImpl<To, From>::convert(From) [with To = float*; From = float*]’ cannot be overloaded with ‘static To SIMDeCheckedReinterpretCastImpl<To, From>::convert(To) [with To = float*; From = float*]’
  369 |       static To convert (From value) { return reinterpret_cast<To>(value); };
      |                 ^~~~~~~
/usr/include/simde/simde-common.h:368:17: note: previous declaration ‘static To SIMDeCheckedReinterpretCastImpl<To, From>::convert(To) [with To = float*; From = float*]’
  368 |       static To convert (To value) { return value; };
      |                 ^~~~~~~
In file included from /usr/include/simde/x86/sse3.h:29,
                 from /usr/include/simde/x86/ssse3.h:29,
                 from /usr/include/simde/x86/sse4.1.h:28,
                 from /build/mmseqs2-11-e1a1c+ds/lib/simd/simd.h:284,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/Sequence.h:15,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/ProfileStates.h:11,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/SubstitutionMatrixProfileStates.h:5,
                 from /build/mmseqs2-11-e1a1c+ds/src/alignment/Alignment.cpp:1:
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h: In static member function ‘static __m128i Itoa::Convert8DigitsSSE2(uint32_t)’:
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:74:69: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   74 |         const __m128i abcd = _mm_srli_epi64(_mm_mul_epu32(abcdefgh, reinterpret_cast<const __m128i*>(kDiv10000Vector)[0]), 45);
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:74:69: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   74 |         const __m128i abcd = _mm_srli_epi64(_mm_mul_epu32(abcdefgh, reinterpret_cast<const __m128i*>(kDiv10000Vector)[0]), 45);
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:75:74: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   75 |         const __m128i efgh = _mm_sub_epi32(abcdefgh, _mm_mul_epu32(abcd, reinterpret_cast<const __m128i*>(k10000Vector)[0]));
      |                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/simde/x86/sse3.h:29,
                 from /usr/include/simde/x86/ssse3.h:29,
                 from /usr/include/simde/x86/sse4.1.h:28,
                 from /build/mmseqs2-11-e1a1c+ds/lib/simd/simd.h:284,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/Sequence.h:15,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/ProfileStates.h:11,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/SubstitutionMatrixProfileStates.h:5,
                 from /build/mmseqs2-11-e1a1c+ds/src/alignment/Alignment.cpp:1:
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:88:48: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   88 |         const __m128i v3 = _mm_mulhi_epu16(v2, reinterpret_cast<const __m128i*>(kDivPowersVector)[0]);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:89:48: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   89 |         const __m128i v4 = _mm_mulhi_epu16(v3, reinterpret_cast<const __m128i*>(kShiftPowersVector)[0]);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:92:48: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   92 |         const __m128i v5 = _mm_mullo_epi16(v4, reinterpret_cast<const __m128i*>(k10Vector)[0]);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [src/CMakeFiles/mmseqs-framework.dir/build.make:66: src/CMakeFiles/mmseqs-framework.dir/alignment/Alignment.cpp.o] Error 1
make[4]: Leaving directory '/build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu'
make[3]: *** [CMakeFiles/Makefile2:691: src/CMakeFiles/mmseqs-framework.dir/all] Error 2
make[3]: Leaving directory '/build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu'
make[2]: *** [Makefile:133: all] Error 2
make[2]: Leaving directory '/build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu'

Source tree with Debian patches (including simde) applied: https://github.com/mr-c/MMseqs2/tree/11-e1a1c-deb-1

Compiled in Debian Unstable using the following packages

ii  cmake             3.16.3-2             arm64        cross-platform, open-source make system
ii  libbz2-dev:arm64  1.0.8-2              arm64        high-quality block-sorting file compressor library - development
ii  libgzstream-dev   1.5+dfsg-4           arm64        provide functionality of zlib C-library in a C++ iostream (development)
ii  libsimde-dev      0.0.0.git.20200421-1 all          Implementations of SIMD instructions for all systems
ii  libzstd-dev:arm64 1.4.4+dfsg-3         arm64        fast lossless compression algorithm -- development files
ii  zlib1g-dev:arm64  1:1.2.11.dfsg-2      arm64        compression library - development
ii  dpkg-dev        1.19.7       all          Debian package development tools
ii  g++             4:9.2.1-3.1  arm64        GNU C++ compiler
ii  gcc             4:9.2.1-3.1  arm64        GNU C compiler
ii  libc6-dev:arm64 2.30-4       arm64        GNU C Library: Development Libraries and Header Files
ii  make            4.2.1-1.2    arm64        utility for directing compilation
mr-c commented 4 years ago

Similar error with a newer libsimde-dev package made from https://github.com/nemequ/simde/commit/8fdc596061c740477649b903a6f7e1fb55fc3062

cd /build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu/src && /usr/lib/ccache/c++  -DHAVE_BZLIB=1 -DHAVE_POSIX_FADVISE=1 -DHAVE_POSIX_MADVISE=1 -DHAVE_ZLIB=1 -DOPENMP=1 -I/build/mmseqs2-11-e1a1c+ds/lib/tinyexpr -I/build/mmseqs2-11-e1a1c+ds/lib/microtar -I/build/mmseqs2-11-e1a1c+ds/lib -I/build/mmseqs2-11-e1a1c+ds/lib/simd -I/build/mmseqs2-11-e1a1c+ds/lib/alp -I/build/mmseqs2-11-e1a1c+ds/lib/cacode -I/build/mmseqs2-11-e1a1c+ds/lib/ksw2 -I/build/mmseqs2-11-e1a1c+ds/lib/xxhash -I/build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu/generated -I/build/mmseqs2-11-e1a1c+ds/src/alignment -I/build/mmseqs2-11-e1a1c+ds/src/clustering -I/build/mmseqs2-11-e1a1c+ds/src/commons -I/build/mmseqs2-11-e1a1c+ds/src/multihit -I/build/mmseqs2-11-e1a1c+ds/src/prefiltering -I/build/mmseqs2-11-e1a1c+ds/src/linclust -I/build/mmseqs2-11-e1a1c+ds/src/taxonomy -I/build/mmseqs2-11-e1a1c+ds/src/util -I/build/mmseqs2-11-e1a1c+ds/src/.  -g -O2 -fdebug-prefix-map=/build/mmseqs2-11-e1a1c+ds=. -fstack-protector-strong -Wformat -Werror=format-security -DSIMDE_ENABLE_OPENMP -fopenmp-simd -O3 -Wdate-time -D_FORTIFY_SOURCE=2    -std=c++0x -fno-exceptions -pedantic -Wall -Wextra -Wdisabled-optimization -fopenmp -o CMakeFiles/mmseqs-framework.dir/alignment/Alignment.cpp.o -c /build/mmseqs2-11-e1a1c+ds/src/alignment/Alignment.cpp
In file included from /usr/include/simde/x86/mmx.h:28,
                 from /usr/include/simde/x86/sse.h:32,
                 from /build/mmseqs2-11-e1a1c+ds/lib/simd/simd.h:54,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/Sequence.h:15,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/ProfileStates.h:11,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/SubstitutionMatrixProfileStates.h:5,
                 from /build/mmseqs2-11-e1a1c+ds/src/alignment/Alignment.cpp:1:
/build/mmseqs2-11-e1a1c+ds/lib/simd/simd.h: In function ‘float ScalarProd20(const float*, const float*)’:
/build/mmseqs2-11-e1a1c+ds/lib/simd/simd.h:628:5: error: call of overloaded ‘convert<float*, simde_float32*>(float*)’ is ambiguous
  628 |     _mm_store_ss(&res, R);
      |     ^~~~~~~~~~~~
/usr/include/simde/simde-common.h:376:53: note: candidate: ‘To SIMDeCheckedReinterpretCastImpl::convert(To) [with To = float*; From = float*]’
  376 |     template <typename To, typename From> static To convert (To value) { return value; }
      |                                                     ^~~~~~~
/usr/include/simde/simde-common.h:377:53: note: candidate: ‘To SIMDeCheckedReinterpretCastImpl::convert(From) [with To = float*; From = float*]’
  377 |     template <typename To, typename From> static To convert (From value) { return reinterpret_cast<To>(value); }
      |                                                     ^~~~~~~
In file included from /usr/include/simde/x86/sse3.h:29,
                 from /usr/include/simde/x86/ssse3.h:29,
                 from /usr/include/simde/x86/sse4.1.h:28,
                 from /build/mmseqs2-11-e1a1c+ds/lib/simd/simd.h:284,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/Sequence.h:15,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/ProfileStates.h:11,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/SubstitutionMatrixProfileStates.h:5,
                 from /build/mmseqs2-11-e1a1c+ds/src/alignment/Alignment.cpp:1:
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h: In static member function ‘static __m128i Itoa::Convert8DigitsSSE2(uint32_t)’:
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:74:69: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   74 |         const __m128i abcd = _mm_srli_epi64(_mm_mul_epu32(abcdefgh, reinterpret_cast<const __m128i*>(kDiv10000Vector)[0]), 45);
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:74:69: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   74 |         const __m128i abcd = _mm_srli_epi64(_mm_mul_epu32(abcdefgh, reinterpret_cast<const __m128i*>(kDiv10000Vector)[0]), 45);
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:75:74: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   75 |         const __m128i efgh = _mm_sub_epi32(abcdefgh, _mm_mul_epu32(abcd, reinterpret_cast<const __m128i*>(k10000Vector)[0]));
      |                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/simde/x86/sse3.h:29,
                 from /usr/include/simde/x86/ssse3.h:29,
                 from /usr/include/simde/x86/sse4.1.h:28,
                 from /build/mmseqs2-11-e1a1c+ds/lib/simd/simd.h:284,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/Sequence.h:15,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/ProfileStates.h:11,
                 from /build/mmseqs2-11-e1a1c+ds/src/commons/SubstitutionMatrixProfileStates.h:5,
                 from /build/mmseqs2-11-e1a1c+ds/src/alignment/Alignment.cpp:1:
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:88:48: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   88 |         const __m128i v3 = _mm_mulhi_epu16(v2, reinterpret_cast<const __m128i*>(kDivPowersVector)[0]);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:89:48: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   89 |         const __m128i v4 = _mm_mulhi_epu16(v3, reinterpret_cast<const __m128i*>(kShiftPowersVector)[0]);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/mmseqs2-11-e1a1c+ds/src/commons/itoa.h:92:48: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   92 |         const __m128i v5 = _mm_mullo_epi16(v4, reinterpret_cast<const __m128i*>(k10Vector)[0]);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [src/CMakeFiles/mmseqs-framework.dir/build.make:66: src/CMakeFiles/mmseqs-framework.dir/alignment/Alignment.cpp.o] Error 1
make[4]: Leaving directory '/build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu'
make[3]: *** [CMakeFiles/Makefile2:691: src/CMakeFiles/mmseqs-framework.dir/all] Error 2
make[3]: Leaving directory '/build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu'
make[2]: *** [Makefile:133: all] Error 2
make[2]: Leaving directory '/build/mmseqs2-11-e1a1c+ds/obj-aarch64-linux-gnu'
mr-c commented 4 years ago

Thanks!