Reputation: 13
I am trying to compile simple code using openmp.
Here is the code (file test.cpp):
int main()
{
double a[100];
#pragma omp parallel for
for (int i = 0; i < 100; ++i) {
a[i] = i;
}
return 0;
}
I compile using the following command:
icpc -openmp test.cpp
the result is:
icpc: command line error: option '-openmp' not supported
OS Debian X64
Can you help me please?
Update:
using -fopenmp gives the same error.
From here: https://software.intel.com/en-us/node/522690
Command-Line Examples, Linux* To compile and link (build) the entire application with one command using the Intel OpenMP libraries, specify the following Intel® C++ Compiler command on Linux* platforms:
C source
icc -openmp hello.c
C++ source
icpc -openmp hello.cpp
UPDATE2:
-qopenmp gives the same error. I installed intel system studio, and use the compiler from /opt/intel/bin. In PATH there is nothing related to intel. Maybe i should add somethin to PATH for intel to recognize that it can use openmp. I have tried only adding to PATH /opt/intel/bin.
Upvotes: 0
Views: 5473
Reputation: 74435
-openmp
used to be the option for enabling the OpenMP support in older versions of the Intel compiler. In the newer versions the option is -qopenmp
.
In any case, even the newest version (17.0) accepts -openmp
:
$ icpc -openmp test.cpp
icpc: command line remark #10411: option '-openmp' is deprecated and will be removed in a future release. Please use the replacement option '-qopenmp'
Therefore, there is probably something wrong with the setup of your Intel compilers. As a hint, Intel compilers tend to issue error numbers for unrecognised options. Make sure that icpc
is indeed the Intel compiler and not a wrapper around GCC or an alias.
Upvotes: 2
Reputation: 26326
How about
-qopenmp
I think that's the official way you add OpenMP to intel compiler.
If you're on Windows, then use:
/Qopenmp
Upvotes: 0