Prev Next InstallUnix

Unix Download, Test, and Installation

Download Current Version
Note that 20071016.1 is the year, month, and date corresponding to the current version of CppAD. Download either the CPL or GPL licensed version from:

CPL License
cppad-20071016.1.cpl.tgz

GPL License
cppad-20071016.1.gpl.tgz

Extraction
Use the command
     tar -xvzf cppad-20071016.1.
license.tgz
(where license is cpl or gpl) to decompress and extract the unix format version into the distribution directory
     cppad-20071016.1
All of the commands below are to be executed starting from this directory.

User Documentation
The doc sub-directory of the distribution directory contains user documentation for CppAD. The files doc/*.htm are in HTML format. If your browser supports XHTML+MATHML format, an easier to read copy is available in the files doc/*.xml.

Developer Documentation
The dev sub-directory of the distribution directory contains developer documentation for CppAD.

Configure
Enter the directory created by the extraction and execute the command:
     ./configure                            \
     --prefix=
PrefixDir                     \
     --with-Documentation                   \
     --with-Introduction                    \
     --with-Example                         \
     --with-TestMore                        \
     --with-Speed                           \
     --with-PrintFor                        \
     --with-SpeedExample                    \
     --with-profiling                       \
     --with-stdvector                       \  
     POSTFIX_DIR=
PostfixDir                 \
     ADOLC_DIR=
AdolcDir                     \
     FADBAD_DIR=
FadbadDir                   \
     BOOST_DIR=
BoostDir                     \
     CPP_ERROR_WARN=
CppErrorsAndWarnings    \
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.

PrefixDir
The default value for PrefixDir is $HOME i.e., by default the CppAD include files will install in $HOME. If you want to install elsewhere, you will have to use this option.

As an example of using just the --prefix option, if you have permission to write into the directory /usr/local/include
 
	./configure --prefix=/usr/local
will set up for installing the CppAD include files in the directory
     /usr/local/include/cppad
This is the standard location for such files on many systems. In this case, PrefixDir is /usr/local.

--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/cppad-version/*
In this case, the top of the CppAD HTML documentation tree (with mathematics displayed as LaTex command) will be located at
     
PrefixDir/share/doc/cppad-version/cppad.htm
and the top of the XML documentation tree (with mathematics displayed as MathML) will be located at
     
PrefixDir/share/doc/cppad-version/cppad.xml

--with-Introduction

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


exp_apx
If the command line argument --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
If the command line argument --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
If the command line argument --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
If the command line argument --with-Speed is specified, the speed/cppad/speed_cppad_run/ program (a set of CppAD speed tests) will built. After you execute the make command, you can compile and run the speed_cppad tests.

--with-PrintFor
If the command line argument --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


--with-SpeedExample
If the command line argument --with-SpeedExample is specified, the speed test examples will be built. Once the make command has been executed, you can run this example by executing the command
 
	speed/example/example


--with-profiling
CppAD profile files that aid profiling with the GNU C++ compiler. If the command line argument --with-profiling is specified (in addition to the argument --with-Speed) a program called speed/profile/profile is generated. In this case, the following commands will profile the speed tests:
     speed/profile/profile 
option
     gprof -b speed/profile/profile
Running the speed/profile/profile program is documented in speed_main . 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


--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
This configure command line option is no longer available. It's documentation is included so that you know what its intention was:

By default, there is no postfix directory. As an example of using both the --prefix and POSTFIX_DIR options,
 
	./configure --prefix=/usr POSTFIX_DIR=test
will set up for installing the CppAD include files in the directory
     /usr/include/test/cppad

AdolcDir
If you have Adolc 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, after you execute the make command, you can compile and run the speed_adolc tests.

If you are using Cygwin, you will have to add to following lines to the file .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 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, after you execute the make command, you can compile and run the speed_fadbad tests.

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.

CppErrorsAndWarnings
If the command line argument CppErrorsAndWarnings is present, it specifies compiler error and warning flags. For example,
     CPP_ERROR_AND_WARN="-Wall -ansi"
would specify that error and 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 CppErrorsAndWarnings is the empty string.

make
The command
 
	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 , and FadbadDir above.

Final Installation
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 and PostfixDir .
Input File: omh/install_unix.omh