"cc1plus: error: bad value (‘tigerlake’) for ‘-march=’ switch" compilation error
Asked Answered
O

2

11
cc1plus: error: bad value (‘tigerlake’) for ‘-march=’ switch

cc1plus: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 native

cc1plus: error: bad value (‘tigerlake’) for ‘-mtune=’ switch

cc1plus: note: valid arguments to ‘-mtune=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm intel x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 generic native

make[2]: *** [makefileCommon/compile.core.mk:240: /home/josue/Documents/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/lib/linux64/obj/Release/libs/openFrameworks/events/ofEvents.o] Error 1

make[1]: *** [makefileCommon/compile.core.mk:204: Release] Error 2

make[1]: Leaving directory '/home/josue/Documents/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/project'
make: *** [/home/josue/Documents/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:125: Release] Error 2

Whenever I try to compile using make command in the terminal I get this error. Program compiles and runs fine on my old laptop and my desktop. Using openframeworks library. I'm using the XPS 13 9310 which has a tigerlake processor which the error mentions. XPS is running Pop!_OS same as my desktop. Any help would be greatly appreciated.

Outclass answered 23/10, 2020 at 4:1 Comment(3)
Which compiler and version are you using?Bradberry
Just to be clear the error is not because your computer has the wrong processor in it. The error is because your compiler doesn't recognize that option. Most likely your compiler is too old to support this. Run gcc --version to see the version and gcc --target-help and search the output for the -mtune option to see which CPUs your version of the compiler supports.Zeta
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 I tried running apt update/upgrade and apt install I guess packages are out of date. I'll try installing it from elsewhere to see if it helps. Thank you.Outclass
O
7

Solved installing g++-10 and gcc-10 using:

sudo apt install g++-10
sudo apt install gcc-10

then running make with:

make CC=gcc-10 CPP=g++-10 CXX=g++-10 LD=g++-10

Thanks to Retired Ninja and MadScientist.

Outclass answered 23/10, 2020 at 15:56 Comment(0)
S
24

You can update gcc&g++ to a higher version(10):

sudo apt install gcc-10 g++-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10

then you can choose the default gcc version with the following order:

sudo update-alternatives --config gcc

ref: https://www.cnblogs.com/livelab/p/13049117.html

Schematize answered 10/3, 2021 at 9:51 Comment(1)
This should de the accepted answer. (The accepted answer is not working).Floury
O
7

Solved installing g++-10 and gcc-10 using:

sudo apt install g++-10
sudo apt install gcc-10

then running make with:

make CC=gcc-10 CPP=g++-10 CXX=g++-10 LD=g++-10

Thanks to Retired Ninja and MadScientist.

Outclass answered 23/10, 2020 at 15:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.