CMake
--graphviz
can generate GraphViz target dependency graphsfor CMake-supported project code languages including C, C++, and Fortran.
Fortran executables and modules are shown in the directed dependency graph.
Generating the dependency graph requires CMake configure and generate.
Thus, the compiler and generator needed by the CMake project must be working.
The project does not need to be compiled before generating the dependency graph.
However, the user should select the same CMake configure options as they would for compiling the project.
Example:
MUMPS
dependency graph is below.
SVG vector graphics can be zoomed arbitrarily large in a web browser.
The “graphviz/” directory is to avoid making files in the source directory.
CMake build targets are declared by “add_[executable,library,custom_target]” commands.
Targets can be dynamically set by arbitrarily complex foreach(), if(), etc. logic.
A list of CMake targets in the directory scope is retrieved by the
BUILDSYSTEM_TARGETS
directory
property.
The variable “target_names” contains all the target names previously added in the CMakeLists.txt in the DIRECTORY scope.
Retrieving the list of targets in a whole project, or in a FetchContent dependency is possible with this CMake function:
function(print_targetsdir)get_property(subdirsDIRECTORY"${dir}"PROPERTYSUBDIRECTORIES)foreach(subINLISTSsubdirs)print_targets("${sub}")endforeach()get_directory_property(targetsDIRECTORY"${dir}"BUILDSYSTEM_TARGETS)if(targets)message("Targets in ${dir}:")foreach(tINLISTStargets)message(" • ${t}")endforeach()endif()endfunction()
Use this function like:
print_targets("${CMAKE_CURRENT_SOURCE_DIR}")
Or supposing FetchContent, here using “googletest”:
External antenna (system + router is inside rugged weatherproof metal enclosure)
Wired (Ethernet) connection to equipment versus WiFi only for robustness
WiFi if desired vs. wired network only
USB only network connection. Some cheap routers have only USB (no Ethernet) connection to a consumer modem. Don’t allow one computer going down to take down connectivity to the whole site.
Setup via web or SSH
consider if higher-end models with 5G or CBRS mobile network support are needed.
Transfer Rate: 50 Mbps Up, 100 Mbps Down
WWAN antenna: 2 or more with connectors for coax cable
Ethernet: 100 / 1000 Mbps
Antenna: perhaps a broadband log periodic to give continuous frequency coverage to the numerous LTE bands.
The open source SSH app
ConnectBot
allows connecting to SSH servers with port forwarding using public key authentication, including ED25519.
Generally users should create unique SSH public/private keypairs for each device.
Sharing keys between devices means if a device is compromised, deleting its key from ~/.ssh/authorized_keys on the SSH server disables all other devices sharing that key.
If necessary, ConnectBot can
import
OpenSSH keys created on a PC.
Fiji / ImageJ cannot directly read Cinepak codec video files.
Convert from Cinepak to popular video formats using FFmpeg.
This conversion can be done on the command line as in this article, via an
FFmpeg import plugin.
Motion JPEG is widely-compatible with video players including ImageJ.
ffmpeg -i old.avi -c:v mjpeg -q:v 1 out.avi
Uncompressed AVI output file size could be a factor of 10 larger than the Cinepak version.
By definition, every video player should be able to play uncompressed AVI–including ImageJ.
ffmpeg -i old.avi -c:v rawvideo out.avi
Lossless FFV1 preserves the original video quality with lossless compression.
Many video players can handle FFV1 AVI video.
ffmpeg -i old.avi -c:v ffv1 out.avi
The advantage of using a
PNG image stack
comes in frame-by-frame analysis of the video.
Consider converting video to HDF5 using
dmcutils/avi2hdf5.py
for analysis purposes.
Windows Subsystem for Linux (WSL) uses
VHDX
files to store each distribution’s filesystem.
Over time these disk images grow in size as files are added and deleted.
However, the space used by deleted files is not automatically reclaimed, leading to larger disk images than necessary.
There is a
PowerShell script
to automatically compact WSL VHDX files that works with any of the Windows release levels (including Home).
The
jpegtran
command line tool allows lossless transformations on JPEG images, including rotation, cropping, and flipping.
This is particularly useful when you want to modify JPEG images without re-encoding them, which can lead to quality loss.
Example: lossless clockwise 90 degree rotation of a JPEG image “input.jpg” and save the result to file “output.jpg”:
WiFi
captive portals
and public networks often block outbound network port traffic.
Sometimes even VPNs are blocked.
Often only ports 80 (HTTP) and 443 (HTTPS) are allowed.
To quickly determine if outbound network ports are blocked, portquiz.net is a useful free service.
Using Python automates this process for multiple ports concurrently using concurrent.futures.ThreadPoolExecutor threads or asyncio.
We provide an
example
of each method in short scripts.
The examples shows that Asyncio using Semaphore with AIOHTTP can be faster than ThreadPoolExecutor with urllib.request.
Solutions to blocked ports for SSH include using
SSH ProxyJump
with an intermediate TRUSTED server on an allowed port.
Some remote SSH systems actually require this, where they the desired server has only LAN access, and a gateway SSH server with no privileges is used as the SSH ProxyJump by network design.
The ultimate workaround would be a mobile hotspot (different network).
If using a GUI, the --shell-escape option may need to be added.
In TeXmaker / TeXstudio, under “Options → Configure → Commands” add --shell-escape right after the compiler executable like xelatex --shell-escape or pdflatex --shell-escape or latexmk --shell-escape.
If “pygmentize” isn’t found, under TeXstudio Preferences → Build, check Show Advanced Options in the lower left checkbox and set Additional Search Paths → Commmands ($PATH) to the directory containing “pygmentize”, e.g. /opt/homebrew/bin on macOS with Homebrew or whatever directory comes up for which pygmentize in a Terminal.
In general operation systems set a limit to the number of open files per process.
A “file” might be a regular file, a socket, a pipe, etc.
When a Python program exceeds this limit, it raises exception:
OSError: [Errno 24] Too many open files
Such issues might tend to arise with highly concurrent applications as enabled by asyncio or higher-level libraries.
Resolving such asyncio concurrency issues generally involves asyncio
primitives
like
asyncio.Semaphore.
Implementing asyncio libraries correctly is so
non-trivial
that using higher-level libraries that implement such concurrency control
correctly
can be a better idea.
It’s important to go beyond toy examples and consider
real-world
concurrent Python usage patterns.