<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Raymond P. Burkholder - Things I Do - Software Development</title>
    <link>https://blog.raymond.burkholder.net/</link>
    <description>In And Around Technology and The Arts</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.7.2 - http://www.s9y.org/</generator>
    <pubDate>Sun, 01 Mar 2026 15:01:25 GMT</pubDate>

    <image>
        <url>https://blog.raymond.burkholder.net/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: Raymond P. Burkholder - Things I Do - Software Development - In And Around Technology and The Arts</title>
        <link>https://blog.raymond.burkholder.net/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Python Virtual Environment</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1337-Python-Virtual-Environment.html</link>
            <category>Ansible</category>
            <category>Python</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1337-Python-Virtual-Environment.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1337</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1337</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;https://codesolid.com/pip-vs-pipenv-which-is-better-and-which-to-learn-first/&quot; target=_blank&gt;Pip vs Pipenv: Which is better and which to learn first&lt;/a&gt; compares &lt;a href=&quot;https://packages.debian.org/trixie/pipenv&quot; target=_blank&gt;pipenv&lt;/a&gt; vs the &lt;a href=&quot;https://packages.debian.org/trixie/python3-pip&quot; target=_blank&gt;python3-pip&lt;/a&gt; and &lt;a href=&quot;https://packages.debian.org/trixie/virtualenv&quot; target=_blank&gt;virtualenv&lt;/a&gt; package combo.

&lt;p&gt;After referring to that, I think I&#039;ll just stick with the standard pip/virtualenv combo for now.

&lt;p&gt;To get started:

&lt;blockquote&gt;&lt;pre&gt;
# install basic packages
apt-get install python3 python3-pip virtualenv  python3-venv git

# create a project directory - example ansible
python3 -m venv ansible

# activate the project
cd ansible
source bin/activate

# example installation of packages
pip install ansible
pip install argcomplete
activate-global-python-argcomplete
source ~/.bash_completion
ansible-config init --disabled &gt; ansible.cfg

# to deactivate the project
deactivate

# upgrade
python3 -m pip install --upgrade ansible
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;At some point, integrate &lt;a href=&quot;https://packages.debian.org/trixie/python3-ansible-runner&quot; target=_blank&gt;python3-ansible-runner&lt;/a&gt;, the &lt;a href=&quot;https://github.com/ansible/ansible-runner&quot; target=_blank&gt;github source&lt;/a&gt; and links to documentation. 
    </content:encoded>

    <pubDate>Sat, 28 Feb 2026 19:27:47 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1337-guid.html</guid>
    
</item>
<item>
    <title>Manual Checkout / Roll-Back / Roll-Forward of Commits</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1319-Manual-Checkout-Roll-Back-Roll-Forward-of-Commits.html</link>
            <category>Software Development</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1319-Manual-Checkout-Roll-Back-Roll-Forward-of-Commits.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1319</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1319</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;I needed to step back a few commits to check where something went wrong.  Or at what point something went wrong.

&lt;p&gt;This works with a mixture of local commits and with primary commits sent to remote.

&lt;ul&gt;
  &lt;li&gt;git stash # whatever isn&#039;t committed yet
  &lt;li&gt;git checkout X #go back in time - where X is the SHA256 hash of the commit
  &lt;li&gt;git checkout .  # throw away any changes
  &lt;li&gt;git checkout master #go forward to current
  &lt;li&gt;git stash pop # bring back any unsaved changes
  &lt;/ul&gt; 
    </content:encoded>

    <pubDate>Tue, 29 Jul 2025 05:13:39 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1319-guid.html</guid>
    
</item>
<item>
    <title>Installing LibTorch with Cuda on NVIDIA GeForce RTX 4070</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1285-Installing-LibTorch-with-Cuda-on-NVIDIA-GeForce-RTX-4070.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1285-Installing-LibTorch-with-Cuda-on-NVIDIA-GeForce-RTX-4070.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1285</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1285</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;For trying out some LSTM Machine Learning algorithms with my &lt;a href=&quot;https://github.com/rburkholder/trade-frame&quot; target=_blank&gt;TradeFrame Algorithmic Trading Library&lt;/a&gt;, I wanted to install LibTorch with NVidia/Cuda support for hardware accelerating learning.

&lt;p&gt;Do not install the nvidia-driver yet.  It is part of the cuda deployment package.  Only install headers, which are necessary for building kernal modules.
&lt;blockquote&gt;&lt;pre&gt;
$ sudo apt install linux-headers-$(uname -r)
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;I used &lt;a href=&quot;https://docs.pytorch.org/cppdocs/installing.html&quot; target=_blank&gt;Installing C++ Distributions of PyTorch&lt;/a&gt; as a starting point.  However, their example is CPU based.  My desire is for a Cuda based installation.  This meant going to the &lt;a href=&quot;https://developer.nvidia.com/cuda-zone&quot; target=_blank&gt;CUDA Zone&lt;/a&gt; and start the Download process.  My configuration options were:  Linux, x86_64, Debian, 12, deb (local).

&lt;p&gt;Using the &quot;deb (local)&quot; with a complete file seemed to be the only way to ensure all components were available.

&lt;p&gt;The steps, as of this writing, were:

&lt;blockquote&gt;&lt;pre&gt;
wget https://developer.download.nvidia.com/compute/cuda/12.9.0/local_installers/cuda-repo-debian12-12-9-local_12.9.0-575.51.03-1_amd64.deb
sudo dpkg -i cuda-repo-debian12-12-9-local_12.9.0-575.51.03-1_amd64.deb
sudo cp /var/cuda-repo-debian12-12-9-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-9
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Install the open version of the nvidia drivers:

&lt;blockquote&gt;&lt;pre&gt;
sudo apt-get install -y nvidia-open
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;See if the nouveau driver is installed.

&lt;blockquote&gt;&lt;pre&gt;
$ lsmod |grep nouveau
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;If so, then run these commands to enable the nvidia driver and to blacklist the nouveau driver and reboot:

&lt;blockquote&gt;&lt;pre&gt;
sudo mv /etc/modprobe.d/nvidia.conf.dpkg-new  /etc/modprobe.d/nvidia.conf
sudo update-initramfs -u
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;There is also the &lt;a href=&quot;https://docs.nvidia.com/cuda/cuda-installation-guide-linux&quot; target=_blank&gt;NVIDIA CUDA Installation Guide for Linux&lt;/a&gt; for further information.

&lt;p&gt;The following changes are required for a successful compile of the example application below:

&lt;blockquote&gt;&lt;pre&gt;
$ diff math_functions.h /etc/alternatives/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.h
2556c2556
&amp;lt; extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double                 sinpi(double x);
---
&amp;gt; extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double                 sinpi(double x) noexcept (true);
2579c2579
&amp;lt; extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float                  sinpif(float x);
---
&amp;gt; extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float                  sinpif(float x) noexcept (true);
2601c2601
&amp;lt; extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double                 cospi(double x);
---
&amp;gt; extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double                 cospi(double x) noexcept (true);
2623c2623
&amp;lt; extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float                  cospif(float x);
---
&amp;gt; extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float                  cospif(float x) noexcept (true);
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;use this file to fix the above:

&lt;blockquote&gt;&lt;pre&gt;
$ cat cuda_fix.sh
#!/bin/sh
header_file=/etc/alternatives/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.h
sudo sed -i &#039;s/sinpi(double x);/sinpi(double x) noexcept (true);/&#039; $header_file
sudo sed -i &#039;s/sinpif(float x);/sinpif(float x) noexcept (true);/&#039; $header_file
sudo sed -i &#039;s/cospi(double x);/cospi(double x) noexcept (true);/&#039; $header_file
sudo sed -i &#039;s/cospif(float x);/cospif(float x) noexcept (true);/&#039; $header_file
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;The PyTorch LibTorch library can be downloaded from &lt;a href=&quot;https://pytorch.org/get-started/locally/&quot; target=_blank&gt;PyTorch Start Locally&lt;/a&gt;.  Choose the C++/Java option with Cuda 12.8 (as of this writing).  An appropriate link is presented.  Download and expand the file into a development directory.  LibTorch doesn&#039;t have at this moment a build for Cuda 12.9, but is referenced as 12.8.

&lt;p&gt;The most recent can be found at &lt;a href=&quot;https://download.pytorch.org/libtorch/nightly/cu128/libtorch-shared-with-deps-latest.zip&quot; target=_blank&gt;https://download.pytorch.org/libtorch/nightly/cu128/libtorch-shared-with-deps-latest.zip&lt;/a&gt;.

&lt;p&gt;It is probably advised to NOT use the Debian package, as it may be out of date:  &lt;a href=&quot;https://tracker.debian.org/pkg/pytorch-cuda&quot; target=_blank&gt;pytorch-cuda&lt;/a&gt;.

&lt;p&gt;Expand the libtorch package and deploy to /usr/local/share/libtorch.

&lt;p&gt;To test out the installation, I then created a subdirectory containing a couple of files.  The first is the test code example-app.cpp:

&lt;blockquote&gt;&lt;pre&gt;
#include &amp;lt;torch/torch.h&amp;gt;
#include &amp;lt;iostream&amp;gt;

int main() {
  torch::Tensor tensor = torch::rand({2, 3});
  std::cout &lt;&lt; tensor &lt;&lt; std::endl;
}
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;The second file is the CMakeLists.txt file.  This is my version:

&lt;blockquote&gt;&lt;pre&gt;
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)

cmake_policy(SET CMP0104 NEW)
cmake_policy(SET CMP0105 NEW)
project(example-app)

find_package(Torch REQUIRED)
set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}&quot;)
set(CMAKE_CUDA_STANDARD 17)

add_executable(example-app example-app.cpp)
target_link_libraries(example-app &quot;${TORCH_LIBRARIES}&quot;)
set_property(TARGET example-app PROPERTY CXX_STANDARD 17)
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Then to build the example:

&lt;blockquote&gt;&lt;pre&gt;
mkdir build
cmake \
  -DCMAKE_PREFIX_PATH=/usr/local/share/libtorch \
  -DCMAKE_CUDA_ARCHITECTURES=native \
  -DCMAKE_BUILD_TYPE=DEBUG \
  -DCMAKE_CUDA_COMPILER=/etc/alternatives/cuda/bin/nvcc \
  -Dnvtx3_dir=/usr/local/cuda/targets/x86_64-linux/include/nvtx3  \
  ..
make
./example-app
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Notes:

&lt;ul&gt;
  &lt;li&gt;PREFIX_PATH points to the directory of your expanded libtorch download
  &lt;li&gt;CMAKE_CUDA_ARCHITECTURES provides a &#039;native&#039; cuda solution, the build process will determine the specific gpu for which to build
  &lt;li&gt;CMAKE_BUILD_TYPE can be DEBUG or RELEASE
  &lt;li&gt;CMAKE_CUDA_COMPILER needs to be set, by using /etc/alternatives, these are softlinks to the version you desire (as were installed by the cuda installation)
  &lt;li&gt;nvtx3_dir is required, as the current libtorch library seems to still refer to nvtx and not nvtx3
  &lt;/ul&gt;

&lt;p&gt;If you get output along the lines of:

&lt;blockquote&gt;&lt;pre&gt;
-- Automatic GPU detection failed. Building for common architectures.
-- Autodetected CUDA architecture(s): 5.0;8.0;8.6;8.9;9.0;9.0a;10.0;10.0a;10.1a;12.0;12.0a
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;My system has two RTX 4070 cards, and can be verified with (an extract is shown with important parts, noticing that the nvidia driver is properly shown):

&lt;blockquote&gt;&lt;pre&gt;
$ sudo lshw -c video
  *-display
    product: Arrow Lake-S [Intel Graphics]
    configuration: depth=32 &lt;bold&gt;driver=i915&lt;/bold&gt; latency=0 mode=3840x2160 resolution=3840,2160 visual=truecolor xres=3840 yres=2160
  *-display
    product: AD103 [GeForce RTX 4070]
    configuration: &lt;bold&gt;driver=nvidia&lt;/bold&gt; latency=0
  *-display
    product: AD103 [GeForce RTX 4070]
    configuration: &lt;bold&gt;driver=nvidia&lt;/bold&gt; latency=0
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Therefore, the output of my cmake process will include gpu specific selections:

&lt;blockquote&gt;&lt;pre&gt;
-- Autodetected CUDA architecture(s):  8.9 8.9
-- Added CUDA NVCC flags for: -gencode;arch=compute_89,code=sm_89
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;And running the generated binary results in valid output:

&lt;blockquote&gt;&lt;pre&gt;
$ ./example-app
0.7141  0.9744  0.3179
0.7794  0.9281  0.7529
[ CPUFloatType{2,3} ]
&lt;/pre&gt;&lt;/blockquote&gt;

 &lt;br /&gt;&lt;a href=&quot;https://blog.raymond.burkholder.net/index.php?/archives/1285-Installing-LibTorch-with-Cuda-on-NVIDIA-GeForce-RTX-4070.html#extended&quot;&gt;Continue reading &quot;Installing LibTorch with Cuda on NVIDIA GeForce RTX 4070&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 09 May 2025 03:09:46 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1285-guid.html</guid>
    
</item>
<item>
    <title>Lua</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1274-Lua.html</link>
            <category>Software Development</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1274-Lua.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1274</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1274</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;a href=&quot;https://notebook.kulchenko.com/programming/lua-good-different-bad-and-ugly-parts&quot; target=_blank&gt;Lua: Good, bad, and ugly parts&lt;/a&gt; - somewhat older 2012/03/25 - References &lt;a href=&quot;https://studio.zerobrane.com/&quot; target=_blank&gt;ZeroBrane Studio&lt;/a&gt; which is a lightweight Lua IDE with code completion, syntax highlighting, live coding, code analyzer, and debugging support for Lua 5.1, Lua 5.2, Lua 5.3, Lua 5.4, LuaJIT, and other Lua engines. 
    </content:encoded>

    <pubDate>Sat, 14 Dec 2024 17:55:24 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1274-guid.html</guid>
    
</item>
<item>
    <title>CMake</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1273-CMake.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1273-CMake.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1273</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1273</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://jennyjams.net/blog/cmake-pros/&quot; target=_blank&gt;CMake: the Good, the Bad, the Weird&lt;/a&gt; - ... strongly recommend for any developers who are learning or struggling with CMake to purchase Professional CMake -- I have found it very helpful in explaining things where most other resources haven&#039;t, and it is consistently updated with new major versions of CMake.
  &lt;/ul&gt; 
    </content:encoded>

    <pubDate>Sat, 14 Dec 2024 17:52:38 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1273-guid.html</guid>
    
</item>
<item>
    <title>C++ Header File Statistics</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1262-C++-Header-File-Statistics.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1262-C++-Header-File-Statistics.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1262</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1262</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;From &lt;a href=&quot;https://zeux.io/2010/11/15/include-rules/&quot; target=_blank&gt;#include &amp;lt;rules&amp;gt;&lt;/a&gt;, via &lt;a href=&quot;https://news.ycombinator.com/item?id=39249430&quot; target=_blank&gt;hacker news&lt;/a&gt;, two compile time options to consider:

&lt;ul&gt;
  &lt;li&gt;use the preprocessor output (cl /E, gcc -E)
  &lt;li&gt;use the include output (cl /showIncludes, gcc -M), gather the codebase statistics (average size after preprocessing, most included header files, header files with largest payload, etc.) 
  &lt;/ul&gt;

&lt;p&gt;I&#039;ve been doing this backwards, but I don&#039;t understand why though:

&lt;blockquote&gt;
The header file named after the source should be included first (to catch errors in the header)
&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Sun, 04 Feb 2024 14:02:56 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1262-guid.html</guid>
    
</item>
<item>
    <title>Boehm Garbage Collection, Cords String Handling</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1260-Boehm-Garbage-Collection,-Cords-String-Handling.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1260-Boehm-Garbage-Collection,-Cords-String-Handling.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1260</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1260</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;HackerNews had an article about &lt;a href=&quot;https://news.ycombinator.com/item?id=39077535&quot; target=_blank&gt;Boehm-Demers-Weiser conservative C/C++ Garbage Collector&lt;/a&gt; which leads to &lt;a href=&quot;A garbage collector for C and C++&quot; target=_blank&gt;A garbage collector for C and C++&lt;/a&gt;.

&lt;p&gt;It can be used in garbage collection mode or leak detection mode.

&lt;p&gt; The garbage collector distribution includes a C string (&lt;a href=&quot;https://hboehm.info/gc/gc_source/cordh.txt&quot; target=_blank&gt;cord&lt;/a&gt;) package that provides for fast concatenation and substring operations on long strings. A simple curses- and win32-based editor that represents the entire file as a cord is included as a sample application. From &lt;a href=&quot;https://en.wikipedia.org/wiki/Boehm_garbage_collector&quot; target=_blank&gt;Wikipedia&lt;/a&gt;:

&lt;blockquote&gt;
Boehm GC is also distributed with a &lt;a href=&quot;https://en.wikipedia.org/wiki/C_string_handling&quot; title=&quot;C string handling&quot;&gt;C string handling&lt;/a&gt; library called cords. This is similar to &lt;a href=&quot;https://en.wikipedia.org/wiki/Rope_(computer_science)&quot; class=&quot;mw-redirect&quot; title=&quot;Rope (computer science)&quot;&gt;ropes&lt;/a&gt; in C++ (&lt;a href=&quot;https://en.wikipedia.org/wiki/Tree_(data_structure)&quot; title=&quot;Tree (data structure)&quot;&gt;trees&lt;/a&gt; of constant small arrays), but instead of using reference counting for proper deallocation, it relies on garbage collection to free objects. Cords are good at handling very large texts, modifications to them in the middle, slicing, concatenating, and keeping history of changes (&lt;a href=&quot;https://en.wikipedia.org/wiki/Undo&quot; title=&quot;Undo&quot;&gt;undo&lt;/a&gt;/redo functionality).
&lt;/blockquote&gt;

&lt;p&gt;Code can be found at &lt;a href=&quot;https://github.com/ivmai/bdwgc/&quot; target=_blank&gt;github - The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (bdwgc, also known as bdw-gc, boehm-gc, libgc)&lt;/a&gt; 
    </content:encoded>

    <pubDate>Sun, 21 Jan 2024 16:39:38 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1260-guid.html</guid>
    
</item>
<item>
    <title>Parallelism and   Concurrency</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1256-Parallelism-and-Concurrency.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1256-Parallelism-and-Concurrency.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1256</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1256</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;https://arxiv.org/abs/2401.03353&quot; target=_blank&gt;HPX -- An open source C++ Standard Library for Parallelism and
  Concurrency&lt;/a&gt;

&lt;blockquote&gt;
To achieve scalability with today&#039;s heterogeneous HPC resources, we need a
dramatic shift in our thinking; MPI+X is not enough. Asynchronous Many Task
(AMT) runtime systems break down the global barriers imposed by the Bulk
Synchronous Programming model. HPX is an open-source, C++ Standards compliant
AMT runtime system that is developed by a diverse international community of
collaborators called The Ste||ar Group. HPX provides features which allow
application developers to naturally use key design patterns, such as
overlapping communication and computation, decentralizing of control flow,
oversubscribing execution resources and sending work to data instead of data to
work. The Ste||ar Group comprises physicists, engineers, and computer
scientists; men and women from many different institutions and affiliations,
and over a dozen different countries. We are committed to advancing the
development of scalable parallel applications by providing a platform for
collaborating and exchanging ideas. In this paper, we give a detailed
description of the features HPX provides and how they help achieve scalability
and programmability, a list of applications of HPX including two large NSF
funded collaborations (STORM, for storm surge forecasting; and STAR (OctoTiger)
an astro-physics project which runs at 96.8% parallel efficiency on 643,280
cores), and we end with a description of how HPX and the Ste||ar Group fit into
the open source community.
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://arxiv.org/abs/2401.03134&quot; target=_blank&gt;TimeGraphs: Graph-based Temporal Reasoning&lt;/a&gt;

&lt;blockquote&gt;
Many real-world systems exhibit temporal, dynamic behaviors, which are
captured as time series of complex agent interactions. To perform temporal
reasoning, current methods primarily encode temporal dynamics through simple
sequence-based models. However, in general these models fail to efficiently
capture the full spectrum of rich dynamics in the input, since the dynamics is
not uniformly distributed. In particular, relevant information might be harder
to extract and computing power is wasted for processing all individual
timesteps, even if they contain no significant changes or no new information.
Here we propose TimeGraphs, a novel approach that characterizes dynamic
interactions as a hierarchical temporal graph, diverging from traditional
sequential representations. Our approach models the interactions using a
compact graph-based representation, enabling adaptive reasoning across diverse
time scales. Adopting a self-supervised method, TimeGraphs constructs a
multi-level event hierarchy from a temporal input, which is then used to
efficiently reason about the unevenly distributed dynamics. This construction
process is scalable and incremental to accommodate streaming data. We evaluate
TimeGraphs on multiple datasets with complex, dynamic agent interactions,
including a football simulator, the Resistance game, and the MOMA human
activity dataset. The results demonstrate both robustness and efficiency of
TimeGraphs on a range of temporal reasoning tasks. Our approach obtains
state-of-the-art performance and leads to a performance increase of up to 12.2%
on event prediction and recognition tasks over current approaches. Our
experiments further demonstrate a wide array of capabilities including
zero-shot generalization, robustness in case of data sparsity, and adaptability
to streaming data flow.
&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Wed, 10 Jan 2024 03:47:38 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1256-guid.html</guid>
    
</item>
<item>
    <title>How to do a dynamic parser in X3?</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1246-How-to-do-a-dynamic-parser-in-X3.html</link>
            <category>Boost</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1246-How-to-do-a-dynamic-parser-in-X3.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1246</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1246</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=9QlPOYX8mgw&quot; target=_blank&gt;how to do a dynamic parser in X3?&lt;/a&gt;

&lt;blockquote&gt;
&lt;p&gt;The presentation went well, but as always with a large surface area
library like Spirit it went on for too long IMO (2 hrs).  This was
similar to what happened when I presented Spirit 2.x almost 10 yrs
ago.  If I were to present on this again, I would split the topic into
two talks:
&lt;ul&gt;
  &lt;li&gt;A background on recursive variant datatypes and visitor pattern and
dipping into the Fusion library for adapting arbitrary application
structures to Fusion tuples.
  &lt;li&gt;Spirit X3 parsing w/annotations and error handling.
  &lt;/ul&gt;
&lt;p&gt;I try to present from real code in the IDE as much as
possible so that we&#039;re looking at real code.  I almost always write
my own examples with the library I&#039;m presenting and put them on
github.  The exception is when the library comes with an example that
is everything I want to talk about &lt;img src=&quot;https://blog.raymond.burkholder.net/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;.

&lt;p&gt;I cribbed quite a bit from the spirit x3 fun example presented by
Michael Caisse a few years back, but I did extend the AST to handle
imaginary numbers.
&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Sun, 24 Sep 2023 00:26:51 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1246-guid.html</guid>
    
</item>
<item>
    <title>SaltStack on Debian Bookworm</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1241-SaltStack-on-Debian-Bookworm.html</link>
            <category>Debian</category>
            <category>Python</category>
            <category>Salt</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1241-SaltStack-on-Debian-Bookworm.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1241</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1241</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;I found out the hard way that SaltStack and Debian no longer place nice together.  I had upgraded a Debian installation from Bullseye to Bookworm, along with the resident Salt Minion.  When attempting to use the minion, it no longer starts up, due to various imports no longer working.  Which was due to the salt-minion not being upgraded.  The error message would started this odyssey:

&lt;blockquote&gt;&lt;pre&gt;
salt ImportError: cannot import name &#039;Markup&#039; from &#039;jinja2&#039;
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Taking a look at the &lt;a href=&quot;https://tracker.debian.org/pkg/salt&quot; target=_blank&gt;Debian Developer Information for Salt&lt;/a&gt;, the last version started in &#039;unstable&#039; was 3004.1 back in December of 2022.  This is now almost 8 months later and little or no movement.  There was some mention in a ticket somewhere that Salt release cycles don&#039;t cater to Debian stable release cycles.  Not sure if that is a legitimate reason or not, but, well, for whatever reason, SaltStack management in Debian is no longer a simple no brainer.

&lt;p&gt;However, after a little digging, there is a way to run SaltStack versions 3006 (current as of this writing).  It is simple to install on Bullseye, but not easily done on Bookworm.

&lt;p&gt;On Bullseye (as root, or implies sudo):

&lt;blockquote&gt;
# cd ~
# apt remove salt-minion salt-master
# apt install curl
# curl -L https://bootstrap.saltstack.com -o install_salt.sh
# sh install_salt.sh -M onedir
&lt;/blockquote&gt;

&lt;p&gt;The &#039;-M&#039; installs the salt master at the same time (for machines running master).  If you forget to do that, you&#039;ll need to diagnose and fix the systemctl mask error with the following:

&lt;blockquote&gt;
# apt install file
# file /etc/systemd/system/salt-master.service
# rm /etc/systemd/system/salt-master.service
# systemctl daemon-reload
# sh install_salt.sh -M onedir
&lt;/blockquote&gt;

&lt;p&gt;The &#039;sh install_salt.sh -M onedir&#039; should show a symlink to /dev/nul, which the &#039;rm ...&#039; will fix.

&lt;p&gt;On Bookworm, the bootstrap isn&#039;t scheduled to work till beginning of 2024 sometime I think with Salt 3007 or 3008 -- more info in &lt;a href=&quot;https://github.com/saltstack/salt/issues/64223&quot; target=_blank&gt;[FEATURE REQUEST] Add Salt support for Debian 12 #64223 &lt;/a&gt;.

&lt;p&gt;In the meantime, I had to cheat a bit:

&lt;ul&gt;
  &lt;li&gt;in /etc/debian_version, change 12.0 to 11.0
  &lt;li&gt;in /etc/apt/sources.list, change bookworm to bullseye
  &lt;li&gt;rm /etc/apt/sources.list.d/salt.list
  &lt;li&gt;run apt update
  &lt;li&gt;run the commands listed above for installing the one or both the salt services
  &lt;li&gt;restore /etc/debian_version and /etc/apt/sources.list to their original content
  &lt;/ul&gt;

&lt;p&gt;I&#039;m sure there are more elegant ways of doing this, but this worked to fake the needed version 11 in the installation script and directory traversal requirements

&lt;p&gt;Note, more info on the &lt;a href=&quot;https://docs.saltproject.io/en/getstarted/fundamentals/install.html&quot; target=_blank&gt;Salt Install/Bootstrap Process&lt;/a&gt;.
 
    </content:encoded>

    <pubDate>Wed, 19 Jul 2023 01:09:49 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1241-guid.html</guid>
    
</item>
<item>
    <title>Stop VSCode from adding headers</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1228-Stop-VSCode-from-adding-headers.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1228-Stop-VSCode-from-adding-headers.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1228</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1228</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;Visual Studio Code, by default, when using the clangd language server, will automatically insert headers files for types which may have already been declared.

&lt;p&gt;To disable this, go into the configuration options for clangd, and in &#039;clangd:arguments&#039; add:

&lt;blockquote&gt;
--header-insertion=never
&lt;/blockquote&gt;

&lt;p&gt;Source: &lt;a href=&quot;https://stackoverflow.com/questions/74018901/stop-vscode-from-adding-redundant-headers&quot; target=_blank&gt;Stop VSCode from adding redundant headers&lt;/a&gt; 
    </content:encoded>

    <pubDate>Sun, 11 Jun 2023 18:04:01 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1228-guid.html</guid>
    
</item>
<item>
    <title>GCC Optimization for Native Architecture</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1183-GCC-Optimization-for-Native-Architecture.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1183-GCC-Optimization-for-Native-Architecture.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1183</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1183</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;When using Cern&#039;s ROOT Data Analysis Framework, there are notes about possible compile time enhancements.  It is best to take a look on which cpu variant the compiler will generate code, and for which target cpu the code will run.  They need to be compatible.

&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/AVX-512#CPUs_with_AVX-512&quot; target=_blank&gt;AVX-512&lt;/a&gt; is an interesting Wikipedia page describing the various cpu variant incarnations and their specialized instruction subsets.

&lt;p&gt;Here are a few command line examples for examining what the gcc compiler sees as being available.

&lt;blockquote&gt;&lt;pre&gt;
$ gcc -march=native -Q --help=target | grep march
  -march=                               skylake
  Known valid arguments for -march= option:
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;blockquote&gt;&lt;pre&gt;
$ echo | gcc -dM -E - -march=native
  ... large quantity of flags ...
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html&quot; target=_blank&gt;gcc x86 cpu options&lt;/a&gt; cmake command:

&lt;blockquote&gt;&lt;pre&gt;
add_definitions(-march=native)
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Even though this optimizes instruction use, it has to be used carefully.  It will probably cause side effects with compiling code on one version of cpu and when copying the executables to a different machine, with possibly a different cpu variant.

&lt;p&gt;Reference: &lt;a href=&quot;https://stackoverflow.com/questions/5470257/how-to-see-which-flags-march-native-will-activate&quot; target=_blank&gt;How to see which flags -march=native will activate?&lt;/a&gt; 
    </content:encoded>

    <pubDate>Sun, 27 Mar 2022 17:48:33 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1183-guid.html</guid>
    
</item>
<item>
    <title>C++ References</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1180-C++-References.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1180-C++-References.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1180</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1180</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;https://www.foonathan.net/2019/02/special-member-functions/#content&quot; target=_blank&gt;Tutorial: When to Write Which Special Member&lt;/a&gt; - &quot;When explaining someone the rules behind the special member functions and when you need to write which one, there is this diagram that is always brought up. I don’t think the diagram is particularly useful for that, however.&quot;

&lt;p&gt;&lt;a href=&quot;https://www.foonathan.net/2018/10/cmake-warnings/&quot; target=_blank&gt;Tutorial: Managing Compiler Warnings with CMake&lt;/a&gt; - &quot;
But how do you manage the very compiler-specific flags in CMake? How do you prevent your header files from leaking warnings into other projects?&quot; 
    </content:encoded>

    <pubDate>Sun, 20 Mar 2022 12:29:16 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1180-guid.html</guid>
    
</item>
<item>
    <title>Papers 2022/02/05</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1175-Papers-20220205.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1175-Papers-20220205.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1175</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1175</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;https://arxiv.org/abs/2202.00717&quot; target=_blank&gt;Pipeflow: An Efficient Task-Parallel Pipeline Programming Framework
  using Modern C++&lt;/a&gt;

&lt;blockquote&gt;
Pipeline is a fundamental parallel programming pattern. Mainstream pipeline
programming frameworks count on data abstractions to perform pipeline
scheduling. This design is convenient for data-centric pipeline applications
but inefficient for algorithms that only exploit task parallelism in pipeline.
As a result, we introduce a new task-parallel pipeline programming framework
called Pipeflow. Pipeflow does not design yet another data abstraction but
focuses on the pipeline scheduling itself, enabling more efficient
implementation of task-parallel pipeline algorithms than existing frameworks.
We have evaluated Pipeflow on both micro-benchmarks and real-world
applications. As an example, Pipeflow outperforms oneTBB 24% and 10% faster in
a VLSI placement and a timing analysis workloads that adopt pipeline
parallelism to speed up runtimes, respectively.
&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Sat, 05 Feb 2022 22:44:45 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1175-guid.html</guid>
    
</item>
<item>
    <title>3D Modelling Software - C++ API</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/1083-3D-Modelling-Software-C++-API.html</link>
            <category>C++</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/1083-3D-Modelling-Software-C++-API.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=1083</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=1083</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;Since none of this is registered in github, here is my alternate mechanism for &#039;staring&#039; these items:

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.freecadweb.org/&quot; target=_blank&gt;FreeCAD&lt;/a&gt; - open-source parametric 3D modeler made primarily to design real-life objects of any size. Parametric modeling allows you to easily modify your design by going back into your model history and changing its parameters. You get modern Finite Element Analysis (FEA) tools, experimental CFD, dedicated BIM, Geodata or CAM/CNC workbenches, a robot simulation module that allows you to study robot movements and many more features.
  &lt;li&gt;&lt;a href=&quot;https://cppyy.readthedocs.io/en/latest/&quot; target=_blank&gt;cppyy: Automatic Python-C++ bindings&lt;/a&gt; - an automatic, run-time, Python-C++ bindings generator, for calling C++ from Python and Python from C++
  &lt;li&gt;&lt;a href=&quot;https://dev.opencascade.org/&quot; target=_blank&gt;Open CASCADE Technology, The Open Source 3D Modeling Libraries&lt;/a&gt; - is a software development kit (SDK) intended for development of applications dealing with 3D CAD data or requiring industrial 3D capabilities. It includes a set of C++ class libraries providing services for 3D surface and solid modeling, CAD data exchange, and visualization. &lt;a href=j&quot;https://documentation.help/Open-Cascade/occt__tutorial.html&quot; target=_blank&gt;tutorial&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.openstudio.net/&quot; target=_blank&gt;OpenStudio&lt;/a&gt; is a cross-platform (Windows, Mac, and Linux) collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
  &lt;li&gt;&lt;a href=&quot;https://topologic.app/software/&quot; target=_blank&gt;Topologic&lt;/a&gt; is a software development kit and plug-in that enables logical, hierarchical and topological representation of spaces and entities
  &lt;li&gt;&lt;a href=&quot;&quot; target=_blank&gt;&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;&quot; target=_blank&gt;&lt;/a&gt;
  &lt;/ul&gt; 
    </content:encoded>

    <pubDate>Sat, 16 Jan 2021 20:30:24 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/1083-guid.html</guid>
    
</item>

</channel>
</rss>
