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

cc1plus: error: unrecognized command line option "-ipo"

Ctech_Ctech
Beginner
1,626 Views
Hi All,

I installed 64-bit version of Intel C++ Compiler Professional Edition 11.1 for Linux on 64-bit Ubuntu 9.10.

I want to start with very basic things which could improve the performance of my application on a x86_64 multicore system.

The only thing I know about Intel C++ Compiler is that it is GNU gcc compliant.

Based on that I tried to use following compiler options to compile my source code with gcc:

gcc -g -fPIC -O2 -ipo

And I got the following error:

cc1plus: error: unrecognized command line option "-ipo"

I am not sure if I am doing things right to start using Intel C++ compiler...

After installation, what should I do next to get it working ?

Thanks.
0 Kudos
5 Replies
Hubert_H_Intel
Employee
1,626 Views
After installation of the Intel C++ Compiler you need to source the compiler script in order to use all tools, for example (when you did a root install):
$ source /opt/intel/Compiler/11.1/072/bin/iccvars.sh ia32|intel64
or (user install)
$ source $HOME/intel/Compiler/11.1/072/bin/iccvars.sh ia32|intel64
If you have a 32-bit system, use the ia32 parameter, for 64-bit systems use intel64.

gcc is the GNU compiler dirver and doesn't work with Intel specific options like -ipo.
The Intel compiler is being invoked with driver 'icc', for example
$ icc -g -ipo hello.c

Does this help?
Hubert Haberstock
0 Kudos
Ctech_Ctech
Beginner
1,626 Views
I sourced the compiler script.

And I modified one of my Makefiles by replacing g++ with icc.

Here is the new command to compile my source files:

icc -g -fPIC -O2 -ipo -c mysource.cc -o mysource.o

However, make gives the following error:

make: icc: Command not found

I checked my PATH variable, and it seems to be correct:

/opt/intel/Compiler/11.1/072/bin/intel64:/opt/intel/Compiler/11.1/072/bin/intel64:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

What else should I do ?

Thanks.
0 Kudos
Hubert_H_Intel
Employee
1,626 Views
Did you start make from within the same shell where you sourced the compiler?
0 Kudos
Ctech_Ctech
Beginner
1,626 Views
No.

I would like to start make from within any shell other than the one where I sourced the compiler.

How can I do that ?
0 Kudos
Yang_W_Intel
Employee
1,626 Views
In your build script, before you call make, you may call source xxx to set the icc build environment, and then call 'which icc' to see if the icc path is set correctly.
In addition, if you use sudo to call make like 'sudo make', you may call sudo -s first to go to root build environment, and then source the icc environment, then call make.
Thanks.
-Yang
0 Kudos
Reply