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

Setting gcc version

marko_l_
Beginner
6,255 Views

I have several versions of gcc installed on my system, the latest, 8.1.0 is not compatible with Intel's compiler (18 update 3). So I've been trying to convince the compiler to compile using an older version of gcc. I've tried setting

-gxx-name=g++-7

to the command line options, but was greeted by an error:

icpc: error #10417: Problem setting up the Intel(R) Compiler compilation environment.  Requires 'C++ include files' setting gathered from '/usr/bin/g++-7'

I've been unable to find a reliable solution. What other options should I set?

0 Kudos
1 Solution
Bastian_B_
New Contributor I
6,255 Views

Hi Marko,

I don't know if this is the 'official' way to do it, but I've had success with:

$ export GXX_INCLUDE=/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.1/include/c++
$ icc -gcc-name=gcc-6 ...
$ icpc -gxx-name=g++-6 ...

Cheers
Bastian

View solution in original post

0 Kudos
10 Replies
Viet_H_Intel
Moderator
6,255 Views

Hi Mark,

Please set -gxx-name=/usr/bin/g++-7/bin/g++

Regards,

Viet

0 Kudos
marko_l_
Beginner
6,255 Views

Hi Viet!

That directory does not exist on my system, g++-7 is the binary available in /usr/bin/. What exactly is the compiler trying to find?

Best, Marko

0 Kudos
Viet_H_Intel
Moderator
6,255 Views

HI Marko,

It tries to find the name and location of g++. Please set it to an existing location.

Thanks,

Viet

0 Kudos
marko_l_
Beginner
6,255 Views

Hi Viet

It does find "g++-7", if I set it to something that does not exist I get a different error:

icpc: error #10417: Problem setting up the Intel(R) Compiler compilation environment.  Requires 'install path' setting gathered from 'g++test'

Also, setting it to the absolute path (although /usr/bin/ is in PATH so this should not matter) "/usr/bin/g++-7" gives the same error as using "g++-7". So apparently it can find the install path but then fails to find the relevant include files. 

Best, 
Marko

0 Kudos
Bastian_B_
New Contributor I
6,256 Views

Hi Marko,

I don't know if this is the 'official' way to do it, but I've had success with:

$ export GXX_INCLUDE=/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.1/include/c++
$ icc -gcc-name=gcc-6 ...
$ icpc -gxx-name=g++-6 ...

Cheers
Bastian

0 Kudos
Daniel_H
New Contributor I
6,255 Views

Bastian B. wrote:

Hi Marko,

I don't know if this is the 'official' way to do it, but I've had success with:

$ export GXX_INCLUDE=/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.1/include/c++
$ icc -gcc-name=gcc-6 ...
$ icpc -gxx-name=g++-6 ...

Cheers
Bastian

Thanks Bastian

Exactly what I was looking for. Until now I was relying on a systemd-nspawn based sub-system to compile. I did also expect that "-gxx-name" would be sufficient to give icpc a full access to the full environment.

Daniel

0 Kudos
marko_l_
Beginner
6,255 Views

That seems to do the trick, thank you Bastian!

My makefile is a little uglier than it used to be but at least now I can compile again. 

Best regards, 
Marko

0 Kudos
sahoo__sadashiv
Beginner
6,255 Views

Hi

I have installed intel parallel studio xe 2019 5 update

I want to use intel c++ compiler as a default c++ in my ubuntu 18.04 

so I have done this in my bashrc

export CC=icc
export LD_SHARED="icc -shared

but when when I am doing ./configure  its show the g++ gnu 7.4.0 rather than icpc or icc the 

please tell me how to make my default c++ and python compiler as intel compiler

pythia8:http://home.thep.lu.se/Pythia/

http://home.thep.lu.se/~torbjorn/pythia8/pythia8243.tgz

best,

sadashiv

 

0 Kudos
Viet_H_Intel
Moderator
6,255 Views

did your source /installed_dir/bin/iccvars.sh intel64

0 Kudos
sahoo__sadashiv
Beginner
6,255 Views

yes I did

0 Kudos
Reply