Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.

C++ include files

vj2012
Beginner
2,053 Views

Hi,

I am trying to compile a C++ code which has the following include files: 

#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>

When I was trying to compile, it was apparently looking for these include files and following was the error I got:

icc: error #10417: Problem setting up the Intel(R) Compiler compilation environment.  Requires 'C++ include files' setting gathered from 'g++'

Following are the details of the compiler I was using:

OS info and version: Red Hat Enterprise Linux 7 64-bit
Compiler version: parallel_studio_xe_2020_update4_professional_edition

Where can I get these include files from, are these compiler specific?

Thank you.

0 Kudos
23 Replies
Gopika_Intel
Moderator
1,888 Views

Hi,

 

Thank you for posting in Intel C++ Compiler forum. Could you please share the outputs of the following?

1.   echo $PATH

2.   echo $LD_LIBRARY_PATH

3.   gcc --version

4.   icc --version

5.   Please ensure libraries are present in the standard path, /usr/include/c++/<version>/,  and please share with us the screenshot of the contents of the folder

 

Regards

Gopika

 

vj2012
Beginner
1,878 Views

Hi Gopika,

Thank you for your response and thank you very much for your help with my question.

Following are the outputs that you asked:

1. echo $PATH:

/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/kveera/.local/bin:/home/kveera/bin

2. echo $LD_LIBRARY_PATH:

(blank)

3. gcc --version:

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

4.  icc --version:

bash: icc: command not found...

5. Please ensure libraries are present in the standard path,

the "compilers_and_libraries_2020" folder which came during the original installation was not changed. The current path is as shown in the following (/home/kveera/Intel), this was the folder into which was selected during the original installation

/usr/include/c++/<version>/,  and please share with us the screenshot of the contents of the folder:

Following are the contents of the folder:

[root@localhost Intel]# pwd
/home/kveera/Intel
[root@localhost Intel]# ls -ltr
total 32
drwxr-xr-x. 26 root root 4096 Sep 27 16:08 vtune_profiler_2020.3.0.612611
drwxr-xr-x. 4 root root 34 Oct 1 06:51 compilers_and_libraries_2020.4.304
drwxr-xr-x. 4 root root 24 Oct 14 04:39 documentation_2020
lrwxrwxrwx. 1 root root 49 Feb 8 09:12 vtune_profiler -> /home/kveera/Intel/vtune_profiler_2020.3.0.612611
lrwxrwxrwx. 1 root root 49 Feb 8 09:12 vtune_profiler_2020 -> /home/kveera/Intel/vtune_profiler_2020.3.0.612611
lrwxrwxrwx. 1 root root 91 Feb 8 09:12 performance_snapshot -> /home/kveera/Intel/vtune_profiler_2020.3.0.612611/documentation/en/performance_snapshot.htm
drwxr-xr-x. 2 root root 4096 Feb 8 09:12 performance_snapshots_2020.3.0.0.612611
lrwxrwxrwx. 1 root root 58 Feb 8 09:12 performance_snapshots -> /home/kveera/Intel/performance_snapshots_2020.3.0.0.612611
drwxr-xr-x. 3 root root 15 Feb 8 09:13 samples_2020
drwxr-xr-x. 20 root root 4096 Feb 8 09:14 inspector_2020.3.0.604771
lrwxrwxrwx. 1 root root 44 Feb 8 09:14 inspector -> /home/kveera/Intel/inspector_2020.3.0.604771
lrwxrwxrwx. 1 root root 44 Feb 8 09:14 inspector_2020 -> /home/kveera/Intel/inspector_2020.3.0.604771
lrwxrwxrwx. 1 root root 42 Feb 8 09:14 advisor -> /home/kveera/Intel/advisor_2020.3.0.607294
lrwxrwxrwx. 1 root root 42 Feb 8 09:14 advisor_2020 -> /home/kveera/Intel/advisor_2020.3.0.607294
drwxr-xr-x. 22 root root 4096 Feb 8 09:14 advisor_2020.3.0.607294
drwxr-xr-x. 3 root root 20 Feb 8 09:15 ide_support_2020
drwxr-xr-x. 2 root root 23 Feb 8 09:15 impi
drwxr-xr-x. 9 root root 92 Feb 8 09:21 debugger_2020
lrwxrwxrwx. 1 root root 29 Feb 8 09:21 parallel_studio_xe_2020 -> parallel_studio_xe_2020.4.912
drwxr-xr-x. 7 root root 4096 Feb 8 09:23 conda_channel
drwxr-xr-x. 16 root root 4096 Feb 8 09:24 intelpython3
drwxr-xr-x. 3 root root 18 Feb 8 09:24 compilers_and_libraries_2020
lrwxrwxrwx. 1 root root 28 Feb 8 09:24 compilers_and_libraries -> compilers_and_libraries_2020
lrwxrwxrwx. 1 root root 33 Feb 8 09:24 lib -> compilers_and_libraries/linux/lib
lrwxrwxrwx. 1 root root 37 Feb 8 09:24 include -> compilers_and_libraries/linux/include
lrwxrwxrwx. 1 root root 33 Feb 8 09:24 man -> compilers_and_libraries/linux/man
lrwxrwxrwx. 1 root root 33 Feb 8 09:24 ipp -> compilers_and_libraries/linux/ipp
lrwxrwxrwx. 1 root root 35 Feb 8 09:24 mpirt -> compilers_and_libraries/linux/mpirt
lrwxrwxrwx. 1 root root 33 Feb 8 09:24 mkl -> compilers_and_libraries/linux/mkl
lrwxrwxrwx. 1 root root 34 Feb 8 09:24 daal -> compilers_and_libraries/linux/daal
lrwxrwxrwx. 1 root root 33 Feb 8 09:24 tbb -> compilers_and_libraries/linux/tbb
lrwxrwxrwx. 1 root root 34 Feb 8 09:24 pstl -> compilers_and_libraries/linux/pstl
drwxr-xr-x. 2 root root 4096 Feb 8 09:24 bin
drwxr-xr-x. 5 root root 4096 Feb 8 09:24 parallel_studio_xe_2020.4.912

 

Gopika_Intel
Moderator
1,862 Views

Hi,

Thank you for the information. It seems you haven’t sourced the compilervars.sh file. Please source the compilervars.sh file, it is present in the parallel studio folder path

<path to parallel studio folder>/intel-parallel-studio/compilers_and_libraries_<version>/linux/bin

To source the file, execute

source compilervars.sh

See if the error persists

Regards

Gopika

 

vj2012
Beginner
1,835 Views

Hi Gopika,

When I tried to source by using the following command:

source /home/user/Intel-sw-download-folder/bin/compilervars.sh

following was the result:

compilervars.sh [-arch] <arch> [-platform <platform>]

<arch> must be one of the following:
ia32 : Set up for IA-32 target.
intel64 : Set up for Intel(R)64 target.
<platform> must be of the following:
android : Set to Android* target.
linux : Set to Linux* target.(default)

If the arguments to the sourced script are ignored (consult docs
for your shell) the alternative way to specify target is environment
variables COMPILERVARS_ARCHITECTURE to pass <arch> to the script
and COMPILERVARS_PLATFORM to pass <platform>

 

So, I tried the following command:

source /home/user/Intel-sw-download-folder/bin/compilervars.sh intel64 linux

yet again, it gave me the same result as the following:

compilervars.sh [-arch] <arch> [-platform <platform>]

<arch> must be one of the following:
ia32 : Set up for IA-32 target.
intel64 : Set up for Intel(R)64 target.
<platform> must be of the following:
android : Set to Android* target.
linux : Set to Linux* target.(default)

If the arguments to the sourced script are ignored (consult docs
for your shell) the alternative way to specify target is environment
variables COMPILERVARS_ARCHITECTURE to pass <arch> to the script
and COMPILERVARS_PLATFORM to pass <platform>

I appreciate your help in this regard.

Thank you very much.

Gopika_Intel
Moderator
1,810 Views

Hi,

 

Thank you for the update. Please try these solutions. See whether you can include files after that.

 

1.   

source compilervars.sh intel64

 instead of source compilervars.sh intel64 linux and try icc --version. Ensure you're getting an output.

2.   Ensure you’ve installed all the components in parallel studio xe, including intel C++ Compiler and sourced psxevars.sh.

 

NOTE :  Intel Parallel Studio has been rebranded as oneAPI. To get the equivalent software development environment as Intel Parallel Studio download the oneAPI Base Toolkit and the oneAPI HPC Toolkit from here, https://software.intel.com/content/www/us/en/develop/tools/oneapi/all-toolkits.html.

 

Regards

Gopika

 

Gopika_Intel
Moderator
1,786 Views

Hi,

 

We haven’t heard from you in a while. Did the solution work for you? Are you able to include the files now? Let us know your updates.

 

Regards

Gopika


vj2012
Beginner
1,768 Views

Hi Gopika,

Thank you for checking back with me. As you had suggested I tried the following two commands and the following are the outputs that I got:

1. source compilervars.sh intel64 instead of source compilervars.sh intel64 linux:

command used: source /home/user/Intel-sw-download-folder/bin/compilervars.sh intel64

This appeared to have worked because upon executing the command I didn't get any message..

and try icc --version. Ensure you're getting an output.:

command used: /home/user/Intel-sw-download-folder/bin/icc *.cc:

Following was the message that I got:

icc: error #10417: Problem setting up the Intel(R) Compiler compilation environment.  Requires 'C++ include files' setting gathered from 'g++'

 

2. Ensure you’ve installed all the components in parallel studio xe, including intel C++ Compiler: 

I believe following are the components under my "parallel_studio_xe_2020.4.912" directory:

advisor_2020 , bin  compilers_and_libraries_2020,  documentation_2020,  ide_support_2020,  inspector_2020,  licensing,  man,  psxevars.csh,  psxevars.sh,  samples_2020,  uninstall,  uninstall_GUI.sh,  uninstall.sh,  vtune_profiler_2020.

and sourced psxevars.sh:

 command used: source /home/user/Intel-sw-download-folder/parallel_studio_xe_2020.4.912/psxevars.sh:

Following was the message that I got:

Intel(R) Parallel Studio XE 2020 Update 4 for Linux*
Copyright 2009-2020 Intel Corporation.

Then, I tried the previous command again (/home/user/Intel-sw-download-folder/bin/icc *.cc):

Yet again I got the following message:

icc: error #10417: Problem setting up the Intel(R) Compiler compilation environment.  Requires 'C++ include files' setting gathered from 'g++'.

Thank you.

 

Gopika_Intel
Moderator
1,722 Views

Hi,

 

Thank you for the update. Compiling does not require complete path. We suggest the following steps again and see if you can compile your program. Please share the output after each step

1.     Go to the folder where the C++ program to be executed is present.

2.     Execute

source  <path to parallel studio folder>/intel-parallel-studio/compilers_and_libraries_<version>/linux/bin/compilervars.sh intel64

3.     Execute (full path not required, /home/user/Intel-sw-download-folder/bin/icc *.cc — not required)

icc --version

4.     Execute either of the below. Full path is not required.( /home/user/Intel-sw-download-folder/bin/icc *.cc — not required)

icc filename.c                                 //for c program

icpc filename.cpp                        //for c++ program

where filename is the program to be executed.

Hope this helps

Regards

Gopika 

 

vj2012
Beginner
1,671 Views

Hi Gopika,

I still cannot compile my program with the steps mentioned here. I am sharing the output for each step:

1. Go to the folder where the C++ program to be executed is present.: Done

2. Execute:

source /home/User/Intel/compilers_and_libraries_2020/linux/bin/compilervars.sh intel64

Output: None (which is understood as the file is correctly sourced)

3. Execute (full path not required, /home/user/Intel-sw-download-folder/bin/icc *.cc — not required)

icc --version

Output:

icc (ICC) 19.1.3.304 20200925
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

4. Execute either of the below. Full path is not required.( /home/user/Intel-sw-download-folder/bin/icc *.cc — not required)

Executed: icpc filename.cpp

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

Thank you for your help in my trials to compile my program.

 

Gopika_Intel
Moderator
1,691 Views

Hi,

 

We haven’t heard from you in a while. Did the solution work for you? Are you able to include the files now? Can we discontinue monitoring this thread? Let us know your updates.

Regards

Gopika


Gopika_Intel
Moderator
1,626 Views

Hi,

 

Thank you for the update. Please try the below steps.

1.   Specify the gcc version while compiling like below.

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

See whether the error occurs.

2.   Try a simple hello world program like below and see if the error occurs.

#include<iostream>
using namespace std;
int main()
{
    cout<<"hello world";
    return 0;
}

Compile and execute it

icpc filename.cpp
./a.out

 Hope this helps you

Regards

Gopika

 

vj2012
Beginner
1,601 Views

Hi Gopika,

Thank you for your help.

Following are the problems that I still have when I do as suggested:

1. Specify the gcc version while compiling like below.

export GXX_INCLUDE=/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.1/include/c++

In the following path of my compiler where I have the "lib" folder:

/home/user/Intel-compiler-folder/lib/intel64

The "lib" folder had only the following:

intel64 -> intel64_lin/

intel64_lin

ia32_lin

I did not find "gcc". There were several lib*.* files.

I did not find "gcc" neither in the "/home/user/Intel-compiler-folder/bin" folder. I had only the "icc" and the "icpc"

2. I tried a small hello world program (hw.cpp) as suggested and tried to compile with the following commands and following were the results/responses:

source compilervars.sh intel64

Also tried: /home/user/Intel-compiler-folder/bin/iccvars.sh intel64

Response: None

/home/user/Intel-compiler-folder/bin/icpc hw.cpp

Response:

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

 

Thank you once again for your help in my trials to compile my code.

Gopika_Intel
Moderator
1,558 Views

Hi,

Thank you for the update. Please follow the below steps:

1.   To execute

export GXX_INCLUDE=/usr/lib/gcc/x86_64-pc-linux-gnu/<g++ version>/include/c++

First execute

which g++

for us it displayed /usr/bin/g++, it would be different for you.

Trace this path to reach the include folder. Replace this path in the export statement mentioned above. Then compile the program by specifying the g++ version.

$ icpc -gxx-name=g++-<g++ version> filename.cpp

2.   While compiling the hello world program, whole path is not required,

Instead of /home/user/Intel-compiler-folder/bin/icpc hw.cpp

Compile using

icpc hw.cpp

So, the order would be

>Go to the folder where hw.cpp is present.

>source <path to compilervars.sh>/compilervars.sh intel64

>icpc -gxx-name=g++-<g++ version> hw.cpp

Please share with us the outputs that you obtain after each step.

Regards

Gopika

 

vj2012
Beginner
1,381 Views

Hi Gopika,

Thank you once again for your detailed reply regarding helping me to compile my code.

When I try to execute: "which g++" it gives me the following output, can you please suggest me if you might know the remedy for this:

/usr/bin/which: no g++ in (/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/kveera/.local/bin:/home/kveera/bin).

 

Thank you.

Gopika_Intel
Moderator
1,409 Views

Hi

 

We haven’t heard from you in a while. Is your issue resolved? Can we discontinue monitoring this thread?

 

Regards

Gopika


Gopika_Intel
Moderator
1,367 Views

Hi,

Referring the above posts, it seems the gcc is not correctly installed. Please follow the below steps so that we can ensure gcc is correctly installed and intel c++ compiler version is compatible to the gcc version.

1.   Uninstall the intel toolkits (parallel studio xe)

2.   Reinstall the current gcc version correctly or upgrade to the latest version of gcc.

3.   Ensure it is correctly installed by executing

gcc --version

and

which gcc

4.   For more information on gcc - icc compatibility please refer

https://software.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-...

https://software.intel.com/content/www/us/en/develop/articles/intel-cpp-compiler-release-notes.html

5.   Re-install the intel toolkits (parallel studio xe)

NOTE : Intel Parallel Studio has been rebranded as oneAPI. To get the equivalent software development environment as Intel Parallel Studio download the oneAPI Base Toolkit and the oneAPI HPC Toolkit from here, https://software.intel.com/content/www/us/en/develop/tools/oneapi/all-toolkits.html

Regards

Gopika

 

Gopika_Intel
Moderator
1,354 Views

Hi

 

We haven’t heard from you in a while. Are you able to compile after reinstalling gcc and the intel toolkits? Can we discontinue monitoring this thread?

 

Regards

Gopika


vj2012
Beginner
1,335 Views

Hi Gopika,

Thank you again for your help in my trials to compile my code.

I was able to re-install the gcc and the intel toolkits (after using the command "yum groupinstall development" in my RedHat Linux).

gcc --version:

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

which gcc:

/usr/bin/gcc

However, I am still unable to compile my code. Following are the steps that I followed (along with the results in compiling the "hello-world program":hw.cpp

When in the folder where the C++ program to be executed is present:

1.  source /home/kveera/Intel/bin/compilervars.sh intel64

After tracing the path to the include folder:

2. export GXX_INCLUDE=/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include

3. Tried to compile using the following command:

icpc hw.cpp

Following was the result/output: 

hw.cpp(1): catastrophic error: cannot open source file "iostream"
#include <iostream>
^

compilation aborted for hw.cpp (code 4)

Finally, I checked at the following location:

/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include

there was indeed no "iostream.h" file.

 

Any help in this regard is greatly appreciated.

 

Gopika_Intel
Moderator
1,314 Views

Hi,

Thank you for the update. The error seems to be occurring because of the export command. Please compile the program without the export GXX_INCLUDE statement. So, the steps to be executed would be

source /home/kveera/Intel/bin/compilervars.sh intel64

icpc hw.cpp

Hope this helps

Regards

Gopika

 

Gopika_Intel
Moderator
1,146 Views

Hi

 

We haven’t heard from you in a while. Is your issue resolved? Can we discontinue monitoring this thread?

 

Regards

Gopika


Reply