- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did anyone encounter this problem. The following code causes Segmentation fault (or Bus error in some other similar codes). I've submitted an issue about this.
--------------------------------------
struct cpl
{
double r;
double i;
};
extern "C"
{
cpl zdotc_ (int *N, cpl *X, int *IncX, cpl *Y, int *IncY);
}
int main ()
{
cpl c; c.r = c.i = 1;
cpl a[1] = {c}, b[1] = {c};
int i = 1; int n = 3;
cpl res = zdotc_(&n,a,&i,b,&i);
return 0;
}
--------------------------------------
struct cpl
{
double r;
double i;
};
extern "C"
{
cpl zdotc_ (int *N, cpl *X, int *IncX, cpl *Y, int *IncY);
}
int main ()
{
cpl c; c.r = c.i = 1;
cpl a[1] = {c}, b[1] = {c};
int i = 1; int n = 3;
cpl res = zdotc_(&n,a,&i,b,&i);
return 0;
}
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On linux, I don't get that failure. It does look as if you are forcing zdotc_() to read beyond the end of your declared a[] and b[].
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks fo replying. That's a typo in my posted code, when I was simplifying it.
But the runtime error still exists even that's corrected, something like "Illegal instruction".
But the runtime error still exists even that's corrected, something like "Illegal instruction".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I solved the problem. It was caused by incorrect using of Fortran functions returing a complex value, I found the following link: http://www.intel.com/support/performancetools/libraries/mkl/sb/cs-017175.htm#3

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