-------------------------------------------
lines 5-260 of file: xrst/install_unix.xrst
-------------------------------------------
{xrst_begin install_unix}
{xrst_spell
config
dev
devel
fortran
grep
libs
pc
pkg
rpath
suitesparse
txt
wget
}
Installing cppad_mixed in Unix
##############################
{xrst_toc_hidden
bin/example_install.sh
bin/run_cmake.sh
bin/check_install.sh
}
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 :ref:`install_unix@Paths@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:
| |tab| ``git clone https://github.com/bradbell/cppad_mixed.git cppad_mixed.git``
| |tab| ``cd cppad_mixed.git``
You can determine the *git_hash* and version number
corresponding to this checkout of the master branch using the commands:
| |tab| ``git show-ref`` | ``grep`` ``'refs/heads/master'``
| |tab| ``grep`` '^ ``SET`` ( ``cppad_mixed_version`` ' ``CMakeLists.txt``
You can checkout an old version corresponding to a specific *git_hash* ,
and check its version number, using the commands:
| |tab| ``git checkout -q`` *git_hash*
| |tab| ``grep`` '^ ``SET`` ( ``cppad_mixed_version`` ' ``CMakeLists.txt``
Special 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
:ref:`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-config`` *pkg* ``--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 -L`` *prefix* ``-name`` *pkg* . ``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 :ref:`run_cmake.sh@build_type` that you will used.
They do not need to be executed each new version of ``cppad_mixed``
unless the :ref:`release_notes-name` 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 :ref:`example_install.sh-name` contains an example installation.
Linking
=======
The file :ref:`check_install.sh-name` is an example of compiling, linking
and running using an
:ref:`installed` version of
``cppad_mixed`` .
Using cppad_mixed
=================
The files
:ref:`ar1_xam.cpp-name` and :ref:`capture_xam.cpp-name`
contain examples and speed tests
of ``cppad_mixed`` .
These examples run when one executes the commands
::
cd build
make speed
{xrst_end install_unix}