PackagesFrom VLE
PackagesPackages 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 updateSince 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: INSTALL(xxx MODULE lib RUNTIME lib ARCHIVE lib) With: INSTALL(xxx MODULE plugins/simulator RUNTIME plugins/simulator ARCHIVE plugins/simulator) 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.
FindPackage(VleCheckPackage REQUIRED)
VleCheckPackage(Xxx package) The script will assign:
Home of VLEThe home directory of VLE is defined by the environment variable VLE_HOME. If the environment variable is not defined, VLE use the default path:
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 directory. For example, on Linux/Unix systems: # We have the source of the package in the </tt>$HOME/git</tt> directory: cd $HOME/git git clone git://www.vle-project.org/git/firemanqss.git # We link the directory of the package into the $VLE_HOME/pkgs directory: cd $VLE_HOME/pkgs ln -s $HOME/git/firemanqss Hierarchy of the packageA 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 projetThe key, in command line interface: vle -P name_of_the_directory [command] files .... Commands are:
cd $VLE_HOME/pkgs/firemanqss mkdir build cmake -DCMAKE_INSTALL_PREFIX=$VLE_HOME/pkgs/firemanqss -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
cd $VLE_HOME/pkgs/firemanqss/build make all cd $VLE_HOME/pkgs/firemanqss/build/src make install
ls -1 $VLE_HOME/pkgs/firemanqss/lib/*.so ls -1 $VLE_HOME/pkgs/firemanqss/exp/*.vpz
cd $VLE_HOME/pkgs/firemanqss/build make package package_source
vle --package firemanqss firemanqss.vpz vle --package firemanqss firemanqss.vpz firemanqss2.vpz
vle -m -o 4 --package firemanqss firemanqss.vpz Création de paquets sources et binaires
Notes API
std::string getPackageDir() const; std::string getPackageLibDir() const; std::string getPackageSrcDir() const; std::string getPackageDataDir() const; std::string getPackageDocDir() const; std::string getPackageExpDir() const; std::string getPackageBuildDir() const; std::string getPackageFile(const std::string& name) const; std::string getPackageLibFile(const std::string& name) const; std::string getPackageSrcFile(const std::string& name) const; std::string getPackageDataFile(const std::string& name) const; std::string getPackageDocFile(const std::string& name) const; std::string getPackageExpFile(const std::string& name) const; std::string getExternalPackageDir() const; std::string getExternalPackageLibDir() const; std::string getExternalPackageSrcDir() const; std::string getExternalPackageDataDir() const; std::string getExternalPackageDocDir() const; std::string getExternalPackageExpDir() const; std::string getExternalPackageBuildDir() const; std::string getExternalPackageFile(const std::string& name) const; std::string getExternalPackageLibFile(const std::string& name) const; std::string getExternalPackageSrcFile(const std::string& name) const; std::string getExternalPackageDataFile(const std::string& name) const; std::string getExternalPackageDocFile(const std::string& name) const; std::string getExternalPackageExpFile(const std::string& name) const;
// To get the complete path of the current package getPackageDataDir(); // returns "$VLE_HOME/pkgs/<name>/data" // To get a file in the data directory of the current package: getPackageDataFile("file.dat"); // returns "$VLE_HOME/pkgs/<name>/data/file.dat" |