installation.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Installation &#8212; Modelverse 0.4.0 documentation</title>
  7. <link rel="stylesheet" href="_static/classic.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: './',
  12. VERSION: '0.4.0',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/underscore.js"></script>
  20. <script type="text/javascript" src="_static/doctools.js"></script>
  21. <link rel="top" title="Modelverse 0.4.0 documentation" href="index.html" />
  22. <link rel="next" title="Modelverse components" href="components.html" />
  23. <link rel="prev" title="Welcome to Modelverse’s documentation!" href="index.html" />
  24. </head>
  25. <body role="document">
  26. <div class="related" role="navigation" aria-label="related navigation">
  27. <h3>Navigation</h3>
  28. <ul>
  29. <li class="right" style="margin-right: 10px">
  30. <a href="genindex.html" title="General Index"
  31. accesskey="I">index</a></li>
  32. <li class="right" >
  33. <a href="components.html" title="Modelverse components"
  34. accesskey="N">next</a> |</li>
  35. <li class="right" >
  36. <a href="index.html" title="Welcome to Modelverse’s documentation!"
  37. accesskey="P">previous</a> |</li>
  38. <li class="nav-item nav-item-0"><a href="index.html">Modelverse 0.4.0 documentation</a> &#187;</li>
  39. </ul>
  40. </div>
  41. <div class="document">
  42. <div class="documentwrapper">
  43. <div class="bodywrapper">
  44. <div class="body" role="main">
  45. <div class="section" id="installation">
  46. <h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
  47. <div class="section" id="dependencies">
  48. <h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline">¶</a></h2>
  49. <p>The Modelverse reference implementation is relatively dependency-free.
  50. As its code is written in Python 2, a working Python 2.7 interpreter is necessary.</p>
  51. <p>To run the tests, this interpreter needs to have the <a class="reference external" href="http://docs.pytest.org/en/latest/">pytest</a> module installed.</p>
  52. <p>To run the statecharts, the <a class="reference external" href="https://msdl.uantwerpen.be/git/simon/SCCD">SCCD</a> module needs to be installed.</p>
  53. </div>
  54. <div class="section" id="id1">
  55. <h2>Installation<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
  56. <p>The Modelverse is merely a set of scripts, and there is no real installation present.
  57. As such, you will only have to download the source code and are ready to use the Modelverse.</p>
  58. <ol class="arabic" start="0">
  59. <li><p class="first">Install dependencies.</p>
  60. </li>
  61. <li><p class="first">Download the <a class="reference external" href="https://msdl.uantwerpen.be/git/yentl/modelverse">Modelverse source code</a>.
  62. For example using git:</p>
  63. <div class="highlight-default"><div class="highlight"><pre><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">msdl</span><span class="o">.</span><span class="n">uantwerpen</span><span class="o">.</span><span class="n">be</span><span class="o">/</span><span class="n">git</span><span class="o">/</span><span class="n">yentl</span><span class="o">/</span><span class="n">modelverse</span>
  64. </pre></div>
  65. </div>
  66. <p>Or using your favorite HTTP download tool:</p>
  67. <div class="highlight-default"><div class="highlight"><pre><span class="n">wget</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">msdl</span><span class="o">.</span><span class="n">uantwerpen</span><span class="o">.</span><span class="n">be</span><span class="o">/</span><span class="n">git</span><span class="o">/</span><span class="n">yentl</span><span class="o">/</span><span class="n">modelverse</span><span class="o">/</span><span class="n">archive</span><span class="o">/</span><span class="n">master</span><span class="o">.</span><span class="n">zip</span>
  68. <span class="n">unzip</span> <span class="n">master</span><span class="o">.</span><span class="n">zip</span>
  69. </pre></div>
  70. </div>
  71. </li>
  72. <li><p class="first">That&#8217;s it! You can now run the scripts in the <em>scripts/</em> directory using Python.</p>
  73. </li>
  74. </ol>
  75. </div>
  76. <div class="section" id="tests">
  77. <h2>Tests<a class="headerlink" href="#tests" title="Permalink to this headline">¶</a></h2>
  78. <p>To make sure that everything is working correctly, you can execute the tests with the script <em>scripts/run_tests.sh</em>.
  79. This test file will execute tests in parallel, using as many cores as it can.
  80. Nonetheless, total execution time is still rather slow (e.g., 1200 seconds on a i5-4570 using PyPy).</p>
  81. <p>Executing the tests is as simple as the following command:</p>
  82. <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">run_tests</span><span class="o">.</span><span class="n">py</span>
  83. </pre></div>
  84. </div>
  85. <p>This will run a set of tests for all different projects.</p>
  86. <div class="section" id="pypy">
  87. <h3>PyPy<a class="headerlink" href="#pypy" title="Permalink to this headline">¶</a></h3>
  88. <p>The default way of executing tests is probably through CPython.
  89. Note, however, that CPython is a very slow implementation of Python, which makes everything in the Modelverse slower.
  90. While it is not impossible to use CPython, using PyPy is highly recommended at the moment!
  91. Nonetheless, PyPy is often not the default interpretter present on the system.
  92. You will therefore have to explicitly give control to PyPy instead of CPython.</p>
  93. <p>This is fairly simple: all scripts in <em>scripts/</em> execute their subprocesses using the Python interpreter used to start the script.
  94. As such, the following command suffices to execute the Modelverse tests using PyPy:</p>
  95. <div class="highlight-default"><div class="highlight"><pre><span class="n">pypy</span> <span class="n">scripts</span><span class="o">/</span><span class="n">run_tests</span><span class="o">.</span><span class="n">py</span>
  96. </pre></div>
  97. </div>
  98. <p>The problem, however, is that all modules need to be readily installed on PyPy.
  99. For SCCD, you can simply install it using PyPy instead of CPython.
  100. For pytest, you also need to install all of pytest&#8217;s dependencies.
  101. The easiest way to do this is through <em>pip</em>, which you also have to install first:</p>
  102. <div class="highlight-default"><div class="highlight"><pre><span class="n">wget</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">bootstrap</span><span class="o">.</span><span class="n">pypa</span><span class="o">.</span><span class="n">io</span><span class="o">/</span><span class="n">get</span><span class="o">-</span><span class="n">pip</span><span class="o">.</span><span class="n">py</span>
  103. <span class="n">pypy</span> <span class="n">get</span><span class="o">-</span><span class="n">pip</span><span class="o">.</span><span class="n">py</span> <span class="o">--</span><span class="n">user</span>
  104. <span class="n">pypy</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="n">pytest</span> <span class="o">--</span><span class="n">user</span>
  105. </pre></div>
  106. </div>
  107. <p>Afterwards, you can simply run:</p>
  108. <div class="highlight-default"><div class="highlight"><pre><span class="n">pypy</span> <span class="n">scripts</span><span class="o">/</span><span class="n">run_tests</span><span class="o">.</span><span class="n">py</span>
  109. </pre></div>
  110. </div>
  111. <p>To execute the tests using PyPy.</p>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  119. <div class="sphinxsidebarwrapper">
  120. <h3><a href="index.html">Table Of Contents</a></h3>
  121. <ul>
  122. <li><a class="reference internal" href="#">Installation</a><ul>
  123. <li><a class="reference internal" href="#dependencies">Dependencies</a></li>
  124. <li><a class="reference internal" href="#id1">Installation</a></li>
  125. <li><a class="reference internal" href="#tests">Tests</a><ul>
  126. <li><a class="reference internal" href="#pypy">PyPy</a></li>
  127. </ul>
  128. </li>
  129. </ul>
  130. </li>
  131. </ul>
  132. <h4>Previous topic</h4>
  133. <p class="topless"><a href="index.html"
  134. title="previous chapter">Welcome to Modelverse&#8217;s documentation!</a></p>
  135. <h4>Next topic</h4>
  136. <p class="topless"><a href="components.html"
  137. title="next chapter">Modelverse components</a></p>
  138. <div role="note" aria-label="source link">
  139. <h3>This Page</h3>
  140. <ul class="this-page-menu">
  141. <li><a href="_sources/installation.txt"
  142. rel="nofollow">Show Source</a></li>
  143. </ul>
  144. </div>
  145. <div id="searchbox" style="display: none" role="search">
  146. <h3>Quick search</h3>
  147. <form class="search" action="search.html" method="get">
  148. <div><input type="text" name="q" /></div>
  149. <div><input type="submit" value="Go" /></div>
  150. <input type="hidden" name="check_keywords" value="yes" />
  151. <input type="hidden" name="area" value="default" />
  152. </form>
  153. </div>
  154. <script type="text/javascript">$('#searchbox').show(0);</script>
  155. </div>
  156. </div>
  157. <div class="clearer"></div>
  158. </div>
  159. <div class="related" role="navigation" aria-label="related navigation">
  160. <h3>Navigation</h3>
  161. <ul>
  162. <li class="right" style="margin-right: 10px">
  163. <a href="genindex.html" title="General Index"
  164. >index</a></li>
  165. <li class="right" >
  166. <a href="components.html" title="Modelverse components"
  167. >next</a> |</li>
  168. <li class="right" >
  169. <a href="index.html" title="Welcome to Modelverse’s documentation!"
  170. >previous</a> |</li>
  171. <li class="nav-item nav-item-0"><a href="index.html">Modelverse 0.4.0 documentation</a> &#187;</li>
  172. </ul>
  173. </div>
  174. <div class="footer" role="contentinfo">
  175. &#169; Copyright 2016, Yentl Van Tendeloo.
  176. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
  177. </div>
  178. </body>
  179. </html>