For moderately advanced tasks in CMake it can be useful to get the CPU count to allow building or testing in parallel with non-CMake-based
ExternalProject.
Building a non-CMake ExternalProject from CMake with GNU Make by default builds serially, which can be very slow.
This is because CMake doesn’t know if the non-CMake ExternalProject is capable of being built in parallel.
When it’s known that the non-CMake-based ExternalProject can be built in parallel, it’s necessary to get the CPU count in CMake as simply putting make -j can
overwhelm the computer.
Continuously transmitted subaudible squelch systems such as CTCSS (Continuous Tone-Coded Squelch) and DCS (Digital Coded Squelch) are available on FM radios including CB radios so equipped.
CTCSS
on CB radio allows maximum range while virtually eliminating unwanted static and skip from other users.
FCC WT
Docket 10-119
permits FM frequency modulation, optionally with CTCSS and DCS on CB radio, along with
FM mode
and other long-awaited and useful features to the American public.
We will call CTCSS and DCS “coded squelch” for short.
Subaudible coded squelch is reliable for communications systems that have adequately high SNR and are frequency stable.
For example,
satellite downlinks,
broadcast radio remote control,
utility control,
broadcast radio identification,
which are all applications that have a long time to decode repetitive signals.
Mobile two-way radio has typically weak and fading signals with interference from co-channel users and general noise.
The squelch should open quickly (say with half a second) and close quickly at the end of the transmission to avoid annoying bursts of noise.
The coded squelch must tolerate Doppler shift and frequency drift between transmitters and receivers.
Subaudible continuous coded squelch is not available on AM modes in general.
Some communications receivers have coded squelch that also seems to work in AM, whether by accident or design.
I have tested such receivers with a signal generator and on AM mode, coded squelch can seem to “work” on the bench.
Why then isn’t AM mode CTCSS or DCS generally available?
The following sections explain why CTCSS and DCS are only useful on FM radios.
Selective calling on AM and SSB is available by on-channel signaling such as Selcall CCIR 493-4.
Selcall CCIR 493-4 is a selective calling system that works on AM and SSB by using in-band signaling that takes several seconds at the beginning of a conversation to open the squelch of one, many, or all receivers in a group.
Selcall is used in HF marine radio, HF land mobile radio, and HF amateur radio and is also legal for CB radio in the USA.
FM receivers have a threshold effect that makes them less susceptible to noise than AM receivers.
Once the input signal exceeds the noise floor sufficiently, the output SNR increases dramatically.
This is the threshold effect.
The threshold effect is why FM is less susceptible to noise than AM.
The FM capture effect is a similar phenomenon where the FM receiver tends to hear only the strongest signal once it’s a little bit stronger than all the other signals.
These two effects make CTCSS, DCS, and other subaudible modulation like LTR work extremely well on FM, but are completely impractical on AM for mobile two-way communications systems.
Continuous subaudible coded squelch modulation must not consume too much of the available modulation bandwidth, or the output SNR (audio quality at the receiver’s speaker) will suffer.
In FM systems, the deviation of the subaudible information has generally been accepted by industry and de facto standards in the range of 15% .. 35% of the deviation of the main audio signal.
For example, on obsolete 5kHz deviation FM systems, the CTCSS, DCS, or trunked subaudible deviation would be 750-1000Hz.
In 2.5kHz deviation FM systems, the subaudible deviation would be 375-500Hz for CTCSS or DCS, and 800 Hz for LTR trunked subaudible modulation.
Practical experience with 450 MHz and 900 MHz SMR trunked systems led some operators to set the LTR subaudible deviation to 1000 Hz instead of 800 Hz despite the 2.5 kHz maximum total FM deviation, compromising the audio quality and output SNR of the main signal.
If we apply the same principles to AM, we would have to reduce the modulation depth of the main audio signal to accommodate the subaudible tone.
This would reduce the output SNR of the main signal, which is already compromised by the nature of AM.
The output SNR of AM is generally lower than FM, and the modulation depth of AM is already limited by the need to avoid overmodulation.
Adding a subaudible tone to AM would further reduce the modulation depth of the main signal, reducing the output SNR of the main signal.
This would reduce or eliminate the slight advantage AM has over FM in weak input SNR conditions.
By way of reference, in broadcast AM (530-1710 kHz) the subaudible modulation depth by 47 CFR § 73.1570 (b)1(ii) is limited to 6% of the total modulation depth.
Utilities that used broadcast AM subaudible tones for remote control of transmitters with such little modulation assumed a powerful signal and consistent input SNR with fixed location receivers.
Canadian patent CA1149023A discusses using angle modulation of the carrier frequency within 20 Hz of nominal channel center frequency to avoid the typical 5% modulation depth limit of AM.
The broadcast AM subaudible signaling standard was field tested in about 1969 as discussed in
FCC Docket 17873
that permitted AM broadcast subaudible signaling.
The
C-QUAM AM stereo
system uses a 25 Hz phase-modulated tone at 5% deviation to indicate stereo availability.
Once again, strong signals and consistent input SNR are necessary for successful detection of the pilot tone, and detection is not near-instantaneous as required for coded squelch.
Suppose a 5% subaudible modulation depth is used on CB Radio for coded squelch.
The power in each sideband of the subaudible tone would be 50 milliwatts (0.05 Watts) for a 4 watt carrier.
The input SNR would have to be sufficient to decode the subaudible tone.
The output SNR of the main signal would be reduced by the subaudible tone.
Thus the useful communications range between stations would be so dramatically reduced to open the coded squelch that the feature would be impractical with AM mode.
When more than one carrier is above the noise level in an AM communications receiver, the carriers produce a beat frequency defined by the difference in carriers’ frequencies.
The beat frequencies may typically fall within the subaudible tone range given modern transmitter frequency stability.
This can cause false squelch opening on the receiver.
Conversely, the beat frequencies may interfere with the subaudible tone, causing the receiver to not open squelch when it should.
This CMake
function
works across Windows, macOS, and Linux checks that the current CTest script is the only instance of CTest running at the time.
We use this in CTest CDash scripts to avoid unexpectedly long-running scripts overlapping with the next day’s runs.
That could exhaust memory and crash the computer.
FCC Part
95.1763
defines GMRS frequencies.
The FCC has
declined
to assign specific frequencies to specific channel numbers for GMRS / FRS.
Channel numbering and presentation can vary by manufacturer and model generation.
In practice, many current FRS/GMRS radios use a common 22 channel layout, while some older or vendor-specific models (such as intercoms) use a different ordering.
For reliable interoperability, verify the channel-to-frequency mapping in the manual for the specific radio model.
GMRS arbitrary channel to frequency mapping contrasts with some other radios with FCC fixed chanenl to frequency mapping like:
There are only 22 simplex channels assigned to GMRS.
When a GMRS radio has more than 22 channels, the additional channels are often used for repeater inputs, or they may be duplicates of the simplex channels with specific CTCSS tones or DCS codes assigned to them.
For those using a legacy CB radio like a Cobra 25, 29 or Uniden PC 78 or similar, one may notice a “Delta Tune” knob.
This knob is normally set to the center position.
In case of strong adjacent channel signals, the Delta Tune can be adjusted to shift the receiver tuning down in frequency (counter clockwise) or up in frequency (clockwise) to improve reception of weak signals on the desired channel.
The amount of shift is radio dependent, perhaps 1 to 2 kHz, and is not a precise adjustment.
The Delta Tune doesn’t help splatter from overmodulated signals, but it can help with strong adjacent channel signals that are close in frequency to the desired signal.
For example, if one desires to talk on channel 10, but there is a strong signal on channel 11, turn the Delta Tune knob counter clockwise to shift the receiver tuning down in frequency to improve reception of weak signals on channel 10.
Tuning too far may cause the desired signal to be shifted out of the passband, so adjust the Delta Tune knob while listening to the desired signal.
Delta Tune affects only the receiver tuning, not the transmitter frequency.
An affordable base station antenna for GMRS, MURS, or CB radio can be made from a mobile antenna at roof or balcony level.
Be sure the antenna is well away from power lines for safety and noise.
Whether mobile or base, it’s important to get the tip of the antenna higher above ground level vs. antenna length.
That is, an antenna up high and clear of obstructions within about 1/2 wavelength is often better than a longer antenna at ground level.
A mobile antenna near the roof peak using half a mirror mount can screw into the metal eaves for groundplane.
A satellite TV dish mount can also be used, assuming a lightweight CB antenna that doesn’t significantly exceed the weight or wind load of the dish mount.
A 3 ft long loaded mobile antenna (like Wilson Little Wil) may perform about 13 dB worse than an antenna like Antron 99 mounted at the same height and location.
At 27 MHz CB, the communication range is significantly affected by antenna efficiency, which included antenna loading and groundplane coupling.
A 3 ft long loaded mobile antenna may have significantly less range than a 9 ft long 1/4 wavelength antenna, even if the SWR is low enough to be acceptable.
An Antron 99 (USA Patent 4,360,814) is a popular base station antenna introduced circa 1984, but as with most CB end-fed monopole vertical base station antennas, it’s about 18 feet (1/2 wavelength) long and may be too long for some locations.
If the antenna is not mounted to metal, a counterpoise / groundplane can be employed at least by drooping a wire or wires 1/4 wavelength long (27 MHz CB ~ 9 feet) from the ground of the antenna base, connected to the coax cable shield.
Consider using a thin vertical wire with a vertical fiberglass or other non-conductive support to keep the center pin-connected wire from drooping and touching the ground or other objects.
The groundplane wires should be kept away from the center-pin connected wire element of the antenna to avoid coupling and detuning the antenna.
The groundplane wires can be drooped at an angle (ideally about 45 degrees below horizontal) to reduce coupling and detuning.
For higher frequency MURS and GMRS or as a compromise at CB 27 MHz, a magnet mount antenna could be attached to a large dog kennel or magnetic baking sheet.
A mobile mag-mount antenna on the roof will perform poorly without a large magnetic surface to attach to.
For safety, put weight (e.g., a sandbag) on the groundplane to avoid it from blowing off the structure from high winds.
Specifically for CB radio (27 MHz antennas), a flat metal area is important for the mag-mount antenna to attach to, to establish the proper groundplane coupling.
Putting a 27 MHz mag-mount onto a mesh or other non-uniform flat surface is likely to have poor coupling, high SWR, and degraded performance.
The groundplane can be smaller than expected and still be usable, but with less range than is possible with a larger groundplane.
Just because the SWR is low enough (below 2:1) doesn’t mean the antenna is performing well, as the SWR can be low but the antenna may not be radiating efficiently due to poor groundplane coupling.
Important factors for maximizing communications range include:
antenna tip height above average terrain
freedom from interference (noise, undesired signals)
antenna efficiency – 1/4 wavelength radiating element is desired – balancing length, weight and aesthetics. The mobile antenna should be of a type at least 3 feet long to be worthwhile as a base antenna for effective communication range.
antenna blockage by the roof or adjacent structures
ensure the power supply is linear to avoid noise–especially important at 27 MHz CB.
Depending on favorable terrain, base-to-base communication range on CB using omnidirectional antennas with at least 1/4 wavelength antenna with base (bottom) height of the antenna about 20 feet above ground, in clear terrain, and with clear channels can legally reach using various emissions modes:
AM / FM: 15 miles
SSB: 25 miles
Whereas a less ideal situation about 10 feet above ground with some obstructions about 10 feet away may have maximum base-to-base range like:
AM / FM: 5 miles
SSB: 10 miles
Or base at 10 feet above ground to mobile may be have maximum range like:
AM / FM: 3 miles
SSB: 5 miles
A base station mobile antenna in an urban area on a first-floor deck (say 5 feet above ground) may have only:
AM / FM: 0.5 mile to 1.5 miles
SSB: 1 mile to 3 miles
This is similar to simply having a portable unit at the base location.
Getting the antenna up with a reasonable groundplane on a second-floor balcony or roof (say 15 feet above ground) can significantly increase the range, say 3 miles to 5 miles to other base stations, and perhaps 1.5 miles to 2.5 miles to mobile units.
A primary limit on range for antennas below the average roofline in the neighborhood is the blockage of the roof and adjacent structures, which can significantly reduce the effective range.
Consider an antenna on a pole 20+ feet away from taller structures to reduce blockage and increase range - experiment first being making permanent installations, to find the best location for the antenna.
Use conversations with other distant radio users, and measure the background noise level at various locations. Compare background noise levels at various locations; a change of just 3 meters can make a significant difference in noise and interference levels, and thus effective receiving range.
In any RF commmunications or broadcast system, range is not fully predictable without experimentation.
use a handheld or mobile radio temporarily to test a proposed location before making significant purchases.
Estimate communications range using a voice activated recorder at the base station and drive around, giving location on each transmission.
Compare CB range to MURS or GMRS range with multiple radios near the recorder.
FM mode is strongly preferred for family and neighborhood communications.
For CB radios capable of
FM and CTCSS,
the squelch can be set to only open for the group’s chosen CTCSS tone.
The choice of FM mode and CTCSS is not about maximum communication range, but about reducing interference from other users on the same channel.
If the family members or group turns off the radio because of static and interference, that’s no radio at all.
CB radio now largely matches other license-free radio bands like MURS and GMRS that have always supported FM and CTCSS.
A CB radio provides advance notice when members of a family or group are coming back home.
This gives some peace of mind in case of a breakdown, in that the home base or another base station can be reached on the local channel.
Many developers already use
Visual Studio Code,
which is a free open-source program available for Linux, macOS and Windows.
VS Code can do
Git 3-way merge.
On Windows, when building an executable target in Debug mode using Visual Studio or Intel oneAPI, it may be necessary to also have the libraries linked by the target to have Debug symbols.
For example, when building in CMake:
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.cpp.obj
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.cpp.obj
The solution is to build the libraries with Debug mode as well.
macOS package managers allow easy download, build and install of developer programs and libraries.
Homebrew
is by far the most popular macOS package manager.
Homebrew has a large number of packages and the ability to create unofficial “taps” to easily distribute software.
Homebrew taps allow distributing binaries via Homebrew before going to include in the main homebrew package repo, which takes time and justification.
Homebrew distributes per-OS compiled binaries, so package install time is almost instant.
It is possible to also download source and build locally with Homebrew if desired.
MacPorts
generally distributes source code that is compiled on install, although it can also use precompiled binaries.
Macports installs packages under a
prefix.
Homebrew is much more popular than MacPorts or
Fink.
Anaconda Python puts itself first on PATH when activated.
This can become a problem for libraries like HDF5, where “conda install h5py” puts
compiler script h5cc
on environment variable PATH before the intended script path.
For systems where Homebrew is used to provide packages to find from CMake, tell CMake to prefer a package location with
CMAKE_PREFIX_PATH.
This can be done a few different ways:
Setting CMAKE_PREFIX_PATH in the environment before running cmake:
exportCMAKE_PREFIX_PATH=$HOMEBREW_PREFIX
Setting CMAKE_PREFIX_PATH as a command line argument to cmake: