Git Product home page Git Product logo

adevs's Introduction

This file contains instructions for building the C++ library and
the Java bindings. Development versions of this library are available 
from SourceForge and github.

---- C++ -----
Adevs is implemented primarily as a set of C++ header files,
and for many applications these are sufficient. The rest of
the simulation engine is in the static library file 'libadevs.a'.
To build this library file this, go to the directory called 'src'
and run 'make'. The default options for the compiler should
work if you are using the GNU g++ compiler. For other compilers,
you make set options, build commands, etc. by editing the Makefile.

If you are using Visual Studio and Windows, then to build the
static library do the following: 1) open a command shell, 2) go the
'src' directory, and 3) run the batch file 'build.bat'. This 
creates a static library to link with your simulation applications.
Note that the Windows build script does not include any OpenMP options
and so those must be added to the compiler switches if you want to
use the OpenMP enabled parts of the simulation engine. Note that
the Express versions of Visual Studio don't support OpenMP in any case.

---- Java -----
To build the java bindings for Linux, go the the 'src' directory and  
edit the Makefile so that JAVA_HOME points to your jdk installation.
Then run 'make java_adevs'. This builds the shared library libjava_adevs.so
and the jar-file adevs.jar. To use these put the shared library into 
your LD_LIBRARY_PATH and the jar file into your CLASSPATH.

To build the java bindings For Windows, first make sure that 1) your
JAVA_HOME environment variable points to your jdk installation and
2) that the java compiler is in your executable PATH. Then execute
the batch file src/adevs_jni/build.bat. This creates the jar-file
adevs.jar and DLL-file java_adevs.dll. You can use these by putting
the former into your CLASSPATH and latter into your PATH.

---- FMI ----
Adevs supports importing models that use the FMI standard for Model
Exchange. Information about this standard can be found at
http://www.fmi-standard.org. This feature is particularly useful
for importing continuous system models built with the Modelica
language into your discrete event simulation. The examples and
test cases shipped with adevs assume that you have the 
OpenModelica compiler installed. You can get this compiler from
http://www.openmodelica.org. The bash script build-omc.sh for building
the OpenModelica compiler from source code is located in the util
directory. The fmi test cases are located in test/fmi, and you can
execute these by going to that directory and running 'make all'.

---- Useful scripts ----

xml2cpp.py
This script will convert an FMI model description file to a C++ class
that imports the FMI described into an adevs simulation by using the
adevs::FMI class. Executing the script will display rudimentary information
about command line arguments.

build-omc.sh
This bash shell script will download and build the OpenModelica compiler,
which can be used to translate Modelica models into FMI modules. These FMI
modules can then be loaded into your adevs simulation.

---- Testing -----
There are four sets of test cases that can be run from the
directory 'test'. The first set are for the C++ library without
OpenMP support. These tests are run with 'make check_cpp'.
The parts of the C++ library that use OpenMP can be tested by
executing 'make check_par'.  The java bindings can be tested by
executing 'make check_java'. The fmi import support can be
tested by executing 'make check_fmi'. Executing 'make check'
runs all of the test cases.

The make.common file contains platform specific settings for
the test scripts. It is setup by default for a GNU/Linux type of
environment. Change as needed for your environment, but if you are
using a more or less typical Linux distribution then the defaults
should work fine.

When testing the Java bindings, be sure your PATH, LD_LIBRARY_PATH,
and CLASSPATH are setup properly before running the Java test
cases. These need to include your DLL (for Windows) and Java binaries,
shared object file (for Linux), and jar file and the '.' directory
respectively.

For OpenMP test cases, you will need to set the maximum number of threads
to at least four (one of the test cases requires at least four threads).

For the FMI test cases, you will need to have the OpenModelica compiler
installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.