\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\W}[1]{ \; #1 \; }\)
install_unix¶
View page sourceInstalling dismod_at in Unix¶
System Requirements¶
The following programs are required by dismod_at and should have standard system installs:
C++ Compiler¶
The dismod_at program can be compiled by any C++98 compliant compiler;
e.g., g++ .
(Note that a C++11 compiler would be better.)
Fortran Compiler¶
A fortran compiler is required by ipopt which in turn
is required by dismod_at .
git¶
The git program,
a source code version control system,
is required by dismod_at .
cmake¶
The cmake program,
which installs other programs,
is required by dismod_at .
pkg-config¶
The pkg-config program must be installed.
python3¶
The python3,
programming language.
The packages listed in the
standard library
are assumed to be present.
You need to have the following additional python packages:
numpy , matplotlib , scipy , build .
sqlite3¶
The http://sqlite.org/ library,
version 3.7.11 (released on 2012-03-20) or higher; see
sqlite releases.
Note that the development headers are required; e.g.,
on Fedora or Red-Hat one needs to install sqlite-devel .
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 .
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 .
eigen¶
The eigen <https://libeigen.gitlab.io/eigen/docs-nightly/>_ linear algebra package.
Download dismod_at.git¶
After installing the requirements above, use the following command to get the current version of dismod_at:
git clone https://github.com/bradbell/dismod_at.git dismod_at.gitcd dismod_at.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 ( dismod_at_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 ( dismod_at_version ‘ CMakeLists.txtPaths¶
This discussion is intended to help with the install of the special requirements and dismod_at (see below).
Adding to a Path¶
The instructions below may require you to add to a path_name . Use the command
echo $path_name
to see if your initial path is empty. If it is empty, use the command
exportpath_name = directory
to add directory to the path. If it is non-empty, use
exportpath_name =”$path_name : directory “
to add directory to the path.
PKG_CONFIG_PATH¶
After sqlite3 and gsl are installed
the following commands should work:
pkg-config sqlite3 --modversion
pkg-config gsl --modversion
If one of them fails, a corresponding directory is missing
from the PKG_CONFIG_PATH environment variable.
If prefix is the prefix where gsl was installed,
the command
find -Lprefix-name gsl.pc 2> /dev/null
should find the directory where gsl.pc is located.
After cppad_mixed
is installed (see below),
the following command should work:
pkg-configpkg--modversion
where pkg is any of the required packages.
(There is one exception, the eigen package uses eigen3 for
pkg above.)
If one of these commands fails,
find -Ldismod_at_prefix-namepkg .pc 2> /dev/null
should find the directory where pkg . pc is located;
see dismod_at_prefix .
LD_LIBRARY_PATH¶
The library locations are set at link time using cmake’s
always full rpath
commands.
Hence, it should not be necessary to set LD_LIBRARY_PATH in order for
dismod_at to work.
PATH¶
After you install dismod_at (see below) you should be able to execute the command
dismod_at
from any directory.
If you get the error dismod_at: command not found ,
you will need to add the binary install directory to you path.
Use the following command to find it:
find -Ldismod_at_prefix-name dismod_at 2> /dev/null
see dismod_at_prefix .
PYTHONPATH¶
After you install dismod_at you should be able to execute the following commands:
import dismod_atquit ()where python3 is your
python3_executable .
If you get the error No module named 'dismod_at' ,
you will need to add the directory where the module is installed
to your python path.
Use the following command to find it:
find -Ldismod_at_prefix-name site-packages 2> /dev/null
Special Requirements¶
The packages listed below are required by dismod_at and may not have standard system installs
install_settings.py¶
The settings in bin/install_settings.py 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 the install scripts below:
ipopt¶
The Ipopt
optimization package.
The script bin/get_cppad_mixed.sh (see below)
includes an install of ipopt.
cppad¶
The cppad
C++ algorithmic differentiation package.
The script bin/get_cppad_mixed.sh (see below)
includes an install of cppad.
cppad_mixed¶
The cppad_mixed
C++ random effects modeling package.
Starting in the dismod_at.git directory, the command
bin/get_cppad_mixed.sh
can be used to install ipopt, and cppad_mixed. This script also serves as an example of how to install cppad_mixed.
dismod_at¶
The steps above should only need to be executed once, not for
each new version of dismod_at
(unless the release_notes say otherwise).
The steps below will need to be executed each time you install
a new version of dismod_at :
Setup¶
The file bin/install_settings.py has setting that you should change so they correspond to your machine.
Cmake Command¶
After changing bin/install_settings.py to work for your system,
in the dismod_at.git directory
execute the following command:
bin/run_cmake.sh
The script also serves as an example of how to install dismod_at.
Build¶
The following command is option and will just build the
executable program build/devel/dismod_at :
cd build
make
cd ..
Test¶
The following commands are optional and will, build the dismod_at executable, build the examples and tests, and run the examples, correctness tests, and speed tests:
cd build
make check
make speed
cd ..
Some of the tests use different random number simulations each time
they are run.
If you get a correctness check failure during a make check
or make speed , try running the make command again.
If you get the same correctness check fails twice in a row,
there probably is a problem and
you should get help from the dismod_at development team.
Install¶
The following command will, build the dismod_at library and executable if necessary, and install dismod_at:
cd build
make install install_python
cd ..
Example¶
The file example_install.sh contains an example
install of dismod_at .
The section get_started contains a list of examples and tests
of using dismod_at .
These tests are run as part of the make check command above.