<!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>Custom Protobuf Build — 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/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 src="../../_static/jquery.js"></script> | |
<script src="../../_static/underscore.js"></script> | |
<script src="../../_static/doctools.js"></script> | |
<script src="../../_static/tabs.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 with Conan" href="../60_conan.html" /> | |
<link rel="prev" title="CMake Variables and Options" href="10_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"> | |
0.8.0 | |
</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 Guide</span></p> | |
<ul class="current"> | |
<li class="toctree-l1"><a class="reference internal" href="../10_getting_started.html">Getting Started</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../20_install_prerequisites.html">Installing Prerequisites</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../30_install_openpass.html">Installing OpenPASS</a></li> | |
<li class="toctree-l1 current"><a class="reference internal" href="../50_further_guidance.html">Further Guidance</a><ul class="current"> | |
<li class="toctree-l2"><a class="reference internal" href="10_cmake.html">CMake Variables and Options</a></li> | |
<li class="toctree-l2 current"><a class="current reference internal" href="#">Custom Protobuf Build</a><ul> | |
<li class="toctree-l3"><a class="reference internal" href="#build-and-install-protobuf">Build and Install Protobuf</a></li> | |
<li class="toctree-l3"><a class="reference internal" href="#hook-protobuf-into-osi">Hook Protobuf into OSI</a></li> | |
</ul> | |
</li> | |
</ul> | |
</li> | |
<li class="toctree-l1"><a class="reference internal" href="../60_conan.html">Building with Conan</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_overview.html">Overview</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../../user_guide/20_tutorials.html">Tutorials</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../../user_guide/30_gui_plugins.html">GUI Plugins</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../../user_guide/40_configs_in_depth.html">Configs in Depth</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../../user_guide/50_outputs_in_depth.html">Outputs in Depth</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../../user_guide/60_scenario_simulation.html">Simulator</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/20_simulator_advanced.html">Simulator</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../../advanced_topics/30_testing.html">EndToEnd Test Framework</a></li> | |
</ul> | |
<p class="caption"><span class="caption-text">Developer Information</span></p> | |
<ul> | |
<li class="toctree-l1"><a class="reference internal" href="../../developer_information/10_ide_support.html">IDE Support</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../../developer_information/20_documentation.html">Documentation Concept</a></li> | |
</ul> | |
<p class="caption"><span class="caption-text">Other Information</span></p> | |
<ul> | |
<li class="toctree-l1"><a class="reference internal" href="../../other_information/10_external_dependencies.html">External Dependencies</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../../other_information/20_glossary.html">Glossary</a></li> | |
<li class="toctree-l1"><a class="reference internal" href="../../other_information/30_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> »</li> | |
<li><a href="../50_further_guidance.html">Further Guidance</a> »</li> | |
<li>Custom Protobuf Build</li> | |
<li class="wy-breadcrumbs-aside"> | |
<a href="../../_sources/installation_guide/further_guidance/40_custom_proto.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="custom-protobuf-build"> | |
<span id="building-protobuf"></span><h1>Custom Protobuf Build<a class="headerlink" href="#custom-protobuf-build" title="Permalink to this headline">¶</a></h1> | |
<div class="section" id="build-and-install-protobuf"> | |
<h2>Build and Install Protobuf<a class="headerlink" href="#build-and-install-protobuf" title="Permalink to this headline">¶</a></h2> | |
<p>As Protobuf can be installed easily as binary package in different versions (see <a class="reference internal" href="../20_install_prerequisites.html#binary-packages"><span class="std std-ref">Installing the Binary Packages</span></a>) via appropiate package managing systems, there is no need to build protobuf from source. | |
However, if a custom build is necessary, this section gives instructions, how to compile version 3.11.4. and hook it into the <strong>openPASS</strong> build. | |
Adjust this guide to your needs.</p> | |
<ol class="arabic"> | |
<li><p>Download release 3.11.4 from <a class="reference external" href="https://github.com/protocolbuffers/protobuf/releases">https://github.com/protocolbuffers/protobuf/releases</a></p></li> | |
<li><p>Extract</p> | |
<ul class="simple"> | |
<li><p>for Windows to <code class="docutils literal notranslate"><span class="pre">C:\OpenPASS\thirdParty\sources\protobuf-cpp-3.11.4</span></code></p></li> | |
<li><p>for Linux to <code class="docutils literal notranslate"><span class="pre">~/OpenPASS/thirdParty/sources/protobuf-cpp-3.11.4</span></code></p></li> | |
</ul> | |
</li> | |
<li><p>Navigate to the extracted folder</p> | |
<div class="sphinx-tabs docutils container"> | |
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-0-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-0-0-0" name="0-0" role="tab" tabindex="0">Windows</button><button aria-controls="panel-0-0-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-0-0-1" name="0-1" role="tab" tabindex="-1">Linux</button></div><div aria-labelledby="tab-0-0-0" class="sphinx-tabs-panel" id="panel-0-0-0" name="0-0" role="tabpanel" tabindex="0"><p>Start <code class="docutils literal notranslate"><span class="pre">MinGW</span> <span class="pre">64-bit</span></code> shell</p> | |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">/</span><span class="n">C</span><span class="o">/</span><span class="n">OpenPASS</span><span class="o">/</span><span class="n">thirdParty</span><span class="o">/</span><span class="n">sources</span><span class="o">/</span><span class="n">protobuf</span><span class="o">-</span><span class="n">cpp</span><span class="o">-</span><span class="mf">3.11</span><span class="o">.</span><span class="mi">4</span> | |
</pre></div> | |
</div> | |
</div><div aria-labelledby="tab-0-0-1" class="sphinx-tabs-panel" hidden="true" id="panel-0-0-1" name="0-1" role="tabpanel" tabindex="0"><p>Start <code class="docutils literal notranslate"><span class="pre">Bash</span></code> shell</p> | |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/</span><span class="n">OpenPASS</span><span class="o">/</span><span class="n">thirdParty</span><span class="o">/</span><span class="n">sources</span><span class="o">/</span><span class="n">protobuf</span><span class="o">-</span><span class="n">cpp</span><span class="o">-</span><span class="mf">3.11</span><span class="o">.</span><span class="mi">4</span> | |
</pre></div> | |
</div> | |
</div></div> | |
</li> | |
<li><p>Create build directory</p> | |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="n">cmake</span> | |
<span class="n">mkdir</span> <span class="n">build</span> | |
<span class="n">cd</span> <span class="n">build</span> | |
</pre></div> | |
</div> | |
</li> | |
<li><p>Run Cmake</p> | |
<div class="sphinx-tabs docutils container"> | |
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-1-1-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-1-1-0" name="1-0" role="tab" tabindex="0">Windows</button><button aria-controls="panel-1-1-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-1-1-1" name="1-1" role="tab" tabindex="-1">Linux</button></div><div aria-labelledby="tab-1-1-0" class="sphinx-tabs-panel" id="panel-1-1-0" name="1-0" role="tabpanel" tabindex="0"><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cmake</span> <span class="o">-</span><span class="n">G</span> <span class="s2">"MSYS Makefiles"</span> \ | |
<span class="o">-</span><span class="n">DCMAKE_BUILD_TYPE</span><span class="o">=</span><span class="n">Release</span> \ | |
<span class="o">-</span><span class="n">DCMAKE_INSTALL_PREFIX</span><span class="o">=</span><span class="n">C</span><span class="p">:</span><span class="o">/</span><span class="n">OpenPASS</span><span class="o">/</span><span class="n">thirdParty</span><span class="o">/</span><span class="n">protobuf</span> \ | |
<span class="o">-</span><span class="n">Dprotobuf_BUILD_SHARED_LIBS</span><span class="o">=</span><span class="n">ON</span> \ | |
<span class="o">-</span><span class="n">Dprotobuf_BUILD_TESTS</span><span class="o">=</span><span class="n">OFF</span> \ | |
<span class="hll"> <span class="o">..</span> | |
</span></pre></div> | |
</div> | |
</div><div aria-labelledby="tab-1-1-1" class="sphinx-tabs-panel" hidden="true" id="panel-1-1-1" name="1-1" role="tabpanel" tabindex="0"><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cmake</span> <span class="o">-</span><span class="n">DCMAKE_BUILD_TYPE</span><span class="o">=</span><span class="n">Release</span> \ | |
<span class="o">-</span><span class="n">DCMAKE_INSTALL_PREFIX</span><span class="o">=~/</span><span class="n">OpenPASS</span><span class="o">/</span><span class="n">thirdParty</span><span class="o">/</span><span class="n">protobuf</span> \ | |
<span class="o">-</span><span class="n">Dprotobuf_BUILD_SHARED_LIBS</span><span class="o">=</span><span class="n">ON</span> \ | |
<span class="o">-</span><span class="n">Dprotobuf_BUILD_TESTS</span><span class="o">=</span><span class="n">OFF</span> \ | |
<span class="hll"> <span class="o">..</span> | |
</span></pre></div> | |
</div> | |
</div></div> | |
<div class="admonition note"> | |
<p class="admonition-title">Note</p> | |
<p>Tests are disabled due to compiler warnings treated as errors (may vary with compiler version).</p> | |
</div> | |
</li> | |
<li><p>Compile</p> | |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="o">-</span><span class="n">j3</span> | |
</pre></div> | |
</div> | |
</li> | |
<li><p>Install</p> | |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">install</span> | |
</pre></div> | |
</div> | |
</li> | |
</ol> | |
</div> | |
<div class="section" id="hook-protobuf-into-osi"> | |
<h2>Hook Protobuf into OSI<a class="headerlink" href="#hook-protobuf-into-osi" title="Permalink to this headline">¶</a></h2> | |
<p>If you want to build and install OSI with a custom build of Protobuf, most of the | |
steps can be followed as described in instruction <a class="reference internal" href="../20_install_prerequisites.html#building-osi"><span class="std std-ref">Build and Install OSI</span></a>. However, one | |
step must be added.</p> | |
<p>For all required steps <em>before</em> the following command, see <a class="reference internal" href="../20_install_prerequisites.html#building-osi"><span class="std std-ref">Build and Install OSI</span></a>.</p> | |
<ol class="arabic"> | |
<li><p>Additional <code class="docutils literal notranslate"><span class="pre">CMake</span></code> variables have to be set.</p> | |
<div class="sphinx-tabs docutils container"> | |
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-2-2-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-2-2-0" name="2-0" role="tab" tabindex="0">Windows</button><button aria-controls="panel-2-2-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-2-2-1" name="2-1" role="tab" tabindex="-1">Linux</button></div><div aria-labelledby="tab-2-2-0" class="sphinx-tabs-panel" id="panel-2-2-0" name="2-0" role="tabpanel" tabindex="0"><div class="highlight-default notranslate"><div class="highlight"><pre><span></span>cmake -G “MSYS Makefiles” \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=C:/OpenPASS/thirdParty/osi \ | |
-DPROTOBUF_INCLUDE_DIR=C:/OpenPASS/thirdParty/protobuf/include \ | |
-DPROTOBUF_PROTOC_EXECUTABLE=C:/OpenPASS/thirdParty/protobuf/bin/protoc.exe \ | |
-DPROTOBUF_LIBRARY=C:/OpenPASS/thirdParty/protobuf/lib/libprotobuf.a \ | |
<span class="hll"> .. | |
</span></pre></div> | |
</div> | |
</div><div aria-labelledby="tab-2-2-1" class="sphinx-tabs-panel" hidden="true" id="panel-2-2-1" name="2-1" role="tabpanel" tabindex="0"><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cmake</span> <span class="o">-</span><span class="n">DCMAKE_BUILD_TYPE</span><span class="o">=</span><span class="n">Release</span> \ | |
<span class="o">-</span><span class="n">DCMAKE_INSTALL_PREFIX</span><span class="o">=~/</span><span class="n">OpenPASS</span><span class="o">/</span><span class="n">thirdParty</span><span class="o">/</span><span class="n">osi</span> \ | |
<span class="o">-</span><span class="n">DPROTOBUF_INCLUDE_DIR</span><span class="o">=~/</span><span class="n">OpenPASS</span><span class="o">/</span><span class="n">thirdParty</span><span class="o">/</span><span class="n">protobuf</span><span class="o">/</span><span class="n">include</span> \ | |
<span class="o">-</span><span class="n">DPROTOBUF_PROTOC_EXECUTABLE</span><span class="o">=~/</span><span class="n">OpenPASS</span><span class="o">/</span><span class="n">thirdParty</span><span class="o">/</span><span class="n">protobuf</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">protoc</span> \ | |
<span class="o">-</span><span class="n">DPROTOBUF_LIBRARY</span><span class="o">=~/</span><span class="n">OpenPASS</span><span class="o">/</span><span class="n">thirdParty</span><span class="o">/</span><span class="n">protobuf</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">libprotobuf</span><span class="o">.</span><span class="n">a</span> \ | |
<span class="hll"> <span class="o">..</span> | |
</span></pre></div> | |
</div> | |
</div></div> | |
</li> | |
</ol> | |
<p>For all required steps <em>after</em> this stage, see <a class="reference internal" href="../20_install_prerequisites.html#building-osi"><span class="std std-ref">Build and Install OSI</span></a>.</p> | |
</div> | |
</div> | |
</div> | |
</div> | |
<footer> | |
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> | |
<a href="../60_conan.html" class="btn btn-neutral float-right" title="Building with Conan" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> | |
<a href="10_cmake.html" class="btn btn-neutral float-left" title="CMake Variables and Options" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> | |
</div> | |
<hr/> | |
<div role="contentinfo"> | |
<p> | |
© 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> |