- 主题:mingw编译sse指令报错
今天好不容易把gcc的版本从4,80升级到4.93了,这个不在于版本推进了多少?
而是知道如何升级的版本的方法。
机器也换了win 10,升级的gcc可以编译代码了。
遇到的问题是,我 用 lame-3.99.5 来测试,配置完美通过,
编译报错,出错指令是sse,我怀疑我的sse的代码库没有装上的关系。
不知道如何搜索这方面的信息。
现在我无法贴出错信息,因为我现在在编译ffmpeg做测试。
In file included from xmm_quantize_sub.c:37:0:
c:\mingw\lib\gcc\mingw32\4.9.3\include\xmmintrin.h:229:1: error: inlining failed in call to always_inline '_mm_max_ps': target specific option mismatch
_mm_max_ps (__m128 __A, __m128 __B)
出错信息
搜索到的解决方法
这个问题 添加编译选项
-mfma
没有解决掉
Viewed 4k times
1
I am building a c program in Ubuntu-16.04. As followed in one of the other answer here, I have set the cflag enviornment variable and I am running gcc command as shown below
export CFLAGS="-msse4.1"
gcc -o dpdkif_user.o -O2 -g -Wno-format-zero-length -Wno-pointer-sign -Werror -I/home/nikhil/projects/drv-netif-dpdk/rumptools/dest/usr/include -U_FORTIFY_SOURCE -DVIRTIF_BASE=dpdk -I/home/nikhil/projects/drv-netif-dpdk/src/libdpdkif/virtif -I/home/nikhil/projects/dpdk/build/include -c dpdkif_user.c
Gcc version
cc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
However, I am still seeing the following error:
/usr/lib/gcc/x86_64-linux-gnu/5/include/tmmintrin.h:185:1: error: inlining failed in call to always_inline ‘_mm_alignr_epi8’: target specific option mismatch
_mm_alignr_epi8(__m128i __X, __m128i __Y, const int __N)
^
In file included from /home/nikhil/projects/dpdk/build/include/rte_ether.h:50:0,
from dpdkif_user.c:47:
/home/nikhil/projects/dpdk/build/include/rte_memcpy.h:641:13: error: called from here
_mm_storeu_si128((__m128i *)((uint8_t *)dst + 1 * 16), _mm_alignr_epi8(xmm2, xmm1, offset)); \
^
/home/nikhil/projects/dpdk/build/include/rte_memcpy.h:681:16: note: in expansion of macro ‘MOVEUNALIGNED_LEFT47_IMM’
case 0x0F: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0F); break; \
^
/home/nikhil/projects/dpdk/build/include/rte_memcpy.h:821:2: note: in expansion of macro ‘MOVEUNALIGNED_LEFT47’
What am I missing? Any help with this is greatly appreciated.
c gcc
share improve this question follow
asked Dec 1 '17 at 6:08
Nikhil
1,72433 gold badges2525 silver badges4343 bronze badges
1
I don't see an MCVE here... – Tom Karzes Dec 1 '17 at 6:15
The question I've linked above is similar to what I've asked. It is extending the already asked question – Nikhil Dec 1 '17 at 6:20
Actually, the commands you are running makes no sense at all. In the first line you set CFLAGS, in the second line you run gcc but having nothing about CFLAGS or -msse4.1 option in the gcc command line. If you run the command manually, just put -msse4.1 in the gcc command, you don't need to set CFLAGS. (CFLAGS is used for Makefile)
The inlining failure reason target specific option mismatch means that inlining failed because the program calls an always-inline function with a specific target attribute from another function which does not support this target. This is really something that is not supportable: the compiler cannot both compile a function to use certain micro-architecture features (the always-inline function) and not use them (the function into which is inlined).
In this particular case, the cause seems to be that the DPDK sources use compiler intrinsics, but you do not compile with the necessary subtarget option. You may have set the CFLAGS variable, but it does not seem to have any affect on the compilation (it is not part of the command line you quoted). Furthermore, tmmintrin.h needs -mssse3, not -msse4.1. The DPDK makefiles should take care of all these details.
--
修改:javame FROM 58.37.37.*
FROM 58.37.37.*
sse不需要专门安装代码库吧?告警不是说在CFLAGS中加-msse4.1吗,试一试。
【 在 javame 的大作中提到: 】
:
: 今天好不容易把gcc的版本从4,80升级到4.93了,这个不在于版本推进了多少?
: 而是知道如何升级的版本的方法。
: 机器也换了win 10,升级的gcc可以编译代码了。
:
: 遇到的问题是,我 用 lame-3.99.5 来测试,配置完美通过,
: 编译报错,出错指令是sse,我怀疑我的sse的代码库没有装上的关系。
: 不知道如何搜索这方面的信息。
:
: 现在我无法贴出错信息,因为我现在在编译ffmpeg做测试。
:
: In file included from xmm\_quantize\_sub.c:37:0:
: c:mingwlibgccmingw324.9.3includexmmintrin.h:229:1: error: inlining failed in call to always\_inline '\_mm\_max\_ps': target specific option mismatch
: \_mm\_max\_ps (\_\_m128 \_\_A, \_\_m128 __B)
:
: 出错信息
:
: 搜索到的解决方法
:
: 这个问题 添加编译选项
:
: -mfma
:
: 没有解决掉
:
: Viewed 4k times
:
: 1
:
: I am building a c program in Ubuntu-16.04. As followed in one of the other answer here, I have set the cflag enviornment variable and I am running gcc command as shown below
:
: export CFLAGS="-msse4.1"
: gcc -o dpdkif\_user.o -O2 -g -Wno-format-zero-length -Wno-pointer-sign -Werror -I/home/nikhil/projects/drv-netif-dpdk/rumptools/dest/usr/include -U\_FORTIFY\_SOURCE -DVIRTIF\_BASE=dpdk -I/home/nikhil/projects/drv-netif-dpdk/src/libdpdkif/virtif -I/home/nikhil/projects/dpdk/build/include -c dpdkif_user.c
: Gcc version
:
: cc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
: However, I am still seeing the following error:
:
: /usr/lib/gcc/x86\_64-linux-gnu/5/include/tmmintrin.h:185:1: error: inlining failed in call to always\_inline ‘\_mm\_alignr_epi8’: target specific option mismatch
: \_mm\_alignr\_epi8(\_\_m128i \_\_X, \_\_m128i \_\_Y, const int \_\_N)
: ^
: In file included from /home/nikhil/projects/dpdk/build/include/rte_ether.h:50:0,
: from dpdkif_user.c:47:
: /home/nikhil/projects/dpdk/build/include/rte_memcpy.h:641:13: error: called from here
: \_mm\_storeu\_si128((\_\_m128i *)((uint8\_t *)dst + 1 * 16), \_mm\_alignr\_epi8(xmm2, xmm1, offset)); \
: ^
: /home/nikhil/projects/dpdk/build/include/rte\_memcpy.h:681:16: note: in expansion of macro ‘MOVEUNALIGNED\_LEFT47_IMM’
: case 0x0F: MOVEUNALIGNED\_LEFT47\_IMM(dst, src, n, 0x0F); break; \
: ^
: /home/nikhil/projects/dpdk/build/include/rte\_memcpy.h:821:2: note: in expansion of macro ‘MOVEUNALIGNED\_LEFT47’
: What am I missing? Any help with this is greatly appreciated.
:
: c gcc
: share improve this question follow
: asked Dec 1 '17 at 6:08
:
: Nikhil
: 1,72433 gold badges2525 silver badges4343 bronze badges
: 1
: I don't see an MCVE here... – Tom Karzes Dec 1 '17 at 6:15
: The question I've linked above is similar to what I've asked. It is extending the already asked question – Nikhil Dec 1 '17 at 6:20
: Actually, the commands you are running makes no sense at all. In the first line you set CFLAGS, in the second line you run gcc but having nothing about CFLAGS or -msse4.1 option in the gcc command line. If you run the command manually, just put -msse4.1 in the gcc command, you don't need to set CFLAGS. (CFLAGS is used for Makefile)
:
: The inlining failure reason target specific option mismatch means that inlining failed because the program calls an always-inline function with a specific target attribute from another function which does not support this target. This is really something that is not supportable: the compiler cannot both compile a function to use certain micro-architecture features (the always-inline function) and not use them (the function into which is inlined).
:
: In this particular case, the cause seems to be that the DPDK sources use compiler intrinsics, but you do not compile with the necessary subtarget option. You may have set the CFLAGS variable, but it does not seem to have any affect on the compilation (it is not part of the command line you quoted). Furthermore, tmmintrin.h needs -mssse3, not -msse4.1. The DPDK makefiles should take care of all these details.
:
: --
发自「今日水木 on Mi Note 3」
--
修改:GoGoRoger FROM 106.121.65.*
FROM 106.121.65.*
好的,就去试一下。
谢谢你。
【 在 GoGoRoger 的大作中提到: 】
: sse不需要专门安装代码库吧?告警不是说在CFLAGS中加-msse4.1吗,试一试。
:
: 发自「今日水木 on Mi Note 3」
--
FROM 116.231.61.*
问题解决了,就是加上-msse
【 在 GoGoRoger (GoGoRoger) 的大作中提到: 】
: sse不需要专门安装代码库吧?告警不是说在CFLAGS中加-msse4.1吗,试一试。
: 发自「今日水木 on Mi Note 3」
--
FROM 124.78.13.*
gcc 4.93?
MSYS2的GCC已经是v10.2.0了
gcc -v
Using built-in specs.
COLLECT_GCC=D:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=D:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-10.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++ --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --disable-plugin --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev1, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (Rev1, Built by MSYS2 project)
--
FROM 222.212.186.*
他是几个版面知名的没困难创造困难人士…
【 在 poocp 的大作中提到: 】
: gcc 4.93?
: MSYS2的GCC已经是v10.2.0了
: gcc -v
: ...................
--
FROM 114.249.195.*