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 useful for organizing the large amount of calculated output my program generates.
I want to be able to run my program on the school machine. The program will compile fine on both my personal computer and the school computers, but it won't execute on some of the school's machines. Regardless of which machine the code is compiled on, when I run the executable on my machine and certain school machines, I get the output as expected. On other school machines 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.
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". GDB 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 gives the output as expected and there are no crashes on any of the computers. valgrind gives the summary:
"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
==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.
|
"
Any thoughts on this would be very much appreciated. If you need more details on my code, I can start trying to extract the troublesome sections.
-Ben