-
Notifications
You must be signed in to change notification settings - Fork 11
smiz/adevs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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. ---- 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 and these tests are run with 'make check_cpp'. 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 the FMI test cases, you will need to have the OpenModelica compiler installed.
About
This repository tracks the adevs repository at SourceForge
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published