![]() |
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-20080826.0.cpl.tgz |
GPL License | cppad-20080826.0.gpl.tgz |
tar -xvzf cppad-20080826.0.
license.tgz
(where license is cpl
or gpl
)
to decompress and extract the unix format version
into the distribution directory
cppad-20080826.0
To see if this has been done correctly, check for the following file:
cppad-20080826.0/cppad/cppad.hpp
./configure \
--prefix=
PrefixDir \
--with-Documentation \
--with-Introduction \
--with-Example \
--with-TestMore \
--with-Speed \
--with-PrintFor \
--with-stdvector \
POSTFIX_DIR=
PostfixDir \
ADOLC_DIR=
AdolcDir \
FADBAD_DIR=
FadbadDir \
SADADO_DIR=
SacadoDir \
BOOST_DIR=
BoostDir \
IPOPT_DIR=
IpoptDir \
CXX_FLAGS=
CompilerFlags
where only the configure
command need appear.
The entries one each of the other lines are optional
and the text in italic is replaced values that you choose.
configure
command,
if ! example/example
then
echo "example failed its test"
echo exit 1
fi
could be used abort the a bash shell script when the test failed.
$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-20080826.0
--with-Documentation
is specified,
the CppAD documentation HTML and XML files are copied to the directory
PrefixDir/share/doc/
PostfixDir/cppad-20080826.0
(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-20080826.0/cppad.htm
and the top of the XML documentation tree
(with mathematics displayed as MathML) will be located at
PrefixDir/share/doc/
PostfixDir/cppad-20080826.0/cppad.xml
--with-Introduction
is specified,
the get_started.cpp
example will be built.
Once the make
command
has been executed, you can run this example by executing the command
introduction/get_started/get_started
--with-Introduction
is specified,
the exp_apx_main.cpp
program
(verifies calculations in the Introduction
exp_apx
example)
will be built.
Once the make
command
has been executed, you can run these examples by executing the command
introduction/exp_apx/exp_apx
--with-Example
is specified,
the Example.cpp
program
(an extensive set of examples and correctness tests) will be built.
Once the make
command
has been executed, you can run these examples by executing the command
example/example
--with-TestMore
is specified,
another extensive set of correctness tests will be compiled by the
make
command. Once the make
command
has been executed, you can run these tests by executing the command
test_more/test_more
--with-Speed
is specified,
a set of speed tests will built.
speed/cppad/cppad
option
seed
speed/double/double
option
seed
AM_CXXFLAGS = -pg -O2 $(CXX_FLAGS) -DPROFILE
After you execute the make
command,
you can run the speed_main
program with the command
speed/profile/profile
option
seed
You can then obtain the profiling results with
gprof -b speed/profile/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 speed/profile/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 speed/profile/profile | sed -f speed/profile/gprof.sed
If you are using a windows operating system with Cygwin or MinGW,
you would need to use
gprof -b speed/profile/profile.exe | sed -f speed/profile/gprof.sed
speed/example/example
--with-PrintFor
is specified,
the PrintFor.cpp
example will be built.
Once the make
command
has been executed, you can run this example by executing the command
print_for/print_for
Unlike the other programs listed in this section,
print_for
does not automatically check for correctness
and return a corresponding
status
.
Instead, it displays what it's output should be.
--with-stdvector
is specified,
the default definition this template class is replaced by
std::vector
(In this case BoostDir must not also be specified.)
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-20080826.0
AdolcDir/include/adolc/adouble.h
is a valid way to reference adouble.h
.
If --with-Speed
is also specified,
after you execute the make
command,
you can run the speed_main
program with the command
speed/
package/
package
option
seed
where package is equal to adolc
.
const char*
as a char*
. This can be fixed by changing the following
routine in the file adolc/avector.h
:
class ADOLC_DLL_EXPORT err_retu {
char* message;
public:
err_retu(char* x) {
printf("%s \n",x);
};
};
to be as follows
class ADOLC_DLL_EXPORT err_retu {
char* message;
public:
err_retu(const char* x) {
printf("%s \n",x);
};
};
.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/FADBAD++/badiff.h
is a valid reference to badiff.h
.
If --with-Speed
is also specified,
after you execute the make
command,
you can run the speed_main
program with the command
speed/
package/
package
option
seed
where package is equal to fadbad
.
SacadoDir/include/Sacado.hpp
is a valid reference to Sacado.hpp
.
If --with-Speed
is also specified,
after you execute the make
command,
you can run the speed_main
program with the command
speed/
package/
package
option
seed
where package is equal to sacado
.
CPPAD_TEST_VECTOR
is
CppAD::vector
.
If the command line argument
BOOST_DIR=
BoostDir
is present, it must be such that
BoostDir/boost/numeric/ublas/vector.hpp
is a valid reference to the file vector.hpp
.
In this case, the default definition of CPPAD_TEST_VECTOR
is replaced by
boost::numeric::ublas::vector
(see boost
).
If BoostDir is present, the argument --with-stdvector
must not be present.
IpoptDir/include/IpIpoptApplication.hpp
is a valid reference to IpIpoptApplication.hpp
.
In this case,
ipopt_cppad.cpp
will be included in the example testing.
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.
make
will compile all of the examples and tests.
An extensive set of examples and tests can be run as described under
the headings
--with-Introduction
,
--with-Example
,
--with-TestMore
,
--with-Speed
,
--with-PrintFor
,
AdolcDir
,
FadbadDir
,
SacadoDir
,
and IpoptDir
above.
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