Purpose
This is a
bash
script that configures implicit_ad
by running CMake
.
If you do not have bash on your system,
this script can be considered documentation for the cmake command.
Correctness Testing
After this script is run, the following commands will run the
tests for correctness:
cd build
make check
Speed Testing
After this script is run, the following commands will run the
speed tests:
cd build
make time
./time
Exit on Error
The following command instructs bash to terminate, with a non-zero
exit status, when an error occurs:
set -e
Check Working Directory
Check that the current working directory is the top level source directory.
if [ "$0" != 'bin/run_cmake.sh' ]
then
echo 'bin/run_cmake.sh: must be run from its parent directory'
exit 1
fi
eigen_pkg_config_path
This is the directory where the file eigen3.pc file is located.
It is often desirable to install eigen its own special prefix
so warnings can be suppressed for its include files without suppressing
warnings for other include files.
ipopt_pkg_config_path
The install of cppad may be done in a way that uses the
ipopt libraries. If this is the case, you must change the following
setting to the directory where the file ipopt.pc is located
(otherwise, the cmake command will report the error message
'ipopt' required by 'cppad').
PKG_CONFIG_PATH="${cppad_pkg_config_path}:${eigen_pkg_config_path}"
if [ "$ipopt_pkg_config_path" != "" ]
then
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${ipopt_pkg_config_path}"
fi
cmake_verbose_makefile
If this is true, make will display the compile and link commands
that it uses to build the tests.
cmake_verbose_makefile='false'
cmake_build_type
You should use debug for correctness testing and
release for speed testing.
cmake_build_type='debug'
extra_cxx_flags
Extra C++ flags, besides the debug and release flags,
used during compile commands.