EleonoreMizo / fmtconv

Format conversion tools for Vapoursynth and Avisynth+
Do What The F*ck You Want To Public License
67 stars 14 forks source link

Linux: can only build with g++-4.9 #3

Closed darealshinji closed 9 years ago

darealshinji commented 9 years ago

I'm trying to build a package on Launchpad for Ubuntu 14.04. But I can only build it with g++-4.9 which isn't available in Ubuntu 14.04. Building with g++-4.8, clang++-3.5 or clang++-3.6 fails.

Here are the build logs:

g++-4.8

depbase=`echo ../../src/main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile g++-4.8 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" -DPACKAGE_STRING=\"fmtconv\ r15\" -DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php\?t=166504\" -DPACKAGE_URL=\"http://forum.doom9.org/showthread.php\?t=166504\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.    -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src  -MT ../../src/main.lo -MD -MP -MF $depbase.Tpo -c -o ../../src/main.lo ../../src/main.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++-4.8 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" "-DPACKAGE_STRING=\"fmtconv r15\"" "-DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php?t=166504\"" "-DPACKAGE_URL=\"http://forum.doom9.org/showthread.php?t=166504\"" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src -MT ../../src/main.lo -MD -MP -MF ../../src/.deps/main.Tpo -c ../../src/main.cpp  -fPIC -DPIC -o ../../src/.libs/main.o
In file included from ./../../src/fmtcl/FilterResize.h:36:0,
                 from ../../src/fmtc/Resample.h:32,
                 from ../../src/main.cpp:25:
./../../src/fmtcl/Scaler.h:247:40: error: '__m256' has not been declared
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                        ^
./../../src/fmtcl/Scaler.h:247:54: error: '__m256' has not been declared
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                      ^
./../../src/fmtcl/Scaler.h:247:157: error: '__m256i' does not name a type
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                             ^
./../../src/fmtcl/Scaler.h:247:166: error: ISO C++ forbids declaration of 'zero' with no type [-fpermissive]
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                      ^
./../../src/fmtcl/Scaler.h:247:194: error: '__m256' does not name a type
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                                                  ^
./../../src/fmtcl/Scaler.h:247:202: error: ISO C++ forbids declaration of 'add_cst' with no type [-fpermissive]
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                                                          ^
./../../src/fmtcl/Scaler.h:252:26: error: '__m256i' does not name a type
  static fstb_FORCEINLINE __m256i
                          ^
In file included from ../../src/main.cpp:27:0:
../../src/fmtc/Transfer.h:325:61: error: '__m256i' has not been declared
                  find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                             ^
../../src/fmtc/Transfer.h:325:77: error: '__m256' has not been declared
                  find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                             ^
../../src/fmtc/Transfer.h:345:61: error: '__m256i' has not been declared
                  find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                             ^
../../src/fmtc/Transfer.h:345:77: error: '__m256' has not been declared
                  find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                             ^
../../src/fmtc/Transfer.h:359:42: error: '__m256' has not been declared
                  store_avx2 (T *dst_ptr, __m256 val);
                                          ^
Makefile:937: recipe for target '../../src/main.lo' failed
make: *** [../../src/main.lo] Error 1

clang++-3.5

depbase=`echo ../../src/main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile clang++-3.5 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" -DPACKAGE_STRING=\"fmtconv\ r15\" -DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php\?t=166504\" -DPACKAGE_URL=\"http://forum.doom9.org/showthread.php\?t=166504\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.    -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src  -MT ../../src/main.lo -MD -MP -MF $depbase.Tpo -c -o ../../src/main.lo ../../src/main.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  clang++-3.5 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" "-DPACKAGE_STRING=\"fmtconv r15\"" "-DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php?t=166504\"" "-DPACKAGE_URL=\"http://forum.doom9.org/showthread.php?t=166504\"" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src -MT ../../src/main.lo -MD -MP -MF ../../src/.deps/main.Tpo -c ../../src/main.cpp  -fPIC -DPIC -o ../../src/.libs/main.o
In file included from ../../src/main.cpp:25:
In file included from ./../../src/fmtc/Resample.h:32:
In file included from ./../../src/fmtcl/FilterResize.h:36:
./../../src/fmtcl/Scaler.h:247:40: error: unknown type name '__m256'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                              ^
./../../src/fmtcl/Scaler.h:247:54: error: unknown type name '__m256'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                            ^
./../../src/fmtcl/Scaler.h:247:157: error: unknown type name '__m256i'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                                                                                                   ^
./../../src/fmtcl/Scaler.h:247:194: error: unknown type name '__m256'
  ...process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                                      ^
./../../src/fmtcl/Scaler.h:252:26: error: unknown type name '__m256i'
        static fstb_FORCEINLINE __m256i
                                ^
./../../src/fmtcl/Scaler.h:253:46: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                    ^
./../../src/fmtcl/Scaler.h:253:87: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                             ^
./../../src/fmtcl/Scaler.h:253:157: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                                                                                                   ^
./../../src/fmtcl/Scaler.h:253:194: error: unknown type name '__m256i'
  ...process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256i &sign_bit, int len);
                                                                                                                                                                                      ^
In file included from ../../src/main.cpp:27:
./../../src/fmtc/Transfer.h:325:61: error: unknown type name '__m256i'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                          ^
./../../src/fmtc/Transfer.h:325:77: error: unknown type name '__m256'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                                          ^
./../../src/fmtc/Transfer.h:345:61: error: unknown type name '__m256i'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                          ^
./../../src/fmtc/Transfer.h:345:77: error: unknown type name '__m256'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                                          ^
./../../src/fmtc/Transfer.h:359:42: error: unknown type name '__m256'
                               store_avx2 (T *dst_ptr, __m256 val);
                                                       ^
14 errors generated.
Makefile:937: recipe for target '../../src/main.lo' failed
make: *** [../../src/main.lo] Error 1

clang++-3.6

depbase=`echo ../../src/main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile clang++-3.6 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" -DPACKAGE_STRING=\"fmtconv\ r15\" -DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php\?t=166504\" -DPACKAGE_URL=\"http://forum.doom9.org/showthread.php\?t=166504\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.    -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src -Wno-tautological-undefined-compare -MT ../../src/main.lo -MD -MP -MF $depbase.Tpo -c -o ../../src/main.lo ../../src/main.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  clang++-3.6 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" "-DPACKAGE_STRING=\"fmtconv r15\"" "-DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php?t=166504\"" "-DPACKAGE_URL=\"http://forum.doom9.org/showthread.php?t=166504\"" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src -Wno-tautological-undefined-compare -MT ../../src/main.lo -MD -MP -MF ../../src/.deps/main.Tpo -c ../../src/main.cpp  -fPIC -DPIC -o ../../src/.libs/main.o
In file included from ../../src/main.cpp:25:
In file included from ./../../src/fmtc/Resample.h:32:
In file included from ./../../src/fmtcl/FilterResize.h:36:
./../../src/fmtcl/Scaler.h:247:40: error: unknown type name '__m256'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                              ^
./../../src/fmtcl/Scaler.h:247:54: error: unknown type name '__m256'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                            ^
./../../src/fmtcl/Scaler.h:247:157: error: unknown type name '__m256i'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                                                                                                   ^
./../../src/fmtcl/Scaler.h:247:194: error: unknown type name '__m256'
  ...process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                                      ^
./../../src/fmtcl/Scaler.h:252:26: error: unknown type name '__m256i'
        static fstb_FORCEINLINE __m256i
                                ^
./../../src/fmtcl/Scaler.h:253:46: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                    ^
./../../src/fmtcl/Scaler.h:253:87: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                             ^
./../../src/fmtcl/Scaler.h:253:157: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                                                                                                   ^
./../../src/fmtcl/Scaler.h:253:194: error: unknown type name '__m256i'
  ...process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256i &sign_bit, int len);
                                                                                                                                                                                      ^
In file included from ../../src/main.cpp:27:
./../../src/fmtc/Transfer.h:325:61: error: unknown type name '__m256i'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                          ^
./../../src/fmtc/Transfer.h:325:77: error: unknown type name '__m256'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                                          ^
./../../src/fmtc/Transfer.h:345:61: error: unknown type name '__m256i'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                          ^
./../../src/fmtc/Transfer.h:345:77: error: unknown type name '__m256'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                                          ^
./../../src/fmtc/Transfer.h:359:42: error: unknown type name '__m256'
                               store_avx2 (T *dst_ptr, __m256 val);
                                                       ^
14 errors generated.
Makefile:937: recipe for target '../../src/main.lo' failed
make: *** [../../src/main.lo] Error 1
4re commented 9 years ago

Maybe you are doing something wrong, it compiles just fine here with clang-3.6.1 I can't bother to install 3.6.0 because it is too time consuming on a gentoo, is that version not available on your distro?

4re commented 9 years ago

Ok, I did test gcc-4.8.4 and it compiled fine. I'm inclined to think there is absolutely nothing wrong with fmtconv and the problem lies on your toolchain.

Here fmtconv compiles fine with clang-3.6.1, gcc-4.8.4 and gcc-5.1.0

dubhater commented 9 years ago

I get the same errors when compiling with clang 3.6.1. gcc 5.1.0 is fine. They come straight from the Arch Linux package manager.

@4re: Does your CPU happen to have AVX2 and are you passing -march=native or similar? Scaler.h and Transfer.h mention the m256 and m256i types. They are included in main.cpp, which is not compiled with -mavx2. I'm inclined to believe clang is right to complain.

4re commented 9 years ago

@dubhater yes, I'm passing -march=native but my cpu is only avx capable, is an amd one.

4re commented 9 years ago

Ok, now back home I tested without -march=native and clang/gcc where not able to build it, same errors here. :(

darealshinji commented 9 years ago

Passing -march=native to CXXFLAGS makes it build with g++-4.8 and clang.

dubhater commented 9 years ago

Yes, but you shouldn't distribute the resulting binary.

darealshinji commented 9 years ago

Why not?

captainadamo commented 9 years ago

Because anyone who doesn't have CPU capabilities matching yours can't use the binary. For example, if your CPU can do AVX(2) whereas their's can't.

darealshinji commented 9 years ago

The latest commit fixed this issue for me. Now it builds without -march=native on all four c++ compilers.