4.6.2. Debugging Build Using GDB - 5.2 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2025-12-29
Version
5.2 English

The AOCL-BLAS library can be debugged on Linux using GDB. To enable the debugging support, build the library with the –enable-debug flag. Use following commands to configure and build the debug version of AOCL-BLAS:

$ cd blis_src
$ ./configure --enable-cblas --enable-debug auto
$ make -j

Use the following commands to link the application with the binary and build application with debug support:

$ cd blis_src
$ gcc -g -O0 -I<path-to-AOCL-BLAS-header> test_gemm.c \
  <path-to-AOCL-BLAS-library>/libblis.a -lpthread -lm \
  -o test_gemm_blis.x

You can debug the application using gdb. A sample output of the gdb session is as follows:

$ gdb ./test_gemm_blis.x
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-12.el8

Reading symbols from ./test_gemm_blis.x...done.
(gdb) break bli_gemm_small
Breakpoint 1 at 0x677543: file kernels/zen/3/bli_gemm_small.c, line 110.
(gdb) run
Starting program: /home/dipal/work/blis_dtl/test/test_gemm_blis.x
Using host libthread_db library "/lib64/libthread_db.so.1".
BLIS Library version is : AOCL BLIS 3.1

Breakpoint 1, bli_gemm_small (alpha=0x7fffffffcf40, a=0x2471b30,
b=0x7fffffffd1c0, beta=0x2465400 <BLIS_ZERO>,
c=0x4fe66e <bli_obj_equals+300>, cntx=0x7fffffffb320, cntl=0x0) at
kernels/zen/3/ bli_gemm_small.c:110

110 {

(gdb) bt
#0 bli_gemm_small (alpha=0x7fffffffcf40, a=0x2471b30,
b=0x7fffffffd1c0, beta=0x2465400
<BLIS_ZERO>,
c=0x4fe66e <bli_obj_equals+300>, cntx=0x7fffffffb320, cntl=0x0) at
kernels/zen/3/ bli_gemm_small.c:110

#1 0x00000000007caab6 in bli_gemm_front (alpha=0x7fffffffd1c0,
a=0x7fffffffd120, b=0x7fffffffd080,
beta=0x7fffffffcfe0, c=0x7fffffffcf40, cntx=0x2471b30,
rntm=0x7fffffffce50, cntl=0x0) at frame/3/gemm/bli_gemm_front.c:83

#2 0x00000000005baf42 in bli_gemmnat (alpha=0x7fffffffd1c0,
a=0x7fffffffd120, b=0x7fffffffd080,
beta=0x7fffffffcfe0, c=0x7fffffffcf40, cntx=0x2471b30,
rntm=0x7fffffffce50) at frame/ind/oapi/bli_l3_nat_oapi.c:83

#3 0x00000000005474a2 in dgemm\_ (transa=0x7fffffffd363 "N\320\a",
transb=0x7fffffffd362 "NN\320\a",
m=0x7fffffffd36c, n=0x7fffffffd364, k=0x7fffffffd368,
alpha=0x24733c0, a=0x7ffff53e2040, lda=0x7fffffffd378,

b=0x7ffff355d040, ldb=0x7fffffffd374, beta=0x2473340,
c=0x7ffff16d8040, ldc=0x7fffffffd370) at frame/compat/bla_gemm.c:559
#4 0x0000000000413a1c in main (argc=1, argv=0x7fffffffd988) at
test_gemm.c:321 (gdb)