This is a guide to setting up Lmod (lua environment modules) on a CentOS system.
I’ve used a similar procedure to set them up on a Mac, as well, so this is still
a useful guide to the workings of Lmod if you use a different system; mostly
paths will change. On a Mac, you’ll want to install Lmod from the science
tap in brew. There are several good pages covering environment modules (TCL
version), but not many that use the newer Lua syntax. This document aims to fill
that role.
My favorite posts and series
C++11 C++14 C++17 C++20 C++23 2→3 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 macOS setup AS setup Windows setup SSH
My classes and books
Modern CMake CompClass se-for-sci
My workshops
CMake Workshop CPU GPU Compiled Level Up Your Python Packaging
My Python libraries
packaging cibuildwheel build pipx dependency-groups pyproject-metadata scikit-build (classic, core, cmake, ninja, moderncmakedomain, sample-projects) pybind11 (python_example scikit_build_example) meson-python boost-histogram Hist UHI Vector GooFit Particle DecayLanguage Conda-Forge ROOT uproot-browser nox Scientific-Python/cookie repo-review validate-pyproject(-schema-store) flake8-errmsg flake8-lazy check-sdist pytest GHA annotate-failures Plumbum
My other projects
CLI11 beautifulhugo Jekyll-Indico POVM hypernewsviewer AoC 2023 AoC 2024 AoC 2025
My sites
Scientific-Python Development Guide IRIS-HEP Scikit-HEP Scikit-Build CLARIPHY
Python 3 upgrade
About ten years ago, Guido Van Rossum, the Python author and Benevolent Dictator for Life (BDFL), along with the Python community, decided to make several concurrent backward incompatible changes to Python 2.5 and release a new version, Python 3.0.
[Read More]C++17
The every-three-year cycle has changed the development of C++; we are now getting consistent releases somewhere in-between the major and minor releases of old. The 2017 release may be called minor by some, with a huge portion of the planned improvements being pushed back another 3-6 years, but there were several substantial changes in useful areas; it is much more impactful than C++14, for example. This almost feels like a lead-in release to C++20.
The std::variant, std::optional, and std::any additions to the standard
library are huge, and can restructure the way you program (and are available for
older C++ releases through Boost and other libraries).
C++14
Unlike C++11, this is a minor release, focused mostly on improvements on top of C++11 changes, with very little that one could call “new”. C++14 feels a little more natural than C++11 by expanding the usage of features and implementing common sense additions that were missed in the original C++11 release. There were also quite a few bug fixes; several of these were backported into C++11 mode in compilers.
Also, while C++11 is always available in ROOT 6, C++14 requires a flag and compatible compiler, so C++14 features are often unavailable. The Conda-Forge ROOT package has C++17 enabled.
[Read More]C++11
C++11 was the largest change ever made to C++; and due to the changed release schedule, probably will remain the largest single change. It is a well thought out, mostly backward-compatible change that can cause you to completely rethink the way you write code in C++. It is best thought of as almost a new language, a sort of (C++)++ language. There are too many changes to list here, and there are excellent resources available, so this is meant to just give you a taste of some of the most useful changes.
Many of the features work best together, or are related. There already are great resources for learning about C++11 (listed at the bottom of this lesson), and C++11 is already in use in most software. Therefore, the remainder of this lesson will cover a few of the common idioms in C++11 that a programmer experienced with the older C++ might not immediately think of.
[Read More]GoogleTest and CMake
This is a quick recipe for setting up CMake to use googletest in your projects.
First, make a tests folder in the root of your project. Then, add
add_subdirectory(tests) to your CMakeLists.txt, after you’ve finished adding
the libraries in your project. Note that the way I’ve written this probably
requires CMake 3.4+.
A simple introduction to asyncio
This is a simple explanation of the asyncio module and new supporting language
features in Python 3.5. Even though the new keywords async and await are new
language constructs, they are mostly1 useless without an event loop, and that
is supplied in the standard library as asyncio. Also, you need awaitable
functions, which are only supplied by asyncio (or in the growing set of async
libraries, like asyncssh, quamash etc.).
A little example of how asyncio works
This is a simple example to show how Asyncio works without using Asyncio itself, instead using a basic and poorly written event loop. This is only meant to give a flavor of what Asyncio does behind the curtains. I’m avoiding most details of the library design, like callbacks, just to keep this simple. Since this is written as an illustration, rather than real code, I’m going to dispense with trying to keep it 2.7 compatible.
[Read More]