"Illegal Instruction" on one computer but not the other

Open discussion regarding features, bugs, issues, vendors, etc.

"Illegal Instruction" on one computer but not the other

Postby maberib » Wed May 25, 2011 8:03 pm

Hi everyone,

I'm a physics student and I've written a program for my honours thesis using lapack. I've been using C++ since vectors are very for organizing the large amount of calculated output my program generates.

1) I want to be able to run my program on the school machine. The program will compile fine both my personal computer and the school computer, but it won't execute on the school's machine. Regardless of which machine the code is compiled on, when I run the executable on my machine I get the output as expected and on the school's machine I simply get the error "Illegal instruction".

-I #include "f2c.h" and "clapack.h".
-I compile using "g++ GateFinder.cpp -llapack -lblas"
-My calls to lapack functions look like this, for example: " zaxpy_(&SizeOfMatricesSquared, &cone,IdentityMatrixCosX, &ione, LHS, &ione);"
With variables: integer ione = 1; doublecomplex cone = {1,0}; integer SizeOfMatricesSquared = 64; doublecomplex LHS[SizeOfMatricesSquared]; doublecomplex IdentityMAtrixCosX[SizeOfMatricesSquared];

I make use of ZGEMM, ZAXPY, ZGESV, and ZGELSD throughout the program.

Any thoughts on this would be very appreciated. If you need more details on my code, I can start trying to extract the troublesome sections.

2) I'm wondering why I need to include "f2c.h" and "clapack.h". I don't see others doing this, yet my program won't compile without them. For example, under "Using LAPACK the Hard Way" on seehuhn.de/pages/linear he does not include these files, and doesn't require any additional libraries on his compile line.

3) For some reason I have to use the type "integer" instead of "int", or else the program won't compile. Any thoughts?


I've been trying to dig through google results for LAPACK, but I can't seem to figure these problems out. I very much appreciate any insight that anyone can offer on any of these problems.



-Ben
maberib
 
Posts: 3
Joined: Wed May 25, 2011 7:27 pm

Re: "Illegal Instruction" on one computer but not the other

Postby maberib » Fri May 27, 2011 6:25 pm

To add to this:

On the computers that give "Illegal instruction", GDB throws the error "Program received signal SIGILL, Illegal instruction.
0xb6baec82 in ATL_daxpy_xp1yp1aXbX () from /usr/lib/3dnow/atlas/libblas.so.3gf". It shows nothing on the computers that don't give the error.

Something else: if I run the program in valgrind with the flags "--leak-check=full --show-reachable=yes --tool=memcheck ", it will run absolutely fine on either machine and produce the summary:
"==24946==
==24946== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 24 from 1)
==24946== malloc/free: in use at exit: 256 bytes in 3 blocks.
==24946== malloc/free: 996 allocs, 993 frees, 9,100,029 bytes allocated.
==24946== For counts of detected errors, rerun with: -v
==24946== searching for pointers to 3 not-freed blocks.
==24946== checked 1,260,220 bytes.
==24946==
==24946== 64 bytes in 1 blocks are still reachable in loss record 1 of 3
==24946== at 0x402209E: operator new[](unsigned) (vg_replace_malloc.c:268)
==24946== by 0x804ABF9: main (in /var/autofs/home/home/bblumer/May2011/GateFinderPJL)
==24946==
==24946==
==24946== 64 bytes in 1 blocks are still reachable in loss record 2 of 3
==24946== at 0x402209E: operator new[](unsigned) (vg_replace_malloc.c:268)
==24946== by 0x804ABE4: main (in /var/autofs/home/home/bblumer/May2011/GateFinderPJL)
==24946==
==24946==
==24946== 128 bytes in 1 blocks are still reachable in loss record 3 of 3
==24946== at 0x402209E: operator new[](unsigned) (vg_replace_malloc.c:268)
==24946== by 0x804A7D4: main (in /var/autofs/home/home/bblumer/May2011/GateFinderPJL)
==24946==
==24946== LEAK SUMMARY:
==24946== definitely lost: 0 bytes in 0 blocks.
==24946== possibly lost: 0 bytes in 0 blocks.
==24946== still reachable: 256 bytes in 3 blocks.
==24946== suppressed: 0 bytes in 0 blocks.
"
maberib
 
Posts: 3
Joined: Wed May 25, 2011 7:27 pm

Re: "Illegal Instruction" on one computer but not the other

Postby cottrell » Mon Sep 05, 2011 1:35 pm

On the computers that give "Illegal instruction", GDB throws the error
"Program received signal SIGILL, Illegal instruction.
0xb6baec82 in ATL_daxpy_xp1yp1aXbX () from /usr/lib/3dnow/atlas/libblas.so.3gf".


It seems that the computer in question has an incompatible version of the
ATLAS blas installed. Perhaps the machine doesn't support the 3dnow
instruction set. "Illegal instruction" generally means that the software
is asking the machine to do something that the hardware cannot do.
cottrell
 
Posts: 68
Joined: Thu Jan 15, 2009 1:40 pm


Return to User Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron