\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\W}[1]{ \; #1 \; }\)
install_unix¶
View page sourceInstalling cppad_mixed in Unix¶
System Requirements¶
The following programs are required by cppad_mixed and should have standard system installs:
C++ Compiler¶
The cppad_mixed program can be compiled by any C++11 compliant compiler;
e.g., g++ .
git¶
The git program, a source code version control system, must be installed.
cmake¶
The cmake program, which installs other programs, must be installed.
wget¶
The wget program must be installed.
Fortran Compiler¶
A fortran compiler is required by ipopt which in turn
is required by cppad_mixed .
gsl¶
gsl,
the gnu scientific library.
Note that the development headers are required; e.g.,
on Fedora or Red-Hat one needs to install gsl-devel .
pkg-config¶
The pkg-config program must be installed. The following command should work:
pkg-config gsl --libs
see PKG_CONFIG_PATH below.
suitesparse¶
The suitesparse
sparse matrix package.
Note that the development headers are required; e.g.,
on Fedora or Red-Hat one needs to install suitesparse-devel .
Note that installing suitesparse will include the metis
package and neither of these packages have pkg-config files.
It may be necessary for you to add the corresponding paths to your
dynamic library linking path shell variable.
Download¶
After installing the requirements above, use the following command to get the current version of cppad_mixed:
git clone https://github.com/bradbell/cppad_mixed.git cppad_mixed.gitcd cppad_mixed.gitYou can determine the git_hash and version number corresponding to this checkout of the master branch using the commands:
git show-ref | grep 'refs/heads/master'grep ‘^ SET ( cppad_mixed_version ‘ CMakeLists.txtYou can checkout an old version corresponding to a specific git_hash , and check its version number, using the commands:
git checkout -q git_hashgrep ‘^ SET ( cppad_mixed_version ‘ CMakeLists.txtSpecial Requirements¶
The packages listed below are required by cppad_mixed
and may not have standard system installs.
The install_ package scripts below can be used to install them.
If so, they should be executed in the order that they appear.
run_cmake.sh¶
The settings in bin/run_cmake.sh are used by the scripts that install the special requirements. You must first change these settings to the appropriate values for your system before running these scripts.
eigen¶
The eigen
linear algebra package.
Starting in the cppad_mixed.git directory,
the command
bin/install_eigen.sh
can be used to install this package.
Ipopt¶
The Ipopt
optimization package.
Starting in the cppad_mixed.git directory,
the command
bin/install_ipopt.sh
can be used to install this package.
CppAD¶
The cppad
C++ algorithmic differentiation package.
Starting in the cppad_mixed.git directory,
the command
bin/install_cppad.sh
can be used to install this package.
Paths¶
PKG_CONFIG_PATH¶
For pkg equal to gsl , eigen , ipopt and
cppad , the following command should work:
pkg-configpkg--libs
(This command should work for gsl before the special requirements
are installed.)
If this command fails, the corresponding directory is missing
from the PKG_CONFIG_PATH environment variable.
If prefix is the prefix where pkg was installed,
the command
find -Lprefix-namepkg .pc 2> /dev/null
can be used to find the directory where %pkg%.pc is located.
LD_LIBRARY_PATH¶
The library locations are set at link time using cmake’s
always full rpath
commands.
It should not be necessary to set LD_LIBRARY_PATH in order for
cppad_mixed to work if you specify the directory using an
rpath command when you build your executable.
cppad_mixed¶
The steps above need to be executed once,
for each build_type that you will used.
They do not need to be executed each new version of cppad_mixed
unless the release_notes say otherwise.
The steps below will need to be executed each time you install
a new version of cppad_mixed :
Cmake Command¶
Starting in the cppad_mixed.git directory:
The following command will configure cppad_mixed :
bin/run_cmake.sh
Check¶
Starting in the cppad_mixed.git directory:
The following commands are optional and will
build and run the examples and correctness tests:
cd build
make check
Speed¶
Starting in the cppad_mixed.git directory:
The following commands are optional and will
build and run the speed tests:
cd build
make speed
Install¶
Starting in the cppad_mixed.git directory:
The following command will
install the cppad_mixed library and include files:
cd build
make install
Example¶
Installation¶
The file example_install.sh contains an example installation.
Linking¶
The file check_install.sh is an example of compiling, linking
and running using an
installed version of
cppad_mixed .
Using cppad_mixed¶
The files
ar1_xam.cpp and capture_xam.cpp
contain examples and speed tests
of cppad_mixed .
These examples run when one executes the commands
cd build
make speed