Skip to content

编译pika报error unrecognized command line option ' m

  • what: 无编译pika报error: unrecognized command line option '-msse4.2'
  • where: centos8 aarch64
  • when: 2021.1.4
  • who: JRT
  • why:
  • how:
  • release: 3.6.6

1.问题描述

使用PORTABLE=1 make编译报如下错:

make[1]: Entering directory `/jrt/pika/third/slash/slash'
g++: error: unrecognized command line option '-msse'
g++: error: unrecognized command line option '-msse4.2'
g++: error: unrecognized command line option '-msse'
g++: error: unrecognized command line option '-msse4.2'
g++: error: unrecognized command line option '-msse'
g++: error: unrecognized command line option '-msse4.2'
g++: error: unrecognized command line option '-msse'
g++: error: unrecognized command line option '-msse4.2'
g++: error: unrecognized command line option '-msse'
g++: error: unrecognized command line option '-msse4.2'
g++: error: unrecognized command line option '-msse'

2.问题分析

-msse -msse4.2是x86专属的识别硬件参数,arm没有,需要删除

3.问题解决

利用grep -r msse找到所有带这个参数的文本,进入文本删除该两个参数,若语法中引号中只有该参数,删除该参数时并删除引号

[root@598939ec6129 pika]# grep -r msse
Makefile:PLATFORM_CXXFLAGS= -std=c++11 -fno-builtin-memcmp -msse -msse4.2 
third/blackwidow/benchmark/Makefile:CXXFLAGS=-O2 -std=c++11 -fno-builtin-memcmp -msse -msse4.2
third/blackwidow/tests/Makefile:CXXFLAGS= -g -std=c++11 -fno-builtin-memcmp -msse -msse4.2
third/blackwidow/Makefile:CXXFLAGS= -g -std=c++11 -fno-builtin-memcmp -msse -msse4.2 -pipe -fPIC
third/blackwidow/examples/Makefile:CXXFLAGS=-O2 -std=c++11 -fno-builtin-memcmp -mss -msse4.2