Building Hugin with debugging symbols

29 views
Skip to first unread message

Greg 'groggy' Lehey

unread,
Jul 9, 2012, 4:00:30 AM7/9/12
to Hugin developers list
As you may have noticed, I'm currently having difficulty with the 64
bit version of Hugin under FreeBSD. I'd like to look around inside
with gdb, but I don't do cmake, and I can't work out how to compile
with debugging symbols. Can anybody help? It would also be
interesting to be able to specify which compiler to use.

Greg
--
Sent from my desktop computer.
Finger gr...@FreeBSD.org for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft MUA reports
problems, please read http://tinyurl.com/broken-mua

Terry Duell

unread,
Jul 9, 2012, 7:29:23 PM7/9/12
to hugi...@googlegroups.com
Hullo Greg,

On Mon, 09 Jul 2012 18:00:30 +1000, Greg 'groggy' Lehey
<groo...@gmail.com> wrote:

> As you may have noticed, I'm currently having difficulty with the 64
> bit version of Hugin under FreeBSD. I'd like to look around inside
> with gdb, but I don't do cmake, and I can't work out how to compile
> with debugging symbols. Can anybody help?

A quick snoop about makes me think that if you use cmake like this it will
include the debug...

" cmake -DDebug=1"

without the "" of course and prepending with ./ if necessary.
I might have this wrong, as I'm no expert on cmake (or anything else for
that matter), but this looks to be the way cmake is invoked from within
the Fedora rpmbuild spec file.

> It would also be
> interesting to be able to specify which compiler to use.

Don't know about that one.

Cheers,
--
Regards,
Terry Duell

Terry Duell

unread,
Jul 9, 2012, 8:18:42 PM7/9/12
to hugi...@googlegroups.com
On Tue, 10 Jul 2012 09:29:23 +1000, Terry Duell <tdu...@iinet.net.au>
wrote:

[snip]

> " cmake -DDebug=1"
>
> without the "" of course and prepending with ./ if necessary.

Whoops...that's not right. If building in the topmost dir of a hugin
repository, and running cmake at that level;

" cmake . -DDebug=1"

Lukáš Jirkovský

unread,
Jul 10, 2012, 1:53:26 AM7/10/12
to hugi...@googlegroups.com
It should be "cmake -DCMAKE_BUILD_TYPE=Debug"

Lukas

Terry Duell

unread,
Jul 10, 2012, 2:04:07 AM7/10/12
to hugi...@googlegroups.com
On Tue, 10 Jul 2012 15:53:26 +1000, Lukáš Jirkovský
<l.jir...@gmail.com> wrote:


>> It should be "cmake -DCMAKE_BUILD_TYPE=Debug"

Yes, you are right.
Sorry, I should have checked the CMakeLists.txt for the specific
definition and not assumed it would be as per the one example in my
rpmbuild spec file.

Greg 'groggy' Lehey

unread,
Jul 10, 2012, 2:27:40 AM7/10/12
to hugi...@googlegroups.com
On Tuesday, 10 July 2012 at 7:53:26 +0200, Luk?? Jirkovsk wrote:
> On 10 July 2012 02:18, Terry Duell <tdu...@iinet.net.au> wrote:
>>
>> Whoops...that's not right. If building in the topmost dir of a hugin
>> repository, and running cmake at that level;
>>
>> " cmake . -DDebug=1"
>
> It should be "cmake -DCMAKE_BUILD_TYPE=Debug"

Thanks, but that's not what I'm looking for. That enables debugging
code in the source. I'm looking for something that tells the
Makefiles to build the object files with debugging symbols (the -g
option to gcc) so that I can investigate what's going on with gdb.

Lukáš Jirkovský

unread,
Jul 10, 2012, 2:47:02 AM7/10/12
to hugi...@googlegroups.com
On 10 July 2012 08:27, Greg 'groggy' Lehey <groo...@gmail.com> wrote:
> On Tuesday, 10 July 2012 at 7:53:26 +0200, Luk?? Jirkovsk wrote:
>> On 10 July 2012 02:18, Terry Duell <tdu...@iinet.net.au> wrote:
>>>
>>> Whoops...that's not right. If building in the topmost dir of a hugin
>>> repository, and running cmake at that level;
>>>
>>> " cmake . -DDebug=1"
>>
>> It should be "cmake -DCMAKE_BUILD_TYPE=Debug"
>
> Thanks, but that's not what I'm looking for. That enables debugging
> code in the source. I'm looking for something that tells the
> Makefiles to build the object files with debugging symbols (the -g
> option to gcc) so that I can investigate what's going on with gdb.
>
> Greg

This option passes the -g compiler option automatically, so you will
get debugging symbols. This is the standard way to create a debug
build using CMake. If you really do not want other debug information,
just set up CFLAGS & CXXFLAGS appropriately before running cmake. Oh,
and for both options to work you need to do a clean build (especially
there must not be a CMakeCache file before you run cmake).

Lukas
Reply all
Reply to author
Forward
0 new messages