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.
CFLAGS, in the second line you rungccbut having nothing aboutCFLAGSor-msse4.1option in the gcc command line. If you run the command manually, just put-msse4.1in thegcccommand, you don't need to setCFLAGS. (CFLAGS is used for Makefile)