[ADOL-C] Problem adolc-2.4.1 with --enable-debug

Kshitij Kulshreshtha kshitij at math.upb.de
Wed Feb 26 17:22:13 EST 2014

Oh! That bit comes as a part of autoconf test _AC_PROG_CC_G and
_AC_PROG_CXX_G which are called automatically by AC_PROG_CC and

See: /usr/share/autoconf/autoconf/c.m4 lines 525--538 and 757--772
(autoconf version 2.69)

It seems to check if CFLAGS and CXXFLAGS are set and defaults to -g -O2.

Maybe a better idea for debugging symbols would be to set CFLAGS and
CXXFLAGS to a space character. So they are set to something harmless and
then pass --with-cflags and --with-cxxflags. Those options in ADOL-C
configure default to -O2 too unless specified.

    export CFLAGS=' ' CXXFLAGS=' '
    ./configure --with-cflags='-g -O0' --with-cxxflags='-g -O0'

Just tested this and it seems to do the trick.

As on 2014-02-26 22:54, Brad Bell did write:
> When I execute the bash script below, I get:
>     configure:17226: checking which CFLAGS to use
>     ac_cv_env_CFLAGS_set=
>     ac_cv_env_CFLAGS_value=
>     CFLAGS='-g -O2'
>     configure:17258: checking which CXXFLAGS to use
>     ac_cv_env_CXXFLAGS_set=
>     ac_cv_env_CXXFLAGS_value=
>     CXXFLAGS='-g -O2'
> note the -g -O2 (not -O0) !!
> #! /bin/bash -e
> version='ADOL-C-2.5.0'
> if [ -e $version ]
> then
>         rm -r $version
> fi
> tar -xzf $version.tgz
> cd $version
> mkdir build
> cd build
> ../configure --with-cflags='-g -O0' --with-cxxflags='-g -O0'
> grep CFLAGS config.log
> grep CXXFLAGS config.log
> On 2/26/2014 1:18 PM, Kshitij Kulshreshtha wrote:
>> Well the CFLAGS and CXXFLAGS exported by the shell take precedence over
>> everything. What you pass explicitely --with-cflags= --with-cxxflags=
>> gets added to that.
>> Passing --enable-debug or --enable-harddebug to configure changes the
>> implementation of some functions in ADOL-C and adds extra output on
>> stderr. So that is not the same as just having debugging symbols,
>> although they also add -g -O0 to the command line unless overridden by
>> shell exported CFLAGS CXXFLAGS.
>> So if you just need the debugging symbols in the library it is best to
>> simply unset CFLAGS and CXXFLAGS in shell and pass --with-cflags and
>> --with-cxxflags to configure. So this should work:
>>       unset CFLAGS CXXFLAGS
>>       ./configure --with-cflags='-g -O0' --with-cxxflags='-g -O0'
>> As on 2014-02-26 19:35, Brad Bell did write:
>>> No, the problem was fixed in ADOL-C-2.5.0, but further investigation
>>> revealed a related problem.
>>> It appear that if one wishes to compile a debugging version of adolc,
>>> one should do the following
>>>      export CFLAGS='-g -O0'
>>>      export CXXFLAGS='-g -O0'
>>>      configure --with-cflags='-g -O0' --with-cxxflags='-g -O0'
>>> If I do not set CFLAGS and CXXFLAGS as above, and I check config.log, I
>>> see that the settings for these flags are confused.
>>> There is some discussion of this under the heading Variable:**CFLAGS on
>>> http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Preset-Output-Variables.html
>>> but it is not entirely clear to me.
>>> On 2/26/2014 5:44 AM, Kshitij Kulshreshtha wrote:
>>>> Does the error persist in ADOL-C-2.5.0?

Dr. Kshitij Kulshreshtha

Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.

Büro: A3.235

Arnikaweg 62
33100 Paderborn.

More information about the ADOL-C mailing list