Docker images are useful for reproducibility and ease of setup and for software binary distribution on platforms not natively available.
For example, it may be desired to distribute a statically-linked binary that will run on any Linux system with compatible CPU architecture and kernel system calls.
To setup and maintain Docker images, it’s useful to have
Docker Desktop
available on the developer laptop to debug and test Dockerfiles.
Read the install instructions particular to the laptop OS to understand OS-specific caveats and features.
For example, on Linux laptops, to avoid the need for “sudo” in every command, follow the
post-install.
Docker commands can be run from the system terminal if desired–all commands in this article assume this.
Docker images by default will be downloaded to run locally.
Try the Hello World images, which should auto-download and print a welcome message
docker run hello-world
Search for a desired image using Docker Desktop or docker search.
Consider the “Official” images first.
Let’s use
Alpine Linux.
docker search alpine
Get the desired image
docker pull alpine
Verify the images:
docker images
Start the Docker container:
docker run -it alpine
-it
interactive session
Verify the Alpine version running in the container.
It will have a # superuser prompt.
cat /etc/os-release
Search for desired APK packages from within the container:
Some folder locations in macOS are not accessible by traversing one level at a time from outside or above that location.
In general, it can be convenient to open a terminal window at a specific folder location.
The folder may be opened directly by right-clicking on the folder in Finder and selecting “New Terminal at Folder”.
By default, listing the contents of a directory with
PowerShell
shows file metadata along with the path names within the directory.
Other shells typically show only the path names by default, which is convenient for copy-pasting lists of files or directories into other commands or scripts.
To list only the path names when listing a directory in PowerShell, use the -Name option:
OpenMP
and
OpenACC
are open standards for parallel programming on CPU and GPU shared memory platforms.
While OpenMP has wider compiler support,
OpenACC
also aims to be platform-independent.
OpenMP standard syntax for C, C++, Fortran, and
CUDA
can work seamlessly with non-OpenMP systems if code is properly written.
While OpenMP is typically built in from the factory in contemporary compilers, the compilers may need flag(s) to enable OpenMP.
Build systems like
CMake
and
Meson
can manage the OpenMP compiler flags.
OpenMP is well-supported in commercial computation performance-oriented Fortran compilers like:
OpenMP support in open-source Fortran compilers includes
LLVM
and
GCC.
Open-source compilers such as LLVM Flang need to have the proper OpenMP-enabling flags set when building the compiler by the distribution maintainers.
For example,
Homebrew LLVM Flang
was missing Fortran libomp.mod support due to misconfiguration in the Homebrew
flang formula.
“git clone” clones the default branch of the remote repository as determined by the Git server.
The default Git branch is typically “main”, but the repository owner can change it to any other branch.
To Git clone a specific branch, use the –branch option:
git clone --branch <branch-name> <repository-url>
This can help workaround problems like a default branch that is very large or is broken in some way.
The
Windows error code lookup tool
is a useful resource for finding error codes and messages to incorporate into code that needs to handle Windows return codes.
The tool allow searching by code or exact message match.
Unit test frameworks should be lightweight to setup and maintain.
End users should be able to easily run the unit and integration tests themselves as part of a typical end-user install.
The simplest approach is to write several small test programs and execute them using CMake or Meson.
This method can also be an appropriate choice where the program uses complex library interactions that may not mix well with a generic test framework.
The
Veggies
Fortran test framework is an example of a Fortran unit testing framework.
Check the
Fortran-lang
group for a contemporary discussion on Fortran test frameworks.
Matlab cross-platform capabilities involve cross-platform factors dealing with filesystem and system calls.
The standard library for Matlab
matlab-stdlib
provides several features on top of factory Matlab.
Filesystem functions including
canonicalized paths,
finding executable programs,
and retrieving
filesystem type
are among key capabilities of Matlab-stdlib.
Matlab R2025a makes public the internal functionality introduced in Matlab R2024b.
The
filePermissions
function returns an object like
matlab.io.UnixPermissions
according to the operating platform.
Needless use of administrator “sudo” privileges during install of a library or program is generally undesirable.
Admin / superuser privileges are typically invoked for a single command by
sudo,
including on
Windows.
Casual use of “sudo” can goof up the operating system itself, create cybersecurity risks, and mess up the desired program installation.
The install might do undesirable things like put itself under “/root” directory or make paths non-readable by the non-privileged user.
In general we write procedures without invoking sudo, to avoid careless sudo invocation.
We assume the user knows when it’s appropriate to invoke sudo.
sudo is commonly used with commands installing from repositories like “apt install”.
Python “pip install”
defaults
to
PEP 370--user
if needed.
In general, don’t install with sudo pip or sudo conda to avoid wrecking the system configuration.