[CppAD] tests with ADOLC

bradbell at seanet.com bradbell at seanet.com
Sat Sep 8 12:21:26 EDT 2012


There is a simpler example that is a main program for using CppAD; namely
        http://www.coin-or.org/CppAD/Doc/get_started.cpp.xml
The corresponding file is listed at the bottom of that page as
        Input File: introduction/get_started/get_started.cpp


The getting started with cppad_ipopt example is
        http://www.coin-or.org/CppAD/Doc/ipopt_get_started.cpp.xml
The corresponding file is
        Input File: cppad_ipopt/example/get_started.cpp
This is not a main program but rather a routine that returns true of false
depending on if the corresponding test passes or fails.
The corresponding main program is
        cppad_ipopt/example/example.cpp
You could use this as your main program. In addition, you might want to
remove the calls to the other cppad_ipopt examples.

> Thanks for your reply. I wrote a small code by modifying the example
> get_started.cpp in cppad_ipopt folder. Now I want to compile it. The
> makefile in the folder seems pretty complicated and overkill. Could you
> please point me to a link to a place where I can find a the correct
> linkage
> and include flags for g++ to compile the example files? I'm sure this
> should be possible with one g++ call as long as I have the correct flags
> and links. Here is what I am getting right now:
>
>
>
> rishi at gandalf:~$ g++ -I/opt/cppad/2012/cppad_ipopt/example
> -I/opt/cppad/2012 -I/opt/cppad/2012/cppad_ipopt/src
> -I/opt/ipopt/3102/install/include -L/opt/cppad/2012/cppad_ipopt/src
> -lcppad_ipopt -L/opt/ipopt/3102/install/lib
> -L/usr/lib/gcc/x86_64-linux-gnu/4.6
> -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu
> -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib
> -L/lib/x86_64-linux-gnu
> -L/lib/../lib -L/usr/lib/../lib
> -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../.. -lipopt -llapack -ldl
> -lcoinmumps -lpthread -lcoinhsl -lblas -lgfortran -lm -lgcc_s -lquadmath
> -lcoinmetis   -L/usr/lib/gcc/x86_64-linux-gnu/4.6
> -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu
> -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib
> -L/lib/x86_64-linux-gnu
> -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib
> -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../.. -lgfortran -lm -lquadmath
> -lpthread -ldl nlmpc.cpp
>
> /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In
> function `_start':
> (.text+0x20): undefined reference to `main'
> /tmp/cconNijV.o: In function `ipopt_get_started()':
> nlmpc.cpp:(.text+0x868): undefined reference to
> `cppad_ipopt::cppad_ipopt_nlp::cppad_ipopt_nlp(unsigned long, unsigned
> long, CppAD::vector<double> const&, CppAD::vector<double> const&,
> CppAD::vector<double> const&, CppAD::vector<double> const&,
> CppAD::vector<double> const&, cppad_ipopt::cppad_ipopt_fg_info*,
> cppad_ipopt::cppad_ipopt_solution*)'
> nlmpc.cpp:(.text+0x899): undefined reference to
> `Ipopt::IpoptApplication::IpoptApplication(bool, bool)'
> /tmp/cconNijV.o:(.rodata._ZTVN5Ipopt6VectorE[vtable for
> Ipopt::Vector]+0xc8): undefined reference to
> `Ipopt::Vector::AddTwoVectorsImpl(double, Ipopt::Vector const&, double,
> Ipopt::Vector const&, double)'
> /tmp/cconNijV.o:(.rodata._ZTVN5Ipopt6VectorE[vtable for
> Ipopt::Vector]+0xd0): undefined reference to
> `Ipopt::Vector::FracToBoundImpl(Ipopt::Vector const&, double) const'
> /tmp/cconNijV.o:(.rodata._ZTVN5Ipopt6VectorE[vtable for
> Ipopt::Vector]+0xd8): undefined reference to
> `Ipopt::Vector::AddVectorQuotientImpl(double, Ipopt::Vector const&,
> Ipopt::Vector const&, double)'
> /tmp/cconNijV.o:(.rodata._ZTVN5Ipopt6VectorE[vtable for
> Ipopt::Vector]+0xe0): undefined reference to
> `Ipopt::Vector::HasValidNumbersImpl() const'
> collect2: ld returned 1 exit status
>




More information about the CppAD mailing list