CMake can set per-language compiler flags scoped to directory or target.
The directory scope propagates to targets in the directory and subdirectories.
Per-language options that are intended for all targets in the project are often set near the beginning of the top-level CMakeLists.txt, before any targets are declared.
The same concepts and scope apply to
compile definitions
and
linker flags.
By default,
add_compile_options()
and target_compile_options() add flags for all target languages.
Multi-language targets (for example, a target that has C and C++ source files) would have the flags applied to all languages.
In general, this may cause problems if the flags are not appropriate for all languages.
The options are restricted by compiler, language, build configuration, etc. using CMake
generator expressions.
For example, $<COMPILE_LANGUAGE:Fortran> is used to restrict options to Fortran targets.
A stanza like $<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug,RelWithDebInfo>> sets flags for Fortran targets in the debug and RelWithDebInfo build configurations.
Note: where using
FetchContent,
the main project may desire -Wall but this may cause megabytes of warnings from a legacy Fetched project.
A solution is to put add_compile_options() in each of the parent project directories and/or use target_compile_options() in the parent project.
This example is for a C and Fortran project, where some flags apply to C and Fortran, and other flags are Fortran-specific.
It’s often useful to use a convenience function to make the code more readable, say in a file “AddOptions.cmake”:
project(DemoLANGUAGESCFortran)include(AddOptions.cmake)add_compile_lang_options(Fortran-Wall-fimplicit-none)# more advanced example to add debug-only, compiler-specific and language-specific options:
add_compile_options(
$<$<AND:$<COMPILE_LANG_AND_ID:Fortran,GNU>,$<CONFIG:Debug,RelWithDebInfo>>:-Werror=array-bounds>)
FFmpeg can
merge
several files each containing one audio channel into a single file with multiple channels.
For example, a multichannel data collection might save each sensor channel into individual files.
For data analysis and for practicality to avoid mixing channels from different experiments, it can be useful to combine the individual channel files into a single multichannel file.
The
amerge
filter can merge multiple files into a single multichannel file. .
The amerge filter requires all input files to have the same sample rate and format.
Some newer President CB radios including the
Bill III FCC
(FCC ID 2AEOCPC210, Model TXUS201)
have preprogrammed FM mode with CTCSS squelch on “P channels”.
Similar to some OEM FRS / GMRS radios that have preprogrammed channels with CTCSS or DCS codes, the P channels are a convenience that immediately allow users with CB radios having FM and CTCSS to interoperate with each other.
We welcome preprogrammed P channel-like features with FM and CTCSS as they are likely to increase usage of FM mode and CTCSS on CB radios.
This gives the benefits of maximum range with minimum interference.
Before these preprogrammed channels, setting
CB radio CTCSS coded squelch
involved diving through menus.
The CB radio channel to President P channel mapping is:
President P channel
CB channel
Center Frequency (MHz)
1
1
26.965
2
3
26.985
3
11
27.085
4
18
27.175
5
24
27.235
We wonder if the P channel choices included user feedback or CB radio spectrum use observations.
The commentary following is based on North American CB radio usage observations.
The lower CB channels are historically less frequently used due in part to adjacent channel splatter from CB channel 6 and 11 that are partially used by DX operators.
High power stations with clipped AM modulation that splatters adjacent channels have a lower duty cycle based on the human voice.
Using FM mode with coded squelch experiences much less disturbance from adjacent channel splatter versus the AM mode with signal squelch.
P channel 1 (CB channel 1) on FM mode may have less interference than the other P channels in many areas.
P channel 2 (CB channel 3) is 40 kHz away from CB channel 6 with the highest power operators and is likely also as good as P channel 1 for interference.
P channel 3 (CB channel 11) is a popular AM mode channel. FM users (even with coded squelch) may experience reduced communications range due to co-channel interference from AM mode users.
P channel 4 (CB channel 18) is adjacent (10 kHz away) from CB channel 19, which is a popular AM mode channel for truckers and highway travel.
P channel 5 (CB channel 24) may like P channels 1 and 2 have less interference than P channels 3 and 4.
Although it may be impossible to change the existing radio P channel frequencies, we would suggest OEMs consider adding the P channel frequencies for future radios: CB channels 2, 8, 12, 27, 29.
These frequencies
avoid:
DX users (CB channels 6, 11, 26, 28), handheld (CB channel 14), off-road users (CB channel 4), and SSB users (CB channels 16, 30-40).
While dedicated NOAA NWR weather (WX) radios are available, two-way communications radios such as CB radio and GMRS etc. can also have 162 MHz weather radio receivers.
162 MHz WX radio is a one-way radio service that broadcasts weather information and emergency alerts across much of the USA, Canada, and Mexico.
When determining which WX channel to receive on, it can be confusing because there is no standard WX channel number to 162 MHz frequency mapping.
Use the NOAA
USA search
or
Canada search
to find nearby WX radio transmitter frequencies.
Channel number to frequency mapping: a common practice is to start with the lowest frequency and go up across the 7 WX radio frequencies.
This is perhaps the most common channel number to frequency mapping.
WX Channel
Frequency (MHz)
1
162.400
2
162.425
3
162.450
4
162.475
5
162.500
6
162.525
7
162.550
Non-sequential channel order is used by some CB radios such as Radioddity / Anytone radios made by Qixiang.
WX Channel
Frequency (MHz)
1
162.550
2
162.400
3
162.475
4
162.425
5
162.450
6
162.500
7
162.525
Comparing the reception performance on a known frequency vs. a handheld radio can give a quick indication that an antenna system is working OK–even if like 27 MHz CB radio the designed antenna frequency is far from the 162 MHz weather radio frequency.
Comparing WX radio reception on a CB radio with base or mobile antenna versus a handheld radio on the same 162 MHz WX radio frequency indicates that the CB radio antenna coax is perhaps not severely damaged or lossy, and the radio is working OK.
Modern sub-$250 television receivers make compromises in low cost hardware while supporting the best possible picture quality for internet streams.
This can lead to compromises in fundamental performance for over-the-air (OTA) reception of digital ATSC TV signals.
For example, the ability to monitor signal strength is often not present in such low-cost TVs.
When a channel(s) that should be easily received is not available, the fundamental step of checking signal strength might be unavailable on a low-cost TV.
A first step is generally to rerun the channel scan with the antenna (if indoor) positioned in a window facing the
transmitter direction.
A diagnostic tool and possible solution is an ATSC tuner connected to the TV via HDMI.
ATSC 1.0 HDMI tuners are available for under $30.
The dedicated tuner may be of higher quality than the TV’s built-in tuner, and may provide a signal strength reading.
Check product reviews to ensure the tuner is of good quality and has a signal strength meter.
Some tuners can connect to an Android device or laptop via USB to receive broadcasts or monitor signal strength.
This can allow a technically-minded user to diagnose reception issues including interference.
The C23 standard requires function declarations to have the arguments specified, else (void) (zero arguments) is assumed.
This is a
breaking change
for code that didn’t use the best practice of specifying the argument types in the function declaration.
A real life
example
of upgrading a large project (Red Hat Linux) to C23 compliance is illustrative.
This change emphasizes the importance of adhering to recent C standards for clarity while maintaining compatibility with older language standards if possible.
Freezing the compiler version range for project code is generally a costly long-term strategy as technical debt and developer frustration accumulate.
Newer compilers keep adding
debugging features
and performance improvements.
C++ standard library (STL) improvements over time include paring down internal includes where possible as best practice and to improve compilation time.
When user code accidentally relies on internal includes, it can lead to compilation errors when the internal includes are removed by the STL maintainers or external libraries.
Tools like
IWYU
can help identify missing or unused include statements.
GCC 15 STL
removed
some superfluous <ostream> includes that may affect code using std::endl without including <ostream>.
It’s a common mistake to assume that <iostream> includes std::endl.
When checking code to ensure that std::endl code files include <ostream>, consider if the code could use \n newline instead to improve code
performance
by avoiding unnecessary stream flushing with std::endl.
Part of checking if \n can be used instead of std::endl is to observe if downstream code requires the output buffer to be flushed – for example in interactive
CTest
runs.
The Raspberry Pi 5 power management IC
PMIC
is the Renesas DA9091, a chip
specifically designed
for the Pi 5.
The Raspberry Pi 3B+ and
Raspberry Pi 4 PMIC
is the MaxLinear MXL7704.
Older Raspberry Pi models used
custom circuitry
or the
APX803
instead of a COTS PMIC to handle sequencing of discrete DC power input to the Pi subsystems.
It has been
noted
that damaging the PMIC can make the Raspberry Pi too difficult to repair.
A yellow lightning bolt is GPU-superimposed on the Raspberry Pi display output for low voltage.
In general computing platform operation is not guaranteed with voltages out of tolerance.
The SD card can become unreadable, the Pi may have random malfunctions, and corrupt data (bad writes) on the SD card.
Raspberry Pi 4 and Pi 5 require a minimum 5 Volt 3.0 Amp power supply.
Using peripherals can require higher current supply.
The cable between the power supply and Raspberry Pi must be of good quality to minimize voltage drop and unstable operation.
The USB-C power connector of the Raspberry Pi 4 and Pi 5 is markedly more robust than the micro-USB power connector of legacy Raspberry Pi models.
If the DC input voltage falls below 4.65 volts (depending on Raspberry Pi model and firmware), the GPU superimposes a lightning bolt graphic on the display output.
This may not be visible on a VNC remote desktop.
The Raspberry Pi 5 added
vcgencmd pmic_read_adc
to read DC input voltage and the several generated voltages and currents consumed.
On older Raspberry Pi models there is no built-in capability to measure the Raspberry Pi DC input voltage without adding an external ADC.
On the older Raspberry Pi (older than Pi 5) it may be possible to read the input voltage binary state (OK or low) from the Terminal, but we have not confirmed this.
On the Raspberry Pi 1 B+ and Pi 2 it may be possible to
read state of GPIO 35,
depending on the hardware and firmware.
On the Raspberry Pi 3 in may be possible to
read GPU-driven LED status.
When compiling programs with concerns about excessive power consumption, consider not compiling in parallel.
For GNU Make, “make -j1” uses 1 CPU core.
For Ninja compilation in parallel is default, so specify “ninja -j1” for one build thread.
For meta-build systems limit build parallelism like CMake
cmake --build build -j1
or Meson
meson compile -j1
lynx
is a text web browser that allows browsing certain websites without need for a graphical display.
Several other text-based web browsers for Terminal are available, and while they offer some measure of increased security due to their lacking JavaScript or easily disabling JS, there have been CVEs for these web browsers as well.
With this type of browser using a custom engine, the web-browsing data bandwidth can be dramatically less than with general graphical web browsers as the graphics and JavaScript might simply be ignored and not downloaded.
This orders of magnitude reduction in data usage can be useful for those with limited data plans or slow connections.
This can be useful at remote arctic sites or on a satellite connection.
However, the lack of a general web browser backend engine like Chrome or Firefox can lead to many websites not rendering properly or at all.
An alternative approach is to render the website remotely and send only rendered text over a secure connection like SSH.
This achieves dramatic data bandwidth reduction to the remote site by rendering at a server with a normal full internet connection.
An implementation of this approach using a headless Mozilla Firefox is
browsh.
Browsh
keybindings
or mouse can be used to browse the web in the Terminal.
On Windows, Browsh can be installed by
winget:
Certain platforms default or have defaulted to use a 32-bit time_t, which will
overflow in year 2038.
To check if the platform uses a 64-bit time_t, use code like this
Gist.