animetosho / par2cmdline-turbo

par2cmdline × ParPar: speed focused par2cmdline fork
http://parchive.sourceforge.net
GNU General Public License v2.0
97 stars 7 forks source link

Error in makefile when compiling on rocky linux 8 #35

Open Exist2Resist opened 1 month ago

Exist2Resist commented 1 month ago

I am using the following commands to build par2cmdline-turbo in a rocky linu8 container.

git clone https://github.com/animetosho/par2cmdline-turbo.git
cd par2cmdline-turbo
aclocal
automake --add-missing
autoconf
./configure
make
make install

This was working a couple months ago, I haven't changed anything and my automated builds are failing at the moment with the following error.

#9 76.31 parpar/gf16/gf16_shuffle_avx512.c:6:16: warning: implicit declaration of function '_mm512_set_epi16'; did you mean '_mm512_set1_epi16'? [-Wimplicit-function-declaration]
#9 76.31  #define _MM(f) _mm512_ ## f
#9 76.31                 ^~~~~~~
#9 76.31 parpar/gf16/gf16_checksum_x86.h:191:42: note: in expansion of macro '_MM'
#9 76.31    _mword r = _MM(permutex2var_epi16)(w1, _MM(set_epi16)(
#9 76.31                                           ^~~
#9 76.31 parpar/gf16/gf16_shuffle_avx512.c:6:16: error: incompatible type for argument 2 of '_mm512_permutex2var_epi16'
#9 76.31  #define _MM(f) _mm512_ ## f
#9 76.31 parpar/gf16/gf16_checksum_x86.h:191:42: note: in expansion of macro '_MM'
#9 76.31    _mword r = _MM(permutex2var_epi16)(w1, _MM(set_epi16)(
#9 76.31                                           ^~~
#9 76.31 In file included from /usr/lib/gcc/x86_64-redhat-linux/8/include/immintrin.h:55,
#9 76.31                  from parpar/gf16/../src/platform.h:183,
#9 76.31                  from parpar/gf16/gf16_shuffle_avx512.c:2:
#9 76.31 /usr/lib/gcc/x86_64-redhat-linux/8/include/avx512bwintrin.h:841:49: note: expected '__m512i' {aka '__vector(8) long long int'} but argument is of type 'int'
#9 76.31  _mm512_permutex2var_epi16 (__m512i __A, __m512i __I, __m512i __B)
#9 76.31                                          ~~~~~~~~^~~
#9 76.31 parpar/gf16/gf16_checksum_x86.h: In function 'gf16_ungrp2b_block_avx512':
#9 76.31 parpar/gf16/gf16_shuffle_avx512.c:6:16: error: incompatible type for argument 2 of '_mm512_permutex2var_epi16'
#9 76.31  #define _MM(f) _mm512_ ## f
#9 76.31 parpar/gf16/gf16_checksum_x86.h:220:42: note: in expansion of macro '_MM'
#9 76.31    _mword r = _MM(permutex2var_epi16)(w1, _MM(set_epi16)(
#9 76.31                                           ^~~
#9 76.31 In file included from /usr/lib/gcc/x86_64-redhat-linux/8/include/immintrin.h:55,
#9 76.31                  from parpar/gf16/../src/platform.h:183,
#9 76.31                  from parpar/gf16/gf16_shuffle_avx512.c:2:
#9 76.31 /usr/lib/gcc/x86_64-redhat-linux/8/include/avx512bwintrin.h:841:49: note: expected '__m512i' {aka '__vector(8) long long int'} but argument is of type 'int'
#9 76.31  _mm512_permutex2var_epi16 (__m512i __A, __m512i __I, __m512i __B)
#9 76.31                                          ~~~~~~~~^~~
#9 76.35 make[1]: *** [Makefile:2236: parpar/gf16/libparpar_gf16_avx512_a-gf16_shuffle_avx512.o] Error 1
#9 76.35 make[1]: Leaving directory '/par2cmdline-turbo'
#9 76.35 make: *** [Makefile:1304: all] Error 2
#9 76.39 gcc -DHAVE_CONFIG_H -I.  -Wall -DNDEBUG -DPARPAR_ENABLE_HASHER_MD5CRC -DPARPAR_INVERT_SUPPORT -DPARPAR_SLIM_GF16  -mavx512vl -mavx512bw -D_POSIX_C_SOURCE=200112L -D_DARWIN_C_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE -g -O2 -std=c99 -MT parpar/gf16/libparpar_gf16_avx512_a-gf16_shuffle_avx512.o -MD -MP -MF parpar/gf16/.deps/libparpar_gf16_avx512_a-gf16_shuffle_avx512.Tpo -c -o parpar/gf16/libparpar_gf16_avx512_a-gf16_shuffle_avx512.o `test -f 'parpar/gf16/gf16_shuffle_avx512.c' || echo './'`parpar/gf16/gf16_shuffle_avx512.c
#9 76.49 parpar/gf16/gf16_checksum_x86.h: In function 'gf16_ungrp2a_block_avx512':
#9 76.49 parpar/gf16/gf16_shuffle_avx512.c:6:16: warning: implicit declaration of function '_mm512_set_epi16'; did you mean '_mm512_set1_epi16'? [-Wimplicit-function-declaration]
#9 76.49  #define _MM(f) _mm512_ ## f
#9 76.49                 ^~~~~~~
#9 76.49 parpar/gf16/gf16_checksum_x86.h:191:42: note: in expansion of macro '_MM'
#9 76.49    _mword r = _MM(permutex2var_epi16)(w1, _MM(set_epi16)(
#9 76.49                                           ^~~
#9 76.49 parpar/gf16/gf16_shuffle_avx512.c:6:16: error: incompatible type for argument 2 of '_mm512_permutex2var_epi16'
#9 76.49  #define _MM(f) _mm512_ ## f
#9 76.49 parpar/gf16/gf16_checksum_x86.h:191:42: note: in expansion of macro '_MM'
#9 76.49    _mword r = _MM(permutex2var_epi16)(w1, _MM(set_epi16)(
#9 76.49                                           ^~~
#9 76.49 In file included from /usr/lib/gcc/x86_64-redhat-linux/8/include/immintrin.h:55,
#9 76.49                  from parpar/gf16/../src/platform.h:183,
#9 76.49                  from parpar/gf16/gf16_shuffle_avx512.c:2:
#9 76.49 /usr/lib/gcc/x86_64-redhat-linux/8/include/avx512bwintrin.h:841:49: note: expected '__m512i' {aka '__vector(8) long long int'} but argument is of type 'int'
#9 76.49  _mm512_permutex2var_epi16 (__m512i __A, __m512i __I, __m512i __B)
#9 76.49                                          ~~~~~~~~^~~
#9 76.49 parpar/gf16/gf16_checksum_x86.h: In function 'gf16_ungrp2b_block_avx512':
#9 76.49 parpar/gf16/gf16_shuffle_avx512.c:6:16: error: incompatible type for argument 2 of '_mm512_permutex2var_epi16'
#9 76.49  #define _MM(f) _mm512_ ## f
#9 76.49 parpar/gf16/gf16_checksum_x86.h:220:42: note: in expansion of macro '_MM'
#9 76.49    _mword r = _MM(permutex2var_epi16)(w1, _MM(set_epi16)(
#9 76.49                                           ^~~
#9 76.49 In file included from /usr/lib/gcc/x86_64-redhat-linux/8/include/immintrin.h:55,
#9 76.49                  from parpar/gf16/../src/platform.h:183,
#9 76.49                  from parpar/gf16/gf16_shuffle_avx512.c:2:
#9 76.49 /usr/lib/gcc/x86_64-redhat-linux/8/include/avx512bwintrin.h:841:49: note: expected '__m512i' {aka '__vector(8) long long int'} but argument is of type 'int'
#9 76.49  _mm512_permutex2var_epi16 (__m512i __A, __m512i __I, __m512i __B)
#9 76.49                                          ~~~~~~~~^~~
#9 76.53 make: *** [Makefile:2236: parpar/gf16/libparpar_gf16_avx512_a-gf16_shuffle_avx512.o] Error 1
animetosho commented 1 month ago

Thanks for reporting.
For some reason, it looks like the _mm512_set_epi16 intrinsic is missing in your setup, even though _mm512_set1_epi16 exists.

Do you know what version of GCC you have?

animetosho commented 1 month ago

Turns out GCC prior to 9 lacks the intrinsic, and I had already made a fix for it.

I'll get around to merging ParPar's changes into this some day.

Thanks again for reporting!

Exist2Resist commented 1 month ago

That's super weird it was building without issues a few months ago. Looks like GCC on rocky 8 is gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22)

For now my workaround is to just copy the binary, it's under 1 MB so no big deal. I'll check if there is an updated version of GCC i can pull for the image. Looks like that is the highest version for rocky 8.

Thanks

animetosho commented 1 month ago

It could've been a change I made somewhere that broke it. I usually test with a few compilers, but GCC 8 isn't in the suite.

You can also apply the fix here if you prefer.