Installation

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

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

If you are using Microsoft Visual C++, see the last paragraph on this page. Otherwise, here is the short form of the build instructions:


  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 can build a static library using the make.vc6 makefile that is in the src directory. Follow all of the above instructions (make sure USE_THREADS is not defined in adevs_config.h) and then execute the command 'nmake -f make.vc6' in the src directory. This should build a static library adevs.lib. The 'clean' and 'new' make targets should work, but the test suite and most (if not all) of the examples will not compile without some effort.