CMake can create
relocatable installer or archive packages
with
CPack.
CPack creates an archive or installer from a CMake project.
C and C++ programs generally use header files (.h or .hpp) that must be part of an installed package.
Fortran programs likewise use module files (.mod) that must be installed.
A basic structure for a CMake project that can create a CMake config-file package is shown in
cmake-package-install.
The boilerplate code under cmake/ directory is only slightly modified between projects.
For example, see h5fortran for more advanced example in cmake/install.cmake and cmake/config.cmake.in.
On Windows, Anaconda Python can install GCC libraries such as libstdc++ and libgfortran et al under miniconda3/Library/mingw-w64/bin.
This path is put by default by fresh Anaconda installation on Path by “conda activate”, but no files are installed there until certain packages are installed.
These libraries are for a particular GCC version, and are not necessarily ABI compatible with the GCC version on the system perhaps from MSYS2.
This problem can manifest as Windows error code 139 when running other executables that need say libstdc++ but Anaconda’s path is overriding the desired GCC lower on Path.
The solution to this problem could be either:
uninstall the conda Python package that installed those libraries
rename the Library/mingw-w64/bin e.g. to bin-backup and see if the needed Python packages still work
We generally recommend using
Ninja with CMake,
especially for large projects.
Ninja speeds up rebuild times significantly and avoids erratic problems with slower GNU Make.
CMake also has the
Ninja Multi-Config
generator
cmake -G "Ninja Multi-Config"
that allows building multiple build configuration types e.g. Debug, Release without CMake regenerating build*.ninja files for each build type with totally distinct build root directories.
Ninja Multi-Config generator options may be used transparently with older CMake and different generators.
The default CMake generator can be set with environment variable:
In general, computers using vPro remote access should not be directly exposed to the Internet.
The computer’s software firewall doesn’t block vPro ports, which exist outside of the operating system.
An external firewall is necessary to protect vPro remote access.
Remote firewall connections to Intel vPro machines can be made via SSH port forward to use Intel AMT KVM.
Don’t open Intel AMT vPro ports ports to the public Internet.
These ports are the minimum that we’ve observed are necessary to use Intel AMT for remote control, including remote power cycling.
Port
Purpose
16993
HTTPS AMT remote web UI
16995
KVM traffic
To diagnose vPro remotely, first connect with the ports above forwarded to the laptop, then browse to https://localhost:16993.
Connect using
MeshCommander
as VNC is no longer supported.
Patching files with
GNU Patch
has been a common task for decades.
Due to
technical issues
with potential patch library implementation, CMake does not include a native patch function.
We use CMake to detect if “patch” is available, which it virtually always is on Unix-like systems.
For Windows, we use
MSYS2
or
WSL.
CMake Patch file repository example
uses standard GNU Patch files across operating systems.
We put the patched file into the binary directory to avoid ambiguity.
The file patching occurs only if the source file changes using canonical CMake approach.
With slight modification, this patching can occur on files obtained via CMake FetchContent, header files, or other resources.
Select: Workloads → Desktop development with C++, then for Individual Components, select only:
Windows SDK
C++ x64/x86 build tools
The build tools allow using MSVC “cl.exe” C / C++ compiler from the command line.
Visual Studio
changed
the
Build Tools
from being C++ specific in late 2017.
Thus newer Visual Studio versions work in place of older versions.
Windows Python needs Visual C++ libraries installed via the SDK to build code, such as via setuptools.extension.Extension or numpy.distutils.core.Extension.
For example, building
f2py
modules in Windows with Python requires Visual C++ SDK as installed above.
On Unix-like operating systems, the C++ libraries are installed with the compiler.
A downside of this prototyping method is reliance on an opaque proprietary toolchain.
If the prototype has a corner case Mathworks didn’t anticipate the project may have to be recoded in another language such as Python that runs directly on the embedded computer.
Another alternative is running the Matlab script directly on the embedded system using GNU Octave.
We have achieved 30+ fps batch processing on video motion streams on the Raspberry Pi Zero with GNU Octave.
Popular Raspberry Pi operating systems can easily install a recent GNU Octave.
apt install --no-install-recommends octave
First try Octave on a laptop to verify the particular Matlab script works with Octave.
If the script doesn’t work with Octave and it seems too difficult to do so, consider transitioning to Python.
Most programming languages have a built-in random number generator.
Using an a priori random seed can be useful in testing simulations using randomness.
In simulations with non-linear growth, small differences at the beginning of the simulations can result in significantly different time evolution of the outputs.
To help test such simulations as compared against known-good reference data, it can be useful to set a known random seed to see that expected outputs result.
The Anker Soundcore Life P2 has excellent sound quality.
For use with more than one device, consider instead earbuds that have
multipoint Bluetooth
(the Soundcore Life P2 earbuds do not have multipoint).
The FCC ID is “2AOKB-A3919RT”.
In general for Bluetooth earbuds of any brand, it’s best to carry the charging container with you to protect and charge the earbuds when not in use.
You may need to manually select “headset” or “stereo” mode in your operating system.
Windows for example allows per-app defaults, or switch by clicking on Windows toolbar speaker icon.
The “pros” or upsides of these earbuds:
Excellent stereo sound quality including aptX
Works well with single earbud (left or right) and auto-enables stereo if 2nd earbud turned on (or mono if 2nd earbud turned off).
four microphones (two per ear) give excellent quality on two-way audio e.g. videoconferencing
holds in ear well with several earmold sizes–comfortable used several hours per day
USB-C charging jack on container, which fits well in pocket
The “cons” or downsides of these earbuds include negative characteristics that are serious enough to consider buying a different model earbud.
no multipoint Bluetooth–switching devices effectively requires repairing each time.
flashing status light annoyingly bright, particularly at night. They are like a “mug me” beacon if walking outside at night.
Sometimes the earbuds lose sync with each other, so that they only function individually not as a stereo pair.
The procedure for resetting / recovering stereo sync is from Soundcore support:
“Forget” the pairing with both Soundcore earbuds on your device
Place the earbuds into the charging case and ensure they are being charged (white light steady)
Press and hold the button on both earbuds for 3 seconds. The LED indicators will flash red 3 times and then turn white briefly. Release the buttons when the light turns white.
Now wait for about a minute.
Take both earbuds out of the charging case, and lay them where you can see each earbuds’ light.
after a few seconds, the white light on one (usually right) earbud will flash quickly, which means it enters pairing mode.
On the phone, add device named “Soundcore” or “Soundcore-L” on the Bluetooth list. The white light will flash slowly, which means it paired successfully.
A few seconds later, there will pop out a screen with “Bluetooth Pairing Request”, just click “Pair” (this step is very important)
In the bluetooth pairing list the Soundcore is displayed as “connected”, and the Soundcore-L is displayed as “not connected”.
In fact, the earbuds are normally TWS paired to work
- name:Put MSYS2_MinGW64 on PATH# there is not yet an environment variable for this path from msys2/setup-msys2run:echo "${{ runner.temp }}/msys64/ucrt64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append