gmarco
gmarco

Reputation: 555

Illegal instruction debug

I've compiled a whole suite of bioinformatics analysis. (https://github.com/iontorrent/TS) It has a lot of dependencies (armadillo, blas, lapack, atlas etc..).

On compilation I had no errors. The problem is that some of the executable file created are not working and throw an Illegal Instruccion without any other information. I'm using GCC 4.8.2 on a CentOS 5.6.

I would like to know how can I debug those executable files, so I can check which one of the libraries or code is wrong in my system.

./tvc
tvc 4.0-7 () - Torrent Variant Caller

Illegal instruction

I think the issue is with LAPACK/BLAS/CBLAS. I'm very confused on how to build LAPACK/BLAS and CBLAS from source. (rpm version of LAPACK/BLAS is outdated in Centos 5, this software suite needs LAPACK 3.2.1). I know how to compile LAPACK and BLAS, I've no idea on how to install CBLAS.

Thank you.

Edited:

The guys providing this analysis suite they also provide a VM with a pre-installed Ubuntu and all the software.

I took a look of their gcc version and configuration:

gcc -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5.1'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)

My GCC configuration:

Configured with: ../configure --prefix=/share/apps/local/gcc/4.8.2 --with-mpfr=/share/apps/local/gcc/4.8.2 --with-gmp=/share/apps/local/gcc/4.8.2 --with-as=/share/apps/local/binutils/2.24/bin/as --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.8.2 (GCC) 

Upvotes: 4

Views: 11180

Answers (3)

Michael Conlen
Michael Conlen

Reputation: 2088

There's a couple of possibilities; but to work it out run the program in the debugger as stated

$ gdb ./tvc

from the debugger run the program. Note: (gdb) is the prompt

(gdb) run

This should throw the illegal instruction; from here run

(gdb) bt full

This will tell you where the illegal instruction happened.

Upvotes: 4

vlad_tepesch
vlad_tepesch

Reputation: 6925

may be you compiled it with compiler settings for code generation that is not compatible with your CPU. or you link against some library that is optimized for other cpus. Especially the numeric libs often have special builds to use all capabilities of a CPU. For example if you use a lib that was build to use SSE4 instructions but your CPU is a bit older it may throw this error.

So read carefully which lib of lapack or blas you can use for your CPU. May be you have to recompile it for your cpu.

Upvotes: 1

abelenky
abelenky

Reputation: 64730

"I would like to know how can I debug those executable files,"

Start with running it in a debugger. (that's why it is called a debugger; it helps you debug executables).

When the program fails with "Illegal Instruction", the debugger will be able to show you where it failed, and provide more information about why.

Upvotes: -3

Related Questions