Packages

= Packages =

Packages in VLE are autonomous project which regroup source code of DEVS models, VPZ files, documentations and datas. The goal of the packages in VLE are to propose an easily aspect to develop big models and share models between modeler. Package are introduced in VLE 0.8.

VLE 1.1 package update
Since VLE 1.0, packages can now provide shared libraries and plug-ins instead of only plug-ins. Shared libraries must be installed into the 'lib' directory of packages, plug-ins are installed into the 'plugins/simulators' directory.

If you have already developed a package you need to :

1. Update the install directory of your simulators. For example, in your src/CMakeLists.txt file, you need to change the line: With:

2. Update all your dynamics element in VPZ. With VLE 1.0 the attribute model is not use, you need to remove it and build on plug-ins per class.

To establish a link with an another package, you need to apply several modifications of yours packages.

The script will assign:
 * add a 'cmake' directory and copy the latest version of the VleCheckPackage.cmake scripts
 * add the following line into the root CMakeLists.txt:
 * add the detection of the package you want (always in the root CMakelist.txt):
 * Xxx_FOUND to '1' of the package is founded in VLE_HOME.
 * Xxx_INCLUDE_DIRS to VLE_HOME/pkgs/package/src
 * Xxx_LIBRARIES to the list of file founded into the VLE_HOME/pkgs/package/lib/ directory.

Home of VLE
The home directory of VLE is defined by the environment variable VLE_HOME. If the environment variable is not defined, VLE use the default path:
 * $HOME/.vle on Unix/Linux systems (eg. /home/user/.vle</tt>).
 * $HOME/vle</tt> on Win32 systems which corresponds to the variables: %HOMEDRIVE%%HOMEPATH%\vle</tt> (eg. c:\\documents and settings\\user\\vle</tt>).

The home directory of VLE have the following hierarchy:

$VLE_HOME ├─ pkgs          ; the directory of VLE's packages │  └─ firemanqss ; an example of paquet: firemanqss. │      ├─ build  ; One directory per package. │      ├─ data │      ├─ doc │      ├─ exp │      ├─ lib │      └─ src └─ vle.log       ; log of previous execution of VLE

If you wan to use packages with VLE, GVLE etc. you need to copy or link the directory into the $VLE_HOME/pkgs</tt> directory. For example, on Linux/Unix systems:

Hierarchy of the package
A package or project in VLE have several directory and sub-directory. Each file and directory are important. The following description is a default package in provide in VLE:

$VLE_HOME/pkgs/firemanqss ├─ build         ; the compilation directory (temporary directory) ├─ cmake         ; cmake scripts ├─ data          ; data of your package ├─ doc           ; documentation of your package ├─ exp           ; experience, ie. vpz, of your package ├─ lib           ; shared library directory (shared between packages) (temporary directory) ├─ plugins       ; simulators, modeling plugins ├─ src           ; models' sources of your package ├─ Authors.txt   ; authors of your package ├─ License.txt   ; license of your package ├─ News.txt      ; news about evolution of your package ├─ Readme.txt    ; some notes about your package └─ CMakeList.txt ; a CMake script

Howto use VLE with packagesUtilisation de VLE avec un projet
The key, in command line interface:

vle -P name_of_the_directory [command] files ....

Commands are:
 * create</tt> to build a new package in the VLE_HOME/pkgs</tt>
 * configure</tt> try to run the CMake program in your package.
 * build</tt> try to compile your package.
 * test</tt> try the unit test of your package if they exist.
 * packages</tt> try to build source and binary Zip of your package.
 * depends</tt> show the depends of your packages.
 * list</tt> lists all Vpz and plugins of your packages.

cd $VLE_HOME/pkgs/firemanqss mkdir build cmake -DCMAKE_INSTALL_PREFIX=$VLE_HOME/pkgs/firemanqss -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
 * vle -P firemanqss configure
 * execute in the build directory, the cmake command.
 * this command is equivalent to:

cd $VLE_HOME/pkgs/firemanqss/build make all cd $VLE_HOME/pkgs/firemanqss/build/src make install
 * vle -P firemanqss build
 * execute in the build directory, the make command.
 * execute in the src, the make install command.
 * this command is equivalent to:

ls -1 $VLE_HOME/pkgs/firemanqss/lib/*.so ls -1 $VLE_HOME/pkgs/firemanqss/exp/*.vpz
 * vle -P firemanqss list
 * this command is equivalent to:

cd $VLE_HOME/pkgs/firemanqss/build make package package_source
 * vle --package firemanqss package
 * build a source and binary zip file into the build directory.
 * this command is equivalent to:

vle --package firemanqss firemanqss.vpz vle --package firemanqss firemanqss.vpz firemanqss2.vpz vle -m -o 4 --package firemanqss firemanqss.vpz
 * vle -P firemanqss firemanqss.vpz
 * Execute the simulation
 * Execute the manager into 4 threads

Création de paquets sources et binaires

 * La création des paquets sources et binaires est à la charge du programme CPack. Le but de ces paquets est double :
 * Fournir un moyen simple de s'échanger des modèles ;
 * Préparer la plate-forme VLE à disposer d'un dépôt de modèles.

Notes API

 * We provide, in the vle::devs::Dynamics</tt> class, a set of functions to access files in the current package or in external package.
 * Example: