Prev Next

Unix Download, Test and Installation

Fedora
CppAD is available through yum on the Fedora operating system starting Fedora version 7. You can download and install CppAD with the instruction 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

RPM
If you want to use the Fedora 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

Download

Subversion
If you are familiar with subversion, you may want to follow the more complicated CppAD download instructions; see the following subversion instructions .

Web Link
If you are not using the subversion download instructions, make sure you are reading the web version of this documentation by following the link web version . Then proceed with the instruction that appear below this point.

Unix Tar Files
The download files below were first archived with 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-20100315.cpl.tgz
GPL License    cppad-20100315.gpl.tgz

Tar File Extraction
Use the unix command
     tar -xvzf cppad-20100315.
license.tgz
(where license is cpl or gpl) to decompress and extract the unix format version into the distribution directory
     cppad-20100315
To see if this has been done correctly, check for the following file:
     cppad-20100315/cppad/cppad.hpp

Configure
Enter the distribution_directory (the directory created by the extraction) and execute the command:
     ./configure                            
     --prefix=
PrefixDir                     
     --with-Documentation                   
     --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.

make test
You can run all of the CppAD correctness tests by executing the command make test in the distribution_directory . A description of the tests, and instructions for running individual tests, are described below.

Introduction

Getting Started
You can run the CppAD getting started example / test by executing the command make test in the directory
     
distribution_directory/introduction/get_started

exp_apx
You can run the examples / tests for the exp_apx function (used in the Introduction ) by executing the command make test in the directory
     
distribution_directory/introduction/exp_apx

CppAD Examples
You can run a large number of the examples / tests showing how to use CppAD by executing the command make test in the directory
     
distribution_directory/example
See ListAllExamples for a list of all the CppAD examples.

More Testing
You can run a large number of tests (that are not intended to be examples) by executing the command make test in the directory
     
distribution_directory/test_more

Speed Testing

CppAD Derivative Speed Tests
A set of CppAD derivative value speed tests are included with this distribution. You can test that the results computed during these tests are correct by executing the command make test in the directory
     
distribution_directory/speed/cppad
After executing make test, you can run the CppAD derivative speed tests by executing the command ./cppad (see speed_main ).

Function Speed Tests
A set of functions value speed tests are included (to compare with derivative values speeds). You can test that the results computed during these tests are correct by executing the command make test in the directory
     
distribution_directory/speed/double
After executing make test, you can run the function value speed tests by executing the command ./double (see speed_main ).

Examples For Speed Tests
The speed tests use some utilities that have their own set of examples / tests. You can test that the results computed by this utilities are correct by executing the command make test in the directory
     
distribution_directory/speed/example

Profiling CppAD
The CppAD derivative speed tests mentioned above can be profiled. You can test that the results computed during this profiling are correct by executing the command make test in the directory
     
distribution_directory/speed/profile
After executing make test, you can run the profile tests by executing the command ./profile (see speed_main ). 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


PrintFor
You can test the PrintFor command by executing the command make test in the directory
     
distribution_directory/print_for

PrefixDir
The default value for prefix directory is $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-20100315

--with-Documentation
If the command line argument --with-Documentation is specified, the CppAD documentation HTML and XML files are copied to the directory
     
PrefixDir/share/doc/PostfixDir/cppad-20100315
(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-20100315/cppad.htm
and the top of the XML documentation tree (with mathematics displayed as MathML) will be located at
     
PrefixDir/share/doc/PostfixDir/cppad-20100315/cppad.xml

--with-stdvector
The CPPAD_TEST_VECTOR template class is used for extensive examples and testing of CppAD. If the command line argument --with-stdvector is specified, the default definition this template class is replaced by
 
	std::vector
(In this case BoostDir must not also be specified.)

PostfixDir
By default, the postfix directory is empty; i.e., there is no postfix directory. As an example of using the 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-20100315

AdolcDir
If you have Adolc 1.10.2 installed on your system, you can specify a value for 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 command make test in the directory
     
distribution_directory/speed/adolc
After executing make test, you can run the Adolc speed tests by executing the command ./adolc (see speed_main ).

Linux
If you are using Linux, you will have to add to following lines to the file .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.

Cygwin
If you are using Cygwin, you will have to add to following lines to the file .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
If you have Fadbad 2.1 installed on your system, you can specify a value for 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 command make test in the directory
     
distribution_directory/speed/fadbad
After executing make test, you can run the Fadbad speed tests by executing the command ./fadbad (see speed_main ).

SacadoDir
If you have Sacado installed on your system, you can specify a value for 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 command make test in the directory
     
distribution_directory/speed/sacado
After executing make test, you can run the Sacado speed tests by executing the command ./sacado (see speed_main ).

BoostDir
The CPPAD_TEST_VECTOR template class is used for extensive examples and testing of CppAD. The default definition for 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
If you have Ipopt installed on your system, you can specify a value for 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 command make test in the directory
     
distribution_directory/cppad_ipopt/example
You can do more testing of this interface by executing make test in the directories
     
distribution_directory/cppad_ipopt/test
     
distribution_directory/cppad_ipopt/speed
Once this has been done, you can execute the program
     
distribution_directory/cppad_ipopt/speed/speed
see ipopt_ode_speed.cpp .

CompilerFlags
If the command line argument 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.

make install
Once you are satisfied that the tests are giving correct results, you can install CppAD into easy to use directories by executing the command
 
	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

Input File: omh/install_unix.omh