run_cmake.sh

View page source

bin/run_cmake.sh: User Configuration Options

verbose_makefile

Use ‘no’ for normal and ‘yes’ for verbose make output:

verbose_makefile='no'

build_type

Use either ‘debug’ or ‘release’ for the type of this build:

build_type='debug'

cmake_install_prefix

Prefix where cppad_mixed is installed:

cmake_install_prefix="$HOME/prefix/cppad_mixed"

If cmake_install_prefix ends in /cppad_mixed , run_cmake.sh will use a soft link from this prefix to cmake_install_prefix . debug or cmake_install_prefix . release depending on the choice for build_type .

Debug and Release

If a soft link is used for the install, the same technique will be used to map the build directory to the debug or release version. If you are using both a debug and release versions of cppad_mixed, both versions of the Special Requirements will need to be installed.

Eigen Prefix

It is a good idea to use a different prefix for installing eigen because the corresponding include files are treated like system files, otherwise the eigen include files would generate lots of warnings. The example install script bin/install_eigen.sh uses cmake_install_prefix / eigen as the prefix for installing eigen.

specific_compiler

On some systems, e.g. the Mac using port, there are problems with mixing different compiler systems for fortran and C++; see ipopt issue 471. This variable allows you to set a specific compiler for C and or CXX and or FC. For example specific_compiler='CC=gcc CXX=g++ FC=gfortran' uses the gnu versions of these compilers. The configuration will automatically find compilers that are not specified; i.e., if

specific_compiler=''

extra_cxx_flags

Extra C++ flags used to compile and test

extra_cxx_flags='-Wpedantic -std=c++17 -Wall -Wshadow -Wconversion'
#
# for macOS using homebrew:
if [ "$(uname)" == 'Darwin' ]
then
    if which brew > /dev/null
    then
        extra_cxx_flags+=' -I /opt/homebrew/include'
        extra_cxx_flags+=' -Wno-bitwise-instead-of-logical'
        extra_cxx_flags+=' -Wno-sign-conversion'
    fi
fi

cmake_libdir

Sub-directory of each prefix where libraries are installed.

cmake_libdir='lib64'

cppad_mixed.pc

The file pkg-config file cppad_mixed.pc is installed in the cmake_install_prefix/cmake_libdir directory.

ldlt_cholmod

If yes, use ldlt_cholmod LDLT factorization where possible. Otherwise always use ldlt_eigen for LDLT factorization.

ldlt_cholmod='yes'

optimize_cppad_function

If yes, the operation sequence for certain CppAD functions will be optimized. This makes the code run faster but in some cases it can make debugging more complicated. It is suggested that you use no when build_type is debug and yes when build_type is release .

optimize_cppad_function='no'

for_hes_sparsity

If yes, user for_hes_sparsity to compute sparsity w.r.t. random effects (otherwise use rev_hes_sparsity ).

for_hes_sparsity='yes'

Testing Speed and Memory

If you wish to test the speed or memory used by cppad_mixed , set build_type to release , include the -g flag in extra_cxx_flags . Then execute the following commands:

        bin/install_cppad.sh
        bin/run_cmake.sh
        cd build ; make program ; cd ..
        bin/ program . sh test2run

where program is ar1_xam or capture_xam and test2run is normal , callgrind , or massif .