|
Prev | Next |
yum install cppad-devel
(In Fedora, devel is used for program development tools.)
You can download and install the corresponding version of the
documentation using the command
yum install cppad-doc
cppad.spec file
to build an RPM for some other operating system,
it can be found at
https://projects.coin-or.org/CppAD/browser/trunk/cppad.spec
tar
and then compressed with gzip:
The ascii files for these downloads are in
Unix format; i.e., each line ends with just a line feed.
CPL License | cppad-20120203.cpl.tgz |
GPL License | cppad-20120203.gpl.tgz |
tar -xvzf cppad-20120203.license.tgz
(where
license
is cpl or gpl)
to decompress and extract the unix format version
into the distribution directory
cppad-20120203
To see if this has been done correctly, check for the following file:
cppad-20120203/cppad/cppad.hpp
cppad-20120203/work,
which will be referred to as the work directory below.
./configure \
--prefix=PrefixDir \
--with-Documentation \
--with-stdvector \
--with-boostvector \
CXX_FLAGS=CompilerFlags \
OPENMP_FLAGS=OpenmpFlags \
POSTFIX_DIR=PostfixDir \
ADOLC_DIR=AdolcDir \
FADBAD_DIR=FadbadDir \
SADADO_DIR=SacadoDir \
BOOST_DIR=BoostDir \
IPOPT_DIR=IpoptDir \
TAPE_ADDR_TYPE=TapeAddrType
where only the configure line need appear; i.e.,
the entries one each of the other lines are optional.
The text in italic is replaced values that you choose;
see discussion below.
make
in the work directory.
make command,
you can run the correctness and speed tests.
The following command will build all the correctness and speed tests.
In addition, it will run all the correctness tests:
make test
The following links describe how to build and run subsets of these tests:
| get_started | Getting Started Using CppAD to Compute Derivatives |
| exp_apx_main | Correctness Tests For Exponential Approximation in Introduction |
| example | CppAD Examples and Tests |
| print_for_cout | Printing During Forward Mode: Example and Test |
| speed_example | Run the Speed Examples |
| speed_double | Speed Test of Functions in Double |
| speed_adolc | Speed Test of Derivatives Using Adolc |
| speed_cppad | Speed Test Derivatives Using CppAD |
| speed_fadbad | Speed Test Derivatives Using Fadbad |
| speed_sacado | Speed Test Derivatives Using Sacado |
cd test_more
make test
cd speed/profile
make test
After executing make test, you can run a profile speed test
by executing the command ./profile;
see speed_main
for the meaning of the command line
options to this program.
After you have run a profiling speed test,
you can then obtain the profiling results with
gprof -b profile
If you are using a windows operating system with Cygwin or MinGW,
you may have to replace profile by profile.exe
in the gprof command above; i.e.,
gprof -b profile.exe
In C++, template parameters and argument types become part of a
routines's name.
This can make the gprof output hard to read
(the routine names can be very long).
You can remove the template parameters and argument types from the
routine names by executing the following command
gprof -b profile | sed -f gprof.sed
If you are using a windows operating system with Cygwin or MinGW,
you would need to use
gprof -b profile.exe | sed -f gprof.sed
$HOME
i.e., by default the CppAD include files
will install
below $HOME.
If you want to install elsewhere, you will have to use this option.
As an example of using the
--prefix=PrefixDir
option,
if you specify
./configure --prefix=/usr/local
the CppAD include files will be installed in the directory
/usr/local/include/cppad
If --with-Documentation
is specified, the CppAD documentation files will be installed in the directory
/usr/local/share/doc/cppad-20120203
--with-Documentation is specified,
the CppAD documentation HTML and XML files are copied to the directory
PrefixDir/share/doc/PostfixDir/cppad-20120203
(see PostfixDir
).
The top of the CppAD HTML documentation tree
(with mathematics displayed as LaTex command) will be located at
PrefixDir/share/doc/PostfixDir/cppad-20120203/cppad.htm
and the top of the XML documentation tree
(with mathematics displayed as MathML) will be located at
PrefixDir/share/doc/PostfixDir/cppad-20120203/cppad.xml
--with-stdvector is specified,
the default definition this template class is replaced by
std::vector
In this case --with-boostvector must not also be specified.
--with-boostvector is specified,
the default definition this template class is replaced by
boost::numeric::ublas::vector
In this case --with-stdvector must not also be specified.
See also, BoostDir
CompilerFlags
is present,
it specifies compiler flags.
For example,
CXX_FLAGS="-Wall -ansi"
would specify that warning flags -Wall
and -ansi should be included
in all the C++ compile commands.
The error and warning flags chosen must be valid options
for the C++ compiler.
The default value for
CompilerFlags
is the
empty string.
OpenmpFlags
is present,
it specifies the necessary flags so that the compiler will
properly interpret OpenMP directives.
For example, when using the GNU g++ compiler,
the following setting includes the OpenMP tests:
OPENMP_FLAGS=-fopenmp
If you specify configure command,
the CppAD OpenMP correctness and speed tests will be built; see
threading
multi-threading tests.
POSTFIX_DIR=PostfixDir
option,
if you specify
./configure --prefix=/usr/local POSTFIX_DIR=coin
the CppAD include files will be
installed
in the directory
/usr/local/include/coin/cppad
If --with-Documentation
is specified, the CppAD documentation files will be installed in the directory
/usr/local/share/doc/coin/cppad-20120203
AdolcDir
in the
configure
command line.
The value of
AdolcDir
must be such that
AdolcDir/include/adolc/adouble.h
is a valid way to reference adouble.h.
In this case, you can run the Adolc speed correctness tests
by executing the following commands starting in the work directory:
cd speed/adolc
make test
After executing make test, you can run an Adolc speed tests
by executing the command ./adolc;
see speed_main
for the meaning of the command line
options to this program.
.bash_profile in your home directory:
LD_LIBRARY_PATH=AdolcDir/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
in order for Adolc to run properly.
.bash_profile in your home directory:
PATH=AdolcDir/bin:${PATH}
export PATH
in order for Adolc to run properly.
If
AdolcDir
begins with a disk specification,
you must use the Cygwin format for the disk specification.
For example,
if d:/adolc_base is the proper directory,
/cygdrive/d/adolc_base should be used for
AdolcDir
.
FadbadDir
.
It must be such that
FadbadDir/FADBAD++/badiff.h
is a valid reference to badiff.h.
In this case, you can run the Fadbad speed correctness tests
by executing the following commands starting in the work directory:
cd speed/fadbad
make test
After executing make test, you can run a Fadbad speed tests
by executing the command ./fadbad;
see speed_main
for the meaning of the command line
options to this program.
SacadoDir
.
It must be such that
SacadoDir/include/Sacado.hpp
is a valid reference to Sacado.hpp.
In this case, you can run the Sacado speed correctness tests
by executing the following commands starting in the work directory:
cd speed/sacado
make test
After executing make test, you can run a Sacado speed tests
by executing the command ./sacado;
see speed_main
for the meaning of the command line
options to this program.
BOOST_DIR=BoostDir
is present, it must be such that files
BoostDir/boost/numeric/ublas/vector.hpp
BoostDir/boost/thread.hpp
are present.
In this case, these files will be used by CppAD.
See also, --with-boostvector
IpoptDir
.
It must be such that
IpoptDir/include/coin/IpIpoptApplication.hpp
is a valid reference to IpIpoptApplication.hpp.
In this case, the CppAD interface to Ipopt
examples
can be built and tested
by executing the following commands starting in the work directory:
make
#
cd cppad_ipopt/example
make test
#
cd ../test
make test
#
cd ../speed
make test
Once this has been done, you can execute the program
./speed in the work/cppad_ipopt/speed directory;
see ipopt_ode_speed.cpp
.
TapeAddrType
is present,
it specifies the type used for address in the AD recordings (tapes).
The valid values for this argument are
unsigned short int,
unsigned int,
size_t.
The smaller the value of
sizeof(TapeAddrType)
,
the less memory is used.
On the other hand, the value
std::numeric_limits<TapeAddrType>::max()
must be larger than any of the following:
size_op
,
size_op_arg
,
size_par
,
size_par
,
size_par
.
make install
This will install CppAD in the location specified by
PrefixDir
.
You must have permission to write in the
PrefixDir
directory to execute this command.
You may optionally specify a destination directory for the install; i.e.,
make install DESTDIR=DestinationDirectory