[Dune] Using GDB with DUNE?

Christoph Grüninger foss at grueninger.de
Tue Apr 10 22:44:02 CEST 2018


Hi Bryan,
I assume you got your otps file from someone related to DuMuX? The use
of additional variables like GXX_OPTS is controversial, because it
confuses people not familiar with the inner workings of dunecontrol.

Regarding your actual problem: GXX_OPTS is a helper variable. It
collects all flags meant to be passed to the C++ compiler. But in your
opts file, you never tell CMake to actually do so. You have to add to
your CMake flags
-DCMAKE_CXX_FLAGS=GXX_OPTS

You can check what flags are actually used when you call "make <target>
VERBOSE=ON" instead of "make <target>"

Bye
Christoph


Am 10.04.2018 um 17:25 schrieb Bryan Doyle:
> Hello,
> I am attempting to use the debugger GDB with my DUNE project, but it
> appears that my code compiles without the -g flag, even when explicitly
> set; when I give GDB my executable (gdb myProject.exe), I get the
> warning that no debugging symbols were found, and cannot proceed to set
> breakpoints or do anything within my code. Is there a specific option or
> flag I need to give DUNE in order to use GDB? Has anyone had any luck
> using a debugger other than GDB with DUNE?
> 
> I believe I have set up my .opts file and am compiling my project
> correctly, but just in case I have copied the code from these two files
> below (I have removed the GXX warning options in the .opts file and
> several declarations in my update script to try and be succinct):
> 
> my_release.opts:
> GXX_OPTS=" \
>     -fopenmp \
>     -fno-strict-aliasing \
>     -fstrict-overflow \
>     -ffast-math \
>     -fno-finite-math-only \
>     -O3 \
>     -g \
>     -march=native \
>     -DNDEBUG=1"
> SHELL="bash"
> LDFLAGS_OPTS=" -g \
> -Wl,-rpath \
> -Wl,/opt/apps/software/Core/GCC/4.9.3/lib64/
> "
> CMAKE_FLAGS="-DCMAKE_CXX_COMPILER=/opt/apps/software/Core/GCC/4.9.3/bin/c++
> \
>         -DCMAKE_C_COMPILER=/opt/apps/software/Core/GCC/4.9.3/bin/gcc \
>         -DDUNE_SYMLINK_TO_SOURCE_TREE=1 \
>         -DCMAKE_BUILD_TYPE=Release \
>         -std=c++14 \
>         -DGMP_ROOT=/home/btd2/external_v2.5.0/EXTERNAL_SOFTWARES \
>         -DMETIS_ROOT=/home/btd2/external_v2.5.0/EXTERNAL_SOFTWARES \
>         -DPARMETIS_ROOT=/home/btd2/external_v2.5.0/EXTERNAL_SOFTWARES \
>        
> -DSUPERLU_ROOT=/home/btd2/external_v2.5.0/EXTERNAL_SOFTWARES/SuperLU_4.3-gcc4.9.3
> \
>         -DSuiteSparse_ROOT=/home/btd2/external_v2.5.0/EXTERNAL_SOFTWARES \
>        
> -DLAPACK_LIBRARIES=/home/btd2/external_v2.5.0/EXTERNAL_SOFTWARES/lib/libopenblas.so
> \
>        
> -DBLAS_LIBRARIES=/home/btd2/external_v2.5.0/EXTERNAL_SOFTWARES/lib/libopenblas.so
> "
> 
> Code update script:
> ROOT=$(pwd)
> ./dune/dune-common-2.5.1/bin/dunecontrol --opts=my_release.opts
> --builddir=$(pwd)/release-build --module=dune-bryan-two-phase-flow-port
> all >> out_update_dune_bryan_two_phase_flow_port 2>&1
> 
> I would greatly appreciate any input anyone could give!
> 
> Thank you for your time,
> Bryan
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at lists.dune-project.org
> https://lists.dune-project.org/mailman/listinfo/dune
> 

-- 
Unfortunately, plots are notoriously hard to get right. Partly, the
default settings of programs like gnuplot or Excel are to blame for
this since these programs make it very convenient to create bad plots.
                        -- Till Tantau, "The TikZ and PGF Packages"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20180410/13bf9d31/attachment.sig>


More information about the Dune mailing list