4

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) 
gmarco
  • 535
  • 3
  • 8
  • 16

3 Answers3

4

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.

Michael Conlen
  • 1,959
  • 2
  • 17
  • 19
1

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.

vlad_tepesch
  • 6,681
  • 1
  • 38
  • 80
  • I'm using latest lapack/blas available for Centos 5. I installed them via RPM. – gmarco Mar 17 '14 at 12:58
  • @Guillermo since you're using CentOS, which is an unsupported clone of Red Hat Enterprise Linux, why don't you get a subscription to the real thing and file a bug with Red Hat ? You're likely to get a quicker response that way. – mtall Mar 18 '14 at 13:46
  • @Guillermo does installing also mean compile it? if not may be the binaries in the repository use that CPU features your CPU probably does not have. or they deliver multiple binaries for different cpus and you linked the wrong. may be you have to recompile it and look how to configure it using only CPU-Features that your CPU support. something like CPU-Z (do not know if there is something for linux) would help you identify your CPU and its features. – vlad_tepesch Mar 18 '14 at 13:53
  • Yes, installing also means compiling it. I've tried with both: precompiled and source.. – gmarco Mar 20 '14 at 08:04
  • @Guillermo did you also checked if configuration matches your CPU capabilities? – vlad_tepesch Mar 20 '14 at 08:08
-3

"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.

abelenky
  • 63,815
  • 23
  • 109
  • 159