blob: 5fe3957b1a83c43b4c8130511d448bf82cc1947e [file] [log] [blame]
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Building under Windows &mdash; OpenPASS Documentation</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/tabs.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
<link rel="shortcut icon" href="../../../_static/openPASS.ico"/>
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="Building under Linux" href="60_linux.html" />
<link rel="prev" title="Cmake Build Environment" href="40_cmake.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home"> openPASS
<img src="../../../_static/openPASS.png" class="logo" alt="Logo"/>
</a>
<div class="version">
9999.9999.9999
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Installation Guides</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../10_gui_installation_guide.html">GUI Installation Guide</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../20_sim_installation_guide.html">Simulation Installation Guide</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../meta/sphinx.html">Sphinx</a></li>
<li class="toctree-l2"><a class="reference internal" href="10_quickstart.html">Quick Start</a></li>
<li class="toctree-l2"><a class="reference internal" href="20_prerequisites.html">Prerequisites</a></li>
<li class="toctree-l2"><a class="reference internal" href="30_build_prerequisites.html">Building Prerequisites</a></li>
<li class="toctree-l2"><a class="reference internal" href="40_cmake.html">Cmake Build Environment</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Building under Windows</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#msys2">MSYS2</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#download">Download</a></li>
<li class="toctree-l4"><a class="reference internal" href="#installation">Installation</a></li>
<li class="toctree-l4"><a class="reference internal" href="#environments">Environments</a></li>
<li class="toctree-l4"><a class="reference internal" href="#packages">Packages</a></li>
<li class="toctree-l4"><a class="reference internal" href="#building-openpass">Building OpenPASS</a></li>
<li class="toctree-l4"><a class="reference internal" href="#execution">Execution</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="60_linux.html">Building under Linux</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ides/10_vscode.html">Working with VSCode</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ides/20_qt_creator.html">Working with Qt Creator</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../21_pcm_installation_guide.html">PCM Installation Guide</a></li>
</ul>
<p class="caption"><span class="caption-text">User Guides</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../user_guide/10_gui_user_guide.html">GUI User Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../user_guide/20_sim_user_guide.html">Simulation User Guide</a></li>
</ul>
<p class="caption"><span class="caption-text">Advanced topics</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../advanced_topics/10_documentation.html">Documentation Concept</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../advanced_topics/20_simulator_advanced.html">Simulator</a></li>
</ul>
<p class="caption"><span class="caption-text">Other Information</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary.html">Glossary</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../license.html">License</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">openPASS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><a href="../../20_sim_installation_guide.html">Simulation Installation Guide</a> &raquo;</li>
<li>Building under Windows</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/installation_guide/sim_installation_guide/installation/50_windows.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="building-under-windows">
<span id="id1"></span><h1>Building under Windows<a class="headerlink" href="#building-under-windows" title="Permalink to this headline"></a></h1>
<p>To compile <strong>openPASS</strong> with gcc/g++ locally under Windows, <a class="reference internal" href="../../../glossary.html#term-MSYS2"><span class="xref std std-term">MSYS2</span></a> programming tools are recommended.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<div class="line-block">
<div class="line">The windows programming tools suffer from a <cite>path length restriction</cite>.</div>
<div class="line">This error manifests as strange <strong>file not found</strong> compile errors.</div>
</div>
</div>
<div class="admonition-recommendation admonition">
<p class="admonition-title">Recommendation</p>
<div class="line-block">
<div class="line">Use a short path for source code checkout, or map it directly to a drive letter.</div>
<div class="line">This can be done by the windows command <a class="reference external" href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst">subst</a>.</div>
</div>
</div>
<div class="section" id="msys2">
<span id="id2"></span><h2>MSYS2<a class="headerlink" href="#msys2" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">This is a condensed version of the original MSYS2 guide found <a class="reference external" href="https://www.msys2.org/">here</a>.</div>
</div>
<div class="section" id="download">
<h3>Download<a class="headerlink" href="#download" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><p>Latest 64-bit packages are located at <a class="reference external" href="https://repo.msys2.org/distrib/x86_64/">https://repo.msys2.org/distrib/x86_64/</a>.</p></li>
<li><p>Download a non-base package, i.e. <a class="reference external" href="https://repo.msys2.org/distrib/x86_64/msys2-x86_64-20200903.exe">msys2-x86_64-20200903.exe</a></p></li>
</ul>
</div>
<div class="section" id="installation">
<span id="msys2-installation"></span><h3>Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h3>
<p>Run the downloaded executable and adjust suggested settings to your needs (defaults are fine).
In the following, it is assumed that MSYS2 is installed under <code class="docutils literal notranslate"><span class="pre">C:\msys64</span></code>.</p>
</div>
<div class="section" id="environments">
<h3>Environments<a class="headerlink" href="#environments" title="Permalink to this headline"></a></h3>
<p>MSYS2 provides three different environments, located in the MSYS2 installation directory:</p>
<div class="figure align-center" id="id3">
<span id="fig-msys2-environments"></span><img alt="MSYS2 Apps" src="../../../_images/msys2.png" />
<p class="caption"><span class="caption-text">MSYS2 Environments</span><a class="headerlink" href="#id3" title="Permalink to this image"></a></p>
</div>
<ul>
<li><p>MSYS2 MSYS: Common environment, i.e. for package management</p></li>
<li><p>MSYS2 MinGW 32-bit: A MinGW 32-bit environment</p></li>
<li><div class="line-block">
<div class="line">MSYS2 MinGW 64-bit: A MinGW 64-bit environment</div>
<div class="line">This is <strong>the</strong> <strong>openPASS</strong> development environment and will be referred to as <code class="docutils literal notranslate"><span class="pre">MinGW</span> <span class="pre">64-bit</span></code> shell.</div>
</div>
</li>
</ul>
</div>
<div class="section" id="packages">
<span id="msys2-packages"></span><h3>Packages<a class="headerlink" href="#packages" title="Permalink to this headline"></a></h3>
<p>Update and install required packages (see also <a class="reference internal" href="20_prerequisites.html#prerequisites"><span class="std std-ref">Prerequisites</span></a>).</p>
<ol class="arabic">
<li><p>Open <code class="docutils literal notranslate"><span class="pre">MSYS2</span> <span class="pre">MSYS</span></code> and execute the following package manager <code class="docutils literal notranslate"><span class="pre">pacman</span></code> commands to update the package repository and upgrade system packages:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pacman -Syuu
</pre></div>
</div>
<p>If the upgrade requires a restart of MSYS2, resume the upgrade by re-opening the shell and call:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pacman -Suu
</pre></div>
</div>
</li>
<li><p>Required packages (can be specified in single command line if desired):</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pacman -S mingw-w64-x86_64-boost <span class="c1">#1.75.0-2</span>
pacman -S mingw-w64-x86_64-ccache <span class="c1">#3.7.9-1</span>
pacman -S mingw-w64-x86_64-cmake <span class="c1">#3.19.2-1</span>
pacman -S mingw-w64-x86_64-doxygen <span class="c1">#1.8.20-1</span>
pacman -S mingw-w64-x86_64-gcc <span class="c1">#10.2.0-6</span>
pacman -S mingw-w64-x86_64-gdb <span class="c1">#10.1-2</span>
pacman -S mingw-w64-x86_64-graphviz <span class="c1">#2.44.1-3</span>
pacman -S mingw-w64-x86_64-gtest <span class="c1">#1.10.0-1</span>
pacman -S mingw-w64-x86_64-make <span class="c1">#4.3-1</span>
pacman -S mingw-w64-x86_64-protobuf <span class="c1">#3.12.4-1</span>
pacman -S mingw-w64-x86_64-qt5 <span class="c1">#5.15.2-5</span>
</pre></div>
</div>
<div class="admonition-versions admonition">
<p class="admonition-title">Versions</p>
<div class="line-block">
<div class="line">MSYS2 provides rolling release versions, so some packages might be too “up-to-date”.</div>
<div class="line">Tested packages - ate time of writing - have been listed above as comment.</div>
<div class="line">If in doubt, download the package in the right version from the <a class="reference external" href="http://repo.msys2.org/mingw/x86_64/">MSYS2 package repository</a>.</div>
<div class="line">Install with <code class="docutils literal notranslate"><span class="pre">pacman</span> <span class="pre">-U</span> <span class="pre">&lt;package-filename&gt;</span></code></div>
</div>
</div>
</li>
<li><p>Optional Packages</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pacman -S git
pacman -S diffutils
pacman -S patch
pacman -S dos2unix
pacman -S mingw-w64-x86_64-ag
pacman -S mingw-w64-x86_64-qt5-debug
</pre></div>
</div>
</li>
</ol>
<div class="admonition-git-ssh admonition">
<p class="admonition-title">GIT/SSH</p>
<p>The <code class="docutils literal notranslate"><span class="pre">MinGW</span> <span class="pre">64-bit</span></code> shell does not access an already existing git installation or available SSH keys.
Make sure, to update/copy your configuration and credentials within the <code class="docutils literal notranslate"><span class="pre">MinGW</span> <span class="pre">64-bit</span></code> shell before working with git.</p>
</div>
</div>
<div class="section" id="building-openpass">
<h3>Building OpenPASS<a class="headerlink" href="#building-openpass" title="Permalink to this headline"></a></h3>
<p>This snippet shows an example for building the <strong>openPASS</strong> (Open Source) simulation core from within the <code class="docutils literal notranslate"><span class="pre">MinGW</span> <span class="pre">64-bit</span></code> shell.
Refer to <a class="reference internal" href="40_cmake.html#cmake"><span class="std std-ref">Cmake Build Environment</span></a> for details on the arguments.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cmake -G <span class="s2">&quot;MinGW Makefiles&quot;</span> <span class="se">\</span>
-D <span class="nv">CMAKE_BUILD_TYPE</span><span class="o">=</span>Debug <span class="se">\</span>
-D <span class="nv">OPENPASS_ADJUST_OUTPUT</span><span class="o">=</span>OFF <span class="se">\</span>
-D <span class="nv">USE_CCACHE</span><span class="o">=</span>ON <span class="se">\</span>
-D <span class="nv">WITH_DEBUG_POSTFIX</span><span class="o">=</span>OFF <span class="se">\</span>
-D <span class="nv">WITH_GUI</span><span class="o">=</span>OFF <span class="se">\</span>
-D <span class="nv">WITH_PROTOBUF_ARENA</span><span class="o">=</span>ON <span class="se">\</span>
-D <span class="nv">CMAKE_INSTALL_PREFIX</span><span class="o">=</span>C:/OpenPASS/bin/core <span class="se">\</span>
-D <span class="nv">CMAKE_PREFIX_PATH</span><span class="o">=</span><span class="s2">&quot;PATH_FMIL;PATH_BOOST;PATH_OSI;PATH_PROTOBUF;PATH_GTEST&quot;</span> <span class="se">\</span>
..
mingw32-make -j3
mingw32-make install
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The call to mingw32-make might be misleading, but actually calls gcc/g++ 64-bit.</p>
</div>
</div>
<div class="section" id="execution">
<span id="runmingwexe"></span><h3>Execution<a class="headerlink" href="#execution" title="Permalink to this headline"></a></h3>
<p>Files compiled within the <code class="docutils literal notranslate"><span class="pre">MinGW</span> <span class="pre">64-bit</span></code> shell depend on the <a class="reference internal" href="../../../glossary.html#term-MinGW"><span class="xref std std-term">MinGW</span></a> libraries.
Providing this libraries to the executable can be done by following means:</p>
<ul>
<li><p>Execute within the <code class="docutils literal notranslate"><span class="pre">MinGW</span> <span class="pre">64-bit</span></code> shell.</p></li>
<li><p>Add <code class="docutils literal notranslate"><span class="pre">C:\msys64\mingw64\bin</span></code> permanently to the <em>Windows Environment Variable</em> <code class="docutils literal notranslate"><span class="pre">Path</span></code>.</p></li>
<li><p>Temporarily set <code class="docutils literal notranslate"><span class="pre">Path</span></code> prior to the execution, e.g. in a wrapper:</p>
<div class="highlight-batch notranslate"><div class="highlight"><pre><span></span># your_program.cmd
<span class="k">Path</span>=C:\msys64\mingw64\bin;<span class="nv">%Path%</span> # set Path
your_program.exe # execute
</pre></div>
</div>
</li>
<li><div class="line-block">
<div class="line">Copy the required libraries right next to your executable.</div>
<div class="line">For <strong>openPASS</strong>, the following librares are required:</div>
</div>
<ul class="simple">
<li><p>libdouble-conversion.dll</p></li>
<li><p>libgcc_s_seh-1.dll</p></li>
<li><p>libicudt67.dll</p></li>
<li><p>libicuin67.dll</p></li>
<li><p>libicuuc67.dll</p></li>
<li><p>libpcre2-16-0.dll</p></li>
<li><p>libstdc++-6.dll</p></li>
<li><p>libwinpthread-1.dll</p></li>
<li><p>libzstd.dll</p></li>
<li><p>zlib1.dll</p></li>
</ul>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>You might need to update the some libraries manually, when package are upgraded.</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="60_linux.html" class="btn btn-neutral float-right" title="Building under Linux" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="40_cmake.html" class="btn btn-neutral float-left" title="Cmake Build Environment" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; Copyright 2021 OpenPASS Working Group.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>