0

I use ODB Library in my programm. By compiling I get the following message:

[  1%] Generating ../odb_gen/XXX_odb.cpp
cc1plus: error: bad value (‘/dev/null’) for ‘-mtune=’ switch
cc1plus: error: bad value (‘/dev/null’) 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 bonnell atom silvermont slm knl 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 btver1 btver2 generic
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 bonnell atom silvermont slm knl 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 btver1 btver2 generic
XXXX/build.make:249: recipe for target 'odb_gen/XXX_odb.cpp' failed
make[2]: *** [odb_gen/XXX_odb.cpp] Error 1

I don't know what is the reason for this error message, therefore I don't understand how I can fix it. I would appreciate if someone can give a start point or explanation what can cause such behaviour. Thank you in advance!

PS: why was the 'mtune' option set to /dev/null?

1
  • 1
    You need to be able to see the command line hidden by cmake (I'm guessing you're using that) — until you can see what command is being run, there is nothing you or we can do to help. Apparently, it was set by the CMake configuration incorrectly. You're likely to have to debug that, therefore. Mar 19, 2020 at 18:16

2 Answers 2

1

Same issue after update to Ubuntu 18.04.4 (GCC 7.5.0)

Using older GCC worked for me

sudo apt-get install gcc-7-base=7.3.0-16ubuntu3 cpp-7=7.3.0-16ubuntu3 gcc-7=7.3.0-16ubuntu3 libgcc-7-dev=7.3.0-16ubuntu3 libasan4=7.3.0-16ubuntu3 libubsan0=7.3.0-16ubuntu3 libcilkrts5=7.3.0-16ubuntu3  
sudo apt-get install g++-7=7.3.0-16ubuntu3 libstdc++-7-dev=7.3.0-16ubuntu3  
sudo ln -s /usr/bin/g++-7 /usr/bin/g++  
sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc  
sudo ln -s /usr/bin/gcc /usr/bin/cc
0

I am suddenly getting the same problem after using odb successfully for several months. To move this forward, can you try adding the -v command when calling odb? This will add verbose output. I suspect that the version of g++ that you have installed is incompatible with odb 2.4.0, which was released about 5 years ago and the original developers might not have tested it against the latest version of gcc. I am currently running gcc 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04).

Were you able to compile with odb before? Have you updated gcc recently? I would also recommend changing the title of your issue to include the keyword "odb" so that it can be found by others more easily.

1
  • I have the same issue. CI tests fail since they automatically use g++-7.5.0 on an Ubuntu Bionic image. Previously it was 7.4.0.
    – mcserep
    Apr 19, 2020 at 14:07

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.