Installation

The top level directory structure of the adevs library looks like this

adevs-x.x
   |->docs
   |->examples
   |->include
   |->src
   |->test
   |->util

The short form of the build instructions is as follows:


  1. Edit the adevs_config.h file in the include directory as needed.

  2. Go the the src directory and execute 'make' (if the USE_THREADS flag is not defined) or 'make parallel' (if USE_THREADS is defined).

    If you compiled the library with POSIX threads support, you may need to link your programs with the pthreads library. On the Solaris operating system, you will need to link against the rt library (which implements some later additions to the pthreads standard).


Now, the long form.


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), and the basic port type. 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, and int for the port type. 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). The USE_THREADS flag should be set of you are using a multiprocessor computer that supports POSIX threads and you want to enable the parallel computing features of adevs.

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 library without thread support, and use 'make parallel' to compile with thread support. 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 just <adevs.h> in your program.

If you are using Microsoft's Visual C++ compiler, you will need to to create a project, import all of the files in the src and include directories EXCEPT the adevs_thread.h and adevs_thread.cpp files (make sure USE_THREADS is not defined in adevs_config.h), and add the adevs include directory to the list of directories to search for header files. In the past, I've used the 'static library' project option without support for pre-compiled headers or MFC. I get warnings related to long template names when compiling, but these don't seem to be indicative of an actual problem. Automatic testing with MS Visual C++ is not supported.