The top level directory structure of the adevs library looks like this
adevs-x.y.z
|->docs
|->examples
|->include
|->src
|->test
|->util
The short form of the build instructions is as follows (this works with the GCC compilers and M$ Visual Studio compiler):
Edit the adevs_config.h file in the include directory as needed.
Go the the src directory and execute 'make' (for GNU compilers) or 'nmake -f make.vc' (for M$ Visual Studio compilers). The result of building with the GNU compiler is to produce a library libadevs.a. The result of building with the M$ compiler is to produce the library adevs.lib.
Make sure that the include directory is in your compiler's include file path and that the src directory is in your compiler's link file path. Also make sure that you link your simulation code with the libadevs.a or adevs.lib library.
Now, the long form. These instructions are for the GCC compiler in either a cygwin or native UN*X environment. The M$ instructions are similar.
The include
directory contains a file adevs_config.h. This file contains
configuration settings that describe the basic model I/O type, the
basic time type and its parameters (i.e. epsilon, infinity, and
zero), the basic port type, and the namespace that will contain adevs
classes. By default, these are object*
for the I/O type, double for the time type with ZERO = 0.0,
EPSILON=1e-14, and INFINITY=DBL_MAX, unsigned long for the port type,
and no namespace. These can be altered as needed so long as the types
support the necessary operators (see the default adevs_config.h
file for more information).
Adevs has some
support for parallel computers that support POSIX threads
(pthreads). Additional support is provided for NUMA computers
that support the Linux numa library. These features can be
enabled or disabled when you install the library by making the
necessary changes to the adevs_config.h file (instructions are in that
file). If you do this, then models linked with the adevs library
will also need to be linked with the pthread and (for NUMA machines)
numa libraries.
Having edited the adevs_config.h file to taste, cd to the src directory. Edit the Makefile there to set the appropriate compiler options and then enter 'make' to build the adevs library. If all goes well, the static library libadevs.a will be placed in the src directory. To clean up after a build, use 'make clean'. This will remove the library and all object files. To clean up and restore the default configuration settings, use 'make new'.
The adevs
test suite can be run by cd'ing to the test directory and, after
editing the Makefile there to set the appropriate compiler options,
using 'make check'. If the test suite runs without stopping and
reporting a make error, the test was successful. Make will abort with
an error if any test fails. Use 'make clean' to remove object files,
executables, and other temporary files created during testing. When
building your simulation programs, they must be linked with the
libadevs.a static library placed in the src directory during the
build process. The header files necessary for using the adevs library
are located in the include directory. It should be sufficient to
include adevs.h in your program.
Please note that
the test suite is built for the default adevs installation. There
is one extra set of tests for installations that are using the POSIX
threads (but not NUMA) support. To execute these test cases, make
sure that you
have compiled adevs with the proper options and then run 'make
parallel_check'. If the execution ends without an error message,
then the test was successful.