Prev Next InstallUnix

Unix Test and Installation

Download
You must first download a copy of 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-stdvector                       \  
     ADOLC_DIR=
AdolcDir                     \
     FADBAD_DIR=
FadbadDir                   \
     SADADO_DIR=
SacadoDir                   \
     BOOST_DIR=
BoostDir                     \
     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.

Testing Return Status

statue, test return

test, return statue
All of the test programs mentioned below (with the exception of print_for ) return a status of zero, if all correctness tests pass, and one for an error. For example, if --with-Example is included in the 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.

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, a set of speed tests will built.

cppad
After you execute the make command, you can run the speed_main program with the command
     speed/cppad/cppad 
option seed

double
After you execute the make command, you can run the speed_main program with the command
     speed/double/double 
option seed

profile
The C++ compiler flags used to build the profile speed tests are
 
     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


example
After you execute the make command, you can run the speed_utility examples with the command
     speed/example/example

--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
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
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.)

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. 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.

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 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. 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
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. 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.

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.

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
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 , FadbadDir , and SacadoDir above.

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