You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><p><aclass="reference internal" href="#building-with-clion" id="id5">Building with CLion</a></p></li>
114
+
<li><p><aclass="reference internal" href="#debugging-with-clion" id="id6">Debugging with CLion</a></p></li>
111
115
</ul>
112
116
</nav>
113
117
<sectionid="installing-clion">
@@ -188,9 +192,20 @@ <h2><a class="toc-backref" href="#id3" role="doc-backlink">Setup for a CLion Bui
188
192
<li><p>Set the build directory to the <codeclass="docutils literal notranslate"><spanclass="pre">build</span></code> directory if it is not the default (you’ll need to use the full path if its outside the source directory)</p></li>
189
193
<li><p>The configurations drop-down at the top should show all of the build targets. If not, the CMake project is probably not loaded. Go to <codeclass="docutils literal notranslate"><spanclass="pre">File</span><spanclass="pre">></span><spanclass="pre">Reload</span><spanclass="pre">CMake</span><spanclass="pre">Project</span></code>. The configurations should be populated</p></li>
190
194
</ol>
195
+
<sectionid="additional-build-configuration">
196
+
<h3><aclass="toc-backref" href="#id4" role="doc-backlink">Additional Build Configuration</a><aclass="headerlink" href="#additional-build-configuration" title="Link to this heading">¶</a></h3>
197
+
<p>This (optional) additional configuration allows one to start Clion from the JetBrains Toolbox or
198
+
from a terminal without having to activate the conda environment in the terminal.
199
+
This is useful when you’re working on both Mantid and other projects in CLion simultaneously.</p>
200
+
<olclass="arabic simple">
201
+
<li><p>Navigate to <codeclass="docutils literal notranslate"><spanclass="pre">File</span><spanclass="pre">></span><spanclass="pre">Settings</span><spanclass="pre">></span><spanclass="pre">Build,</span><spanclass="pre">Execution,</span><spanclass="pre">Deployment</span><spanclass="pre">></span><spanclass="pre">CMake</span></code></p></li>
202
+
<li><p>Under <codeclass="docutils literal notranslate"><spanclass="pre">environment</span></code>, add new environment variable <codeclass="docutils literal notranslate"><spanclass="pre">CONDA_PREFIX</span></code> with value <codeclass="docutils literal notranslate"><spanclass="pre">/path/to/mambaforge/envs/mantid-developer</span></code>.</p></li>
203
+
<li><p>Navigate to <codeclass="docutils literal notranslate"><spanclass="pre">File</span><spanclass="pre">></span><spanclass="pre">Settings</span><spanclass="pre">></span><spanclass="pre">Build,</span><spanclass="pre">Execution,</span><spanclass="pre">Deployment</span><spanclass="pre">></span><spanclass="pre">Python</span><spanclass="pre">Interpreter</span><spanclass="pre">></span><spanclass="pre">Add</span><spanclass="pre">Interpreter</span><spanclass="pre">></span><spanclass="pre">Add</span><spanclass="pre">Local</span><spanclass="pre">Interpreter</span><spanclass="pre">></span><spanclass="pre">Conda</span><spanclass="pre">Environment</span><spanclass="pre">></span><spanclass="pre">Use</span><spanclass="pre">existing</span><spanclass="pre">environment</span></code>, then select <codeclass="docutils literal notranslate"><spanclass="pre">mantid-developer</span></code>.</p></li>
204
+
</ol>
205
+
</section>
191
206
</section>
192
207
<sectionid="building-with-clion">
193
-
<h2><aclass="toc-backref" href="#id4" role="doc-backlink">Building with CLion</a><aclass="headerlink" href="#building-with-clion" title="Link to this heading">¶</a></h2>
208
+
<h2><aclass="toc-backref" href="#id5" role="doc-backlink">Building with CLion</a><aclass="headerlink" href="#building-with-clion" title="Link to this heading">¶</a></h2>
194
209
<ulclass="simple">
195
210
<li><p>To build all targets, navigate to <codeclass="docutils literal notranslate"><spanclass="pre">Build</span><spanclass="pre">></span><spanclass="pre">Build</span><spanclass="pre">All</span><spanclass="pre">in</span><spanclass="pre">'Debug'</span></code>. Check that the build command displayed in the Messages window is running the correct cmake executable from your conda installation.</p></li>
196
211
<li><p>To build a specific target, select it in the configurations drop-down menu and click the hammer icon next to it.</p></li>
@@ -210,24 +225,34 @@ <h2><a class="toc-backref" href="#id4" role="doc-backlink">Building with CLion</
210
225
</ol>
211
226
</section>
212
227
<sectionid="debugging-with-clion">
213
-
<h2><aclass="toc-backref" href="#id5" role="doc-backlink">Debugging with CLion</a><aclass="headerlink" href="#debugging-with-clion" title="Link to this heading">¶</a></h2>
228
+
<h2><aclass="toc-backref" href="#id6" role="doc-backlink">Debugging with CLion</a><aclass="headerlink" href="#debugging-with-clion" title="Link to this heading">¶</a></h2>
214
229
<p>To debug workbench, you’ll need to edit the <codeclass="docutils literal notranslate"><spanclass="pre">workbench</span></code> CMake Application configuration.</p>
215
230
<olclass="arabic">
216
-
<li><p>Set the executable to be the <codeclass="docutils literal notranslate"><spanclass="pre">python.exe</span></code> in your conda installation</p>
231
+
<li><p>Set the executable to be the <codeclass="docutils literal notranslate"><spanclass="pre">python</span></code>executable in your conda installation:</p>
<li><p>On Linux & macOS: <codeclass="docutils literal notranslate"><spanclass="pre">/path/to/mambaforge/envs/mantid-developer/bin/python</span></code></p></li>
<li><p>Set the working directory to be the full path to your <codeclass="docutils literal notranslate"><spanclass="pre">build/bin</span></code> directory</p></li>
231
256
</ol>
232
257
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">--single-process</span></code> flag is necessary for debugging. See the <aclass="reference internal" href="Workbench/RunningWorkbench.html#runningworkbench"><spanclass="std std-ref">Running Workbench</span></a> documentation for more information.</p>
233
258
<p>You should now be able to set breakpoints and start debugging by clicking the bug icon.</p>
<li><p>Click the <codeclass="docutils literal notranslate"><spanclass="pre">+</span></code> icon top left</p></li>
163
163
<li><p>Select Python</p></li>
164
164
<li><p>Name it something to do with <codeclass="docutils literal notranslate"><spanclass="pre">Workbench</span></code></p></li>
165
-
<li><p>In the <codeclass="docutils literal notranslate"><spanclass="pre">Script</span><spanclass="pre">Path:</span></code>box, on Linux/MacOS enter the<codeclass="docutils literal notranslate"><spanclass="pre">{BUILD}/bin/workbench</span></code> Python script, on Windows enter <codeclass="docutils literal notranslate"><spanclass="pre">{BUILD}/bin/DebugWithRelRuntime/workbench-script.pyw</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">.pyw</span></code>files will not appear in the search window as it only shows <codeclass="docutils literal notranslate"><spanclass="pre">.py</span></code> files, so you cannot search for it with the GUI.</p></li>
165
+
<li><p>Click the down arrow next to <codeclass="docutils literal notranslate"><spanclass="pre">Script</span><spanclass="pre">path:</span></code>and change the selection to<codeclass="docutils literal notranslate"><spanclass="pre">Module</span><spanclass="pre">name</span></code>. Set the <codeclass="docutils literal notranslate"><spanclass="pre">Module</span><spanclass="pre">name</span></code>to <codeclass="docutils literal notranslate"><spanclass="pre">workbench</span></code>.</p></li>
166
166
<li><p>In the <codeclass="docutils literal notranslate"><spanclass="pre">Parameters</span></code> box add <codeclass="docutils literal notranslate"><spanclass="pre">--single-process</span></code> so that the multiprocess startup is disabled and breakpoints can be attached to the primary process. See the <aclass="reference internal" href="Workbench/RunningWorkbench.html#runningworkbench"><spanclass="std std-ref">Running Workbench</span></a> documentation for more information.</p></li>
167
167
<li><p>In the <codeclass="docutils literal notranslate"><spanclass="pre">Working</span><spanclass="pre">directory:</span></code> box, on Linux/MacOS enter the <codeclass="docutils literal notranslate"><spanclass="pre">{BUILD}/bin</span></code> directory, on Windows enter <codeclass="docutils literal notranslate"><spanclass="pre">{BUILD}/bin/DebugWithRelRuntime</span></code> directory.</p></li>
168
168
<li><p>Ensure the <codeclass="docutils literal notranslate"><spanclass="pre">Python</span><spanclass="pre">Interpreter:</span></code> box is set to use your <codeclass="docutils literal notranslate"><spanclass="pre">(mantid-developer)</span></code> Conda environment.</p></li>
0 commit comments