[ADOL-C] gcc or g++

Kshitij Kulshreshtha kshitij at math.upb.de
Thu Dec 12 09:07:02 EST 2013


Hello,

adouble is declared as a C++ class. So one must use a C++ compiler to
compile anything that uses adouble. That being said, only the part where
one creates an ADOL-C trace, i.e. the part between ADOL-C functions
trace_on() and trace_off() requires the use of adoubles. So this is the
only part of the program that must be compiled using C++ compiler. All
other parts of the program including calls to jacobian()/ sparse_jac()
or jac_vec() can be done inside a pure C program.

So in short there can be no pure C example using ADOL-C because pure C
has no concept of classes or operator overloading, which are essential
to the design of ADOL-C.

Cheers
K.K.

As on 2013-12-12 14:54h, Kharche, Sanjay did write:
> 
> Dear All
> 
> I am a new user of ADOL-C and am currently working through the examples
> and making some of my own programs. I am interested in numerically
> calculating Jacobians of a 40 state ODE system.
> 
> At this point, I would like cofirmation of the following: When I use
> "adouble" in a C program and compile with gcc, I get an unknown type
> error. When I compile the same program (after changing its extension
> from .c to .cpp) using g++, the program compiles. Can you confirm that
> ADOL-C program can only be cpp programs.
> 
> Further to the above query, I have looked for C examples using ADOL-C
> and could not find any. If there are any examples, can you please point
> them out to me.
> 
> thanks
> Sanjay
> 
> 
> 
> _______________________________________________
> ADOL-C mailing list
> ADOL-C at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/adol-c
> 

-- 
Dr. Kshitij Kulshreshtha

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

Büro: A3.235

Privatanschrift:
Arnikaweg 62
33100 Paderborn.


More information about the ADOL-C mailing list