I realized that CRY did not have a CMake based install option, so including it in a GEANT4 cmake project might not be obvious. This is how you would do it in your CMakeLists.txt:
[Read More]Favorite posts and series
C++ 11 14 17 20 23 • macOS (AS) / Windows Setup • Azure DevOps (Python Wheels) • Conda-Forge ROOT • CLI11 • GooFit • cibuildwheel • Hist • Python Bindings • Python 2→3 3.7 3.8 3.9 3.10 3.11 3.12 3.13 • SSH
My classes and books
Modern CMake • CompClass • se-for-sci
My workshops
CMake Workshop • Python CPU, GPU, Compiled minicourses • Level Up Your Python • Packaging
My projects
pybind11 (python_example, cmake_example, scikit_build_example) • cibuildwheel • build • pipx • nox • pyproject-metadata • scikit-build (core, cmake, ninja, moderncmakedomain) • boost-histogram • Hist • UHI • Vector • GooFit • Particle • DecayLanguage • Conda-Forge ROOT • Jekyll-Indico • uproot-browser • Scientific-Python/cookie • repo-review • CLI11 • meson-python • Plumbum • validate-pyproject(-schema-store) • pytest GHA annotate-failures • flake8-errmsg • check-sdist • beautifulhugo • POVM • hypernewsviewer
My sites
Scientific-Python Development Guide • IRIS-HEP • Scikit-HEP • CLARIPHY
GTest Submodule
Note: There is a better way to do this described here.
If you’ve ever tried apt-get
or brew
to try to install gtest, you are
probably familiar with the fact that gtest is not “recommend” for global install
on your system. As an alternative, the recommendation is that you make it part
of your project. The process for making gtest part of your project, however, is
not well documented, at least for modern git projects. What follows is the
procedure I used to do so.
Slots in Python
Slots seem to be poorly documented. What they do is simple, but whether they are used is tricky. This is a little mini-post on slots.
[Read More]Basics of metaclasses
This is a quick tutorial over the basics of what metaclasses do.
The Metaclass
Metaclasses, while seemingly a complex topic, really just do something very simple. They control what happens when you have code that turns into a class object. The normal place they are executed is right after the class statement. Let’s see that in action by using print as our metaclass.
[Read More]Factory classmethods in Python
I haven’t seen a great deal of practical documentation about using classmethods as factories in Python (which is arguably the most important use of a classmethod, IMO). This post hopes to fill in that gap.
[Read More]