mpicbg-scicomp / gearshifft

Benchmark Suite for Heterogenuous FFT Implementations
Apache License 2.0
34 stars 9 forks source link

How to enable the debug mode of the gearshifft? #154

Closed zhaohaifei closed 1 year ago

zhaohaifei commented 1 year ago

The core file is generated when I run cufft, but I can't debug this core file. I use “cuda-gdb gearshift_cufft core.***”, but there is no related content. I tried adding -DCMAKE_BUILD_TYPE=DEBUG when compiling gearshifft, the result is still the same. I SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall") in CMakeLists.txt, it does not work either.

zyzzyxdonta commented 1 year ago

Hi!

-DCMAKE_BUILD_TYPE=Debug is the correct way to do a debug build. What are the exact steps you took?

I did the following:

# compile debug version
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j

# run
cd gearshifft
cuda-gdb gearshifft_cufft

Inside of gdb:

break main
run
generate-core-file
quit

Then started gdb again:

cuda-gdb gearshifft_cufft core.*

This tells me:

Core was generated by `/.../gearshifft_cufft'.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.

Does that work for you?

zhaohaifei commented 1 year ago

Hi!

-DCMAKE_BUILD_TYPE=Debug is the correct way to do a debug build. What are the exact steps you took?

I did the following:

# compile debug version
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j

# run
cd gearshifft
cuda-gdb gearshifft_cufft

Inside of gdb:

break main
run
generate-core-file
quit

Then started gdb again:

cuda-gdb gearshifft_cufft core.*

This tells me:

Core was generated by `/.../gearshifft_cufft'.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.

Does that work for you?

It works. Thank you very much.