Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Getting "This program was not built to run on the processor in your system" error with -fast flag after Ubuntu update

Len_Testa
Beginner
970 Views
I'm using version 12.0.4 of the C++ compiler on ubuntu 2.6.35-30-generic. The CPU is an Intel Core i7-2630QM CPU @ 2.00GHz


Today I did a small OS update then recompiled some C++ code. On that C++ code the only compiler optimization flag I have is "-fast."

After compiling the code, my attempt to run it generates the following error message:

Fatal Error: This program was not built to run on the processor in your system.
The allowed processors are: Intel processors with SSE4.2 and POPCNT instructions support.

If I change the "-fast" flag to, say, -xN, the code works.

I am compiling and running the code on the same machine, and I had made no changes to the build process, my own libraries or the compiler settings. Any idea what might be causing this, and how I get the "-fast" optimization to work again?

Thanks!

Len
0 Kudos
6 Replies
mecej4
Honored Contributor III
970 Views
Since -xN is deprecated and specifies optimization for an older processor, try the -xAVX and (separately) -xHost options.
0 Kudos
Hubert_H_Intel
Employee
970 Views

Sounds strange. -fast is nothing else than a collection of the following options: -ipo O3 -no-prec-div -static -xHost. -xHost should identify the processor and set the right SSE switch (-xAVX for i7 2xxx).

-fast is a prototype switch that shall show best possible performance just "out of the box". On real projects you shall consider using proper switches that achieve best performance.

What happens if you use the full "fast" options list: -ipo O3 -no-prec-div -static -xHost? You may consider to use only a suitable subset of these options such as -O3 -xHost.

Hubert.

0 Kudos
Len_Testa
Beginner
970 Views
Trying both of these shortly. Thank you for the ideas.
0 Kudos
Len_Testa
Beginner
970 Views
Both worked - thank you very much.

I suspect that the issue may have been an aborted build with differnet compiler options, which may not have cleaned up its environment. I can now rebuild with the standard -fast option now, too.

Thanks again.

Len
0 Kudos
mecej4
Honored Contributor III
970 Views
It has become a habit for me that when I change optimization options I recompile all input sources, for this very reason. I have rarely come across situations where compilation times are so large that I would think of not recompiling in order to save time.
0 Kudos
SergeyKostrov
Valued Contributor II
970 Views
My approach in case of optimizationsisvery simple:

Debug Configuration: Disable
Release Configuration: Disable

Somesoftware products require as higher as possible portability andit is impossibleto rely on optimizations by a C/C++ compiler during R&D phase.
0 Kudos
Reply