- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code 'test.cpp' can not be built in eclipse when I add '-O3 -parallel' into build options.
[bash]$ icpc -O3 -parallel -c test.cpp $ icpc -parallel test.o test.o: In function `main': test.cpp:(.text+0x27b): undefined reference to `matmul_mkl_' [/bash]
But it works with the following cmdline:
[bash]$ icpc -O3 -parallel test.cpp [/bash]
And this works too.
[bash]$ icpc -O3 -parallel -c test.cpp $ icpc -O3 -parallel test.o [/bash] I think it's a bug of icc eclipse plugin. Why should it indicate '-O3' when linking, while eclipse plugin doesn't ?
[bash]$ icpc -v icpc version 12.1.3 (gcc version 4.1.2 compatibility) [/bash]
[cpp]#include
using namespace std;
int main(){
const int n = 500;
double(*a) = (double(*))new double[n*n];
double(*b) = (double(*))new double[n*n];
double(*c) = (double(*))new double[n*n];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++){
a = (double) rand() / RAND_MAX;
b = (double) rand() / RAND_MAX;
}
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++){
c = 0;
for (int k = 0; k < n; k++)
c += a * b;
}
double d1 = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
d1 += c*c;
cout << d1 << endl;
return 0;
}
[/cpp]
[bash]$ icpc -O3 -parallel -c test.cpp $ icpc -parallel test.o test.o: In function `main': test.cpp:(.text+0x27b): undefined reference to `matmul_mkl_' [/bash]
But it works with the following cmdline:
[bash]$ icpc -O3 -parallel test.cpp [/bash]
And this works too.
[bash]$ icpc -O3 -parallel -c test.cpp $ icpc -O3 -parallel test.o [/bash] I think it's a bug of icc eclipse plugin. Why should it indicate '-O3' when linking, while eclipse plugin doesn't ?
[bash]$ icpc -v icpc version 12.1.3 (gcc version 4.1.2 compatibility) [/bash]
[cpp]#include
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi. Thank you very much for a report. We will fix it.
For now, would you please work around by adding "-O3" to linker->miscellaneous->Additional Options?
Miwako
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
The fix will be in the next 12.1 update (Update 11 that will come out next month). Thanks.
Miwako
The fix will be in the next 12.1 update (Update 11 that will come out next month). Thanks.
Miwako
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-O3 -parallel adds (by default) -opt-matmul, requiring linkage against MKL (-mkl for the defaults). This ought to be advantageous, if your matrix is at least 20x20 (otherwise, why are you trying to parallelize?). Maybe the bug fix will be to add -mkl implicitly.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page