Midnight Commander
is an
open source
Terminal-based GUI for browsing filesystems.
It’s useful to have a non-graphical method to manage and view files, particularly on remote systems over SSH.
Installing Midnight Commander is done by:
Fortran 2018 contiguous arrays are discussed in pp.139-145 of “Modern Fortran Explained: Incorporating Fortran 2018”.
In general, operating on contiguous arrays is faster than non-contiguous arrays.
Contiguous variables happen by default, so unless using pointers or array striding, the variable is likely to be contiguous for simple Fortran code.
Check contiguous status of a variable with is_contiguous intrinsic function.
A non-contiguous array actual argument into a contiguous subroutine dummy argument is made contiguous by copy-in, copy-out.
This copy-in copy-out as needed is part of the
Fortran 2008
and
Fortran 2018
standard.
GCC ≥ 9,
Intel oneAPI,
IBM Open XL Fortran,
etc. work to Fortran 2008+ standard for contiguous dummy argument copy-in, copy-out for non-contiguous actual argument.
CMake can use clang-tidy as a build option for a CMake project by adding a few parameters to CMakeLists.txt.
It’s also possible to use clang-tidy without modifying CMakeLists.txt.
Generate the file compile_commands.json used by clang-tidy.
You don’t have to build the project as we are interested in checking and possibly fixing the C++ source code.
To install clang-tidy:
macOS: brew install llvm, then edit ~/.zshrc, adding the line alias clang-tidy=$(brew --prefix llvm)/bin/clang-tidy or similar
Linux: apt install clang-tidy or similar
cmake -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=on
Run clang-tidy. Specify options or use a file .clang-tidy, which is usually in the top directory of the project.
A project switched to Fortran
mpi_f08
after realizing runtime crashes in very large simulations were due to MPI-2.
The Fortran mpi_f08 interface was released in 2012 and is well supported by contemporary compilers and MPI libraries.
MPICH reqiures
ISO_Fortran_binding.h.
GCC + MPICH or Clang + OpenMPI and many other combinations work.
CMake can retrieve the current time in local (default), UTC, or other timezone via
string(TIMESTAMP).
Elapsed time can also readily be computed or compared using timestamp format %s
Currently, CMake
math
command cannot handle floating point numbers, only integers.
Git
history browsing
can be easier with a GUI, which are available for most platforms.
Git installs
can come with a GUI by default.
However, many package managers make the GUI a separate install to save considerable time and space on cloud servers, virtual machines and similar.
Here are a few example commands to install
gitk,
a basic Git history browser:
macOS: brew install git-gui
Linux: apt install gitk or dnf install gitk or similar
Windows: winget install Git.Git that comes with “gitk”
For those using GitHub,
GitHub Desktop
is a popular Git GUI.
The GitHub Actions CI runners have a recent release of CMake and update regularly, often within weeks of a new CMake release.
There are Actions in the GitHub Marketplace allowing one to pick specific CMake versions for testing the build system if desired.
CMake
environment variables
are handy to set in top level “env” to avoid forgetting to specify them.
Note that Windows compiler tests in general, including CMake, are often done with distinct setups.
These are best shown by example using
MSYS2
or
MSVC.
Programs across programming languages can make
system calls.
System calls can be a significant
security concern.
For example, allowing unsanitized user input is an obvious hazard.
A modern method of making system calls in C and C++ across operating systems is
exec,
known on Windows as
_exec.
An
execlp example
demonstrates casting intptr_t to int for the specific cases where a function is known to use
intptr_t
in this way.