TWiki
>
Main Web
>
MatiasAlejandroBonaventura
>
TDAQSimulation
>
TDAQSimulationGroupCommunication
>
HowToInstructions
>
PowerDEVSInstallLinux
(2022-03-04,
MatiasAlejandroBonaventura
)
(raw view)
E
dit
A
ttach
P
DF
<h1 align="center"><font face="Calibri Light, serif"><font size="6">PowerDEVS Installation in Linux</font></font></h1> ---++ <font color="#2e74b5"><font face="Calibri Light, serif"><font size="4">Step by Step Installation in SLC (flavor of RedHat /Fedora for CERN)</font></font></font> ---+++ Setup environment You need to install all the PowerDEVS dependencies. <br />You can guide yourself using the [[https://gitlab.cern.ch/tdaq-simulation/powerdevs/-/blob/master/docker/Dockerfile][Dockerfile]] for CentOS7, where all dependencies are installed and the environment is setup. Check in particular the instalation of Scilab and enabling devtoolset-6 <verbatim>yum install -y centos-release-scl epel-release yum install -y make git devtoolset-6 boost-devel valgrind kcachegrind graphviz wget java-openjdk mesa-dri-drivers psmisc python-matplotlib python-devel h5py qt-devel gsl-devel gnuplot hdf5-devel qt-devel</verbatim> <font color="#4f81bd"><font face="Cambria, serif"><font size="3"> _Compile PowerDEVS_ </font></font></font> 1 Clone the repository https://gitlab.cern.ch/tdaq-simulation/powerdevs 1 cd powerdevs 1 make gui; make py2pdevs<br />This will compile the following components: IGUI (pdme, pdppt, etc), engine (simulation core), models (atomics models in /atomics), py2pdevs python bindings (in /src/py2pdevs)<br />If you run `make` or `make all` it might fail as it will attempt also to compile compile a c++ simulation executable, which requires a /build/model.h generated by the IGUI. ---+++ <font color="#4f81bd"><font face="Cambria, serif"><font size="3"> _Running PowerDEVS IGUI_ </font></font></font> PowerDEVS must be executed with the /powerdevs/bin directory set as working directory. The executable is located in the /powerdevs/bin directory, so care must be taken (ej: from console cd /bin, and then ./pdme). In order to compile models with c++11, make sure you have the correct version of g++. It is recommended to install dev-toolset (see below), so powerdevs should be executed as follows to use the right compiler: scl enable devtoolset-2 "/home/mbonaven/gitlab/powerdevs/bin/pdme" ---+++ <font color="#4f81bd"><font face="Cambria, serif"><font size="3"> _Basic example_ </font></font></font> Follow these steps in order to check if the installation is complete and correct: 1 Open a terminal and set the PowerDEVS root folder as working directory: * cd <powerDevsFolder> 1 Compile the lotka_volterra model: <br /> * bin/pdppt examples/continuous/lotka_volterra/lotka_volterra.pdm * open the pdm in the IGUI, click Simulate. It will first compile (output/model executable) and open a window to simulate. You can simulate from that window, or from command line as describe below. 1 This should produce a standalone executable ready to simulate the model. Execute it as follows: * cd output * ./model -tf 300 1 The execution should end with a plot like the one shown below: <img alt="lotka_volterra.png" src="%ATTACHURL%/lotka_volterra.png" /> ---+++ <font color="#4f81bd"><font face="Cambria, serif"><font size="3"> _Basic example in py2pdevs (for advanced users or developers)_ </font></font></font> This section documents how to run the basic example shown before using the =py2pdevs= [[py2pdevs][interface]]. You can safely skip this if you are not planning to develop models using Python. Using your preferred text editor, open a new file called =lotka.py= (inside the =build/lib= directory) and enter the following lines: <verbatim> import py2pdevs.core as core import py2pdevs.params as params def lotka(): params.parse_options() model = core.new_model(0, 'lotka_volterra') multiplier0 = model.create_qss_multiplier(model.top(), 'Multiplier 0', ['Purely static', 1e-6, 1e-3]) integrator0 = model.create_qss_integrator(model.top(), 'QSS Integrator 0', ['QSS3', 1e-6, 1e-3, 0.5]) integrator1 = model.create_qss_integrator(model.top(), 'QSS Integrator 1', ['QSS3', 1e-6, 1e-3, 0.5]) wsum0 = model.create_qss_wsum(model.top(), 'WSum 0', [0.1,-0.1,0,0,0,0,0,0,2]) wsum1 = model.create_qss_wsum(model.top(), 'WSum 1', [0.1,-0.1,0,0,0,0,0,0,2]) gnuplot0 = model.create_gnuplot(model.top(), 'GnuPlot 0', ['2',"set xrange [0:%tf] @ set grid @ set title 'Lotka Volterra Model'","with lines title 'Preys'","with lines title 'Predators'","","",""]) model.connect_models(wsum0, 0, integrator0, 0) model.connect_models(wsum1, 0, integrator1, 0) model.connect_models(multiplier0, 0, wsum1, 0) model.connect_models(multiplier0, 0, wsum0, 1) model.connect_models(integrator0, 0, gnuplot0, 0) model.connect_models(integrator0, 0, multiplier0, 0) model.connect_models(integrator0, 0, wsum0, 0) model.connect_models(integrator1, 0, gnuplot0, 1) model.connect_models(integrator1, 0, multiplier0, 1) model.connect_models(integrator1, 0, wsum1, 1) model.run() if __name__ == '__main__': lotka()</verbatim> Although we won't go into the details, here is a brief description of what is going on here: * The first two lines import the main =py2pdevs= modules: =core=, which provides the actual interface to the PowerDEVS engine, and =params=, a utility module that reads command-line arguments and supplies them along with other user-defined parameters to PowerDEVS. * Function =lotka= defines and runs the model, starting first with command-line parsing through the =params= module. * The last two lines simply define the main behavior of the script, which is given by the =lotka= function. Once your script is saved, you can run it issuing the following command: * =python lotka.py -tf 300= Notice the same syntax of the command-line arguments. If everything goes OK, you should get the same plot shown in the previous section. ---++++ Installation in SLC6 Server To run a simulation as a batch program PowerDEVS does not need to be installed in the machine as long as the simulation executable accesible (the output/<i>model</i> executable file). Nevertheless scilab needs to be installed and necesary libraries: * <p>sudo yum install gsl gsl-devel</p> * <p>sudo yum install libXScrnSaver</p> maybe java need to be installed too. <br /><br /> ---+ ---++++ Installation in SLC6 Server Cloud Intrastrucuture <br /><br /> To run a simulation as a batch program PowerDEVS does not need to be installed in the machine as long as the simulation executable accesible (the output/<i>model</i> executable file). Nevertheless scilab needs to be <br /><br /> <font color="#4f81bd"><font face="Cambria, serif"><font size="3"> _Install X Display_ </font></font></font> <br /><br /> - sudo yum groupinstall 'X Window System' <br /><br /> <font color="#4f81bd"><font face="Cambria, serif"><font size="3"> _Install Scilab_ </font></font></font> from here: <u> http://wiki.scilab.org/howto/install/linux </u> <a name="__DdeLink__424_1579196801"></a><code>Scilab Version 5.5.0 does not work with SLC6 because it needs GLIBC_2.14 (SLC6 uses GLIBC_2.12)</code> <pre><code><font size='2'>[$SHELL] wget http://www.scilab.org/download/5.4.1/scilab-5.4.1.bin.linux-x86_64.tar.gz </font></code> </pre> <font size="2">[$SHELL] cd <scilab-path></font><font size="2">[$SHELL] tar xzvf </font> <pre><code><font size='2'>scilab-5.4.1.bin.linux-x86_64.tar.gz</font></code></pre> <font size="2"> # For 64 bits systems</font><font size="2">[$SHELL] cd <scilab-path>/scilab-5.4.1</font> <pre><a name='line-2-2'></a></pre> <font size="2">[$SHELL] ./bin/scilab </font><font size="2"> *(this won't work as no display is available)* </font> <pre><br /><br /> </pre> <font color="#4f81bd"><font face="Cambria, serif"><font size="3"> _Load Scilab Backdoor module_ </font></font></font> - Follow Moving Powerdevs out home directory - in builder.sce <font size="2">// Action</font><font size="2">// ========================================</font><font size="2">tbx_builder_macros(toolbox_dir);</font><font size="2">tbx_builder_src(toolbox_dir);</font><font size="2">tbx_builder_gateway(toolbox_dir);</font><font size="2"><b>//tbx_builder_help(toolbox_dir);</b></font><font size="2">tbx_build_loader(TOOLBOX_NAME, toolbox_dir);</font><font size="2">tbx_build_cleaner(TOOLBOX_NAME, toolbox_dir);</font> <pre><br /><br /> </pre> <font size="2">- To execute scilab in command line mode use:</font><font size="2"><b> scilab-5.4.1/bin/scilab -nwni -f ../powerdevs-code/bin/loadBackDoor.sce</b></font> <font size="2">or use the </font><font size="2"> *<powerDEVS>/bin/startScilabCommandLine.sh* </font><font size="2"> script</font> <br /><br /> <font color="#4f81bd"><font face="Cambria, serif"><font size="3"> _Install GSL_ </font></font></font> - sudo yum install gsl <br /><br /> <font color="#4f81bd"><font face="Cambria, serif"><font size="3"> _Installing Libraries_ </font></font></font> <br /><br /> <br /><br /> * <p>sudo yum install glibc.i686 alsa-lib.i686 libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686</p> * <p><a name="__DdeLink__417_418540528"></a>sudo yum install libXScrnSaver</p> * <p>sudo yum install libxsss</p> sudo yum install alsa-lib.i686 dbus-libs.i686 e2fsprogs-libs.i686 expat.i686 fontconfig.i686 freetype.i686 glib2.i686 glibc.i686 keyutils-libs.i686 krb5-libs.i686 libcap.i686 libgcc.i686 libICE.i686 libpng.i686 libselinux.i686 libSM.i686 libstdc++.i686 libX11.i686 libXau.i686 libxcb.i686 libXcursor.i686 libXdmcp.i686 libXext.i686 libXfixes.i686 libXi.i686 libXinerama.i686 libXrandr.i686 libXrender.i686 libXScrnSaver.i686 libXv.i686 openssl.i686 qt.i686 qt-x11.i686 zlib.i686 <p align="center"><br /><br /></p> <p align="center"><br /><br /></p> ---+ <font color="#4f81bd"><font face="Cambria, serif"><i><b>Step by Step Installation in Ubuntu</b></i></font></font><font color="#2e74b5"><font face="Calibri Light, serif"><font size="4"><br /></font></font></font> ---+ ---+ <br /><font color="#222222"><font face="Arial, serif"><font size="2">You can guide yourself using the [[https://gitlab.cern.ch/tdaq-simulation/powerdevs/-/blob/master/docker/Dockerfile][Dockerfile]] for CentOS7, converting 'yum' calls to 'apt-get' (name of libraries need to change as well). Check in particular the instalation of Scilab and enabling devtoolset-6</font></font></font> ---+ <font color="#222222"><font face="Arial, serif"><font size="2"><br />- Install GSL (for doing this I recommend you to follow this [[http://www.cnblogs.com/emanlee/p/3318337.html][link]])<br /> - sudo apt-get install gsl-bin libgsl0-dev<br /><br />- use /engine/makefile.include as attached. Contains the following lines (in </font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><b>bold </b></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2">things I changed):<br /> ifeq ($(UNAME), Linux)<br /> ..<br /> CXXFLAGS = -Wall $(OPTFLAGS) </font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"> *-DO_BINARY=0* </font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"> <br /> ..<br /></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><b> GSLLIB = /usr/lib<br /> GSLINC = /usr/include/gsl<br /></b></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"> LIBS = -lsimpd -lgsl </font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><b>-L$(GSLLIB)</b></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><br /> ..<br /> INCLUDES = -I$(SRCENGINE) -I$(ATOMICS) -I$(BUILD) -L$(BUILDLIB)</font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><b> -I$(GSLINC) -lgslcblas</b></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><br /><br />- add PDNL models to Atomic folder (sinks, hybrid and examples folder).</font></font></font> An important thing to remark: Don't use the boost library which is located in afs!. This library was though for a CENTOS O.S., since you are in ubuntus it will not work. You should download the boost library for ubuntu, and then modify the places where BOOST is included in Makefile.include to the new place where boost was installed (it's probably that some of the libs that the makefile is including are also deprecated, for example the -mt suffix has been removed. The installed Boost libraries are multi-threading safe now). If you have a wrong boost library, this will be showed when you try to build your model!. <font color="#222222"> <font face="Arial, serif"><font size="2"><br />- If you get this compilation error: "</font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><i>open with O_CREAT in second argument needs 3 arguments</i></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2">"</font></font></font> <font color="#222222"> <font face="Arial, serif"><font size="2">- It might be related to a bug in gcc version.</font></font></font> ---+ <font color="#222222"> <font face="Arial, serif"><font size="2">- Change lines 18 and 20 of file hybrids/logtoscilabtool.cpp adding the 3rd argunemt with value 0666 as follows:</font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><br /></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"> if (getOs()==WINDOWS) </font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><br /></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"> FOutHandler = open(FName, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666 ); </font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><br /></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"> else </font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"><br /></font></font></font><font color="#222222"><font face="Arial, serif"><font size="2"> FOutHandler = open(FName, O_WRONLY | O_CREAT | O_TRUNC, 0666);</font></font></font> -- Main.MatiasAlejandroBonaventura - 2016-04-07 You can guide yourself using the [[https://gitlab.cern.ch/tdaq-simulation/powerdevs/-/blob/master/docker/Dockerfile][Dockerfile]] for CentOS7, where all dependencies are installed and the environment is setup. Check in particular the instalation of Scilab and enabling devtoolset-6
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
png
lotka_volterra.png
r1
manage
42.4 K
2018-08-10 - 11:55
LucioEmilioSanti
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r16
<
r15
<
r14
<
r13
<
r12
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r16 - 2022-03-04
-
MatiasAlejandroBonaventura
Log In
Main
Home
Index
Search
User Search
Changes
Notifications
RSS Feed
Documentation
Support
Webs
Main
Main Archive
Plugins
Sandbox for tests
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
Altair
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Welcome Guest
Login
or
Register
Cern Search
TWiki Search
Google Search
Main
All webs
Copyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback