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

How does Intel compiler locate openmp headers?

Nav
New Contributor I
821 Views

I do not know how gcc finds the openmp headers either, but I guess the path would be set because openmp comes bundled with gcc.

But since the openmp header files don't come bundled with the Intel C++ compiler, how does the compiler find the files? I'm working on Fedora.

If GCC was not installed on my system, how would I be able to run openmp on the Intel C++ compiler? Would I have to download all the openmp headers, place it in a folder and specify an environment variable that will lead the compiler to that folder?

How would I go about doing it?

0 Kudos
1 Solution
JenniferJ
Moderator
821 Views
Quoting Nav
But since the openmp header files don't come bundled with the Intel C++ compiler, how does the compiler find the files? I'm working on Fedora.
Correction. The openmp header "omp.h" is included in the Intel C++ compiler. Please check the "/opt/intel/.../include" directory.
If you installed gcc as suggested by others, you should see "omp.h" is also provided by gcc. But you should use the "omp.h" from Intel C++ compiler if you'll build your app with it.
So to get it working, you'll need to do:
1. install the gcc and libs
2. install the Intel C++ compiler 11.1 for Linux
3. open a shell command window, source the "iccvarsXX.sh" to set up the correct environment
4. use "icpc" to build .cpp files or "icc" for .c files
Thanks,
Jennifer

View solution in original post

0 Kudos
4 Replies
aazue
New Contributor I
821 Views

Hi

About your remarks

(If GCC was not installed on my system .....)

If Gnu compiler is not installed you can not install or running Icc.

Kind regards

0 Kudos
TimP
Honored Contributor III
821 Views
As Bustaf said, icc requires an active installation of g++, from which it takes most of the headers and libraries. It doesn't require openmp support in the g++, as it can use older versions of g++, so all OpenMP required headers are taken from icc's own include directory.
0 Kudos
JenniferJ
Moderator
822 Views
Quoting Nav
But since the openmp header files don't come bundled with the Intel C++ compiler, how does the compiler find the files? I'm working on Fedora.
Correction. The openmp header "omp.h" is included in the Intel C++ compiler. Please check the "/opt/intel/.../include" directory.
If you installed gcc as suggested by others, you should see "omp.h" is also provided by gcc. But you should use the "omp.h" from Intel C++ compiler if you'll build your app with it.
So to get it working, you'll need to do:
1. install the gcc and libs
2. install the Intel C++ compiler 11.1 for Linux
3. open a shell command window, source the "iccvarsXX.sh" to set up the correct environment
4. use "icpc" to build .cpp files or "icc" for .c files
Thanks,
Jennifer
0 Kudos
Nav
New Contributor I
821 Views
Thanks Jennifer. I had a look at the omp.h of the Intel compiler. Interesting to know...
0 Kudos
Reply