Scientific Computing

Kill (force end) a program in Windows Terminal

On Linux or macOS one can kill (force end) a program in Terminal by program name using the pkill command. Windows users can similarly kill a program in Windows Terminal by program name using the taskkill command. For example, suppose that Notepad is so locked up that even using Task Manager to end the program doesn’t work - or a non-GUI way of killing a program is desired. From Windows Terminal force end a program by name like:

taskkill /IM notepad.exe

Similar to “pkill” that sends SIGTERM by default on Unix-like systems, the taskkill command above sends a request to the program to terminate gracefully. If the program does not respond, the “/F” option of “taskkill” can be used to force end a program:

taskkill /F /IM notepad.exe

This is similar to a Unix-like system SIGKILL “-9” signal, which can be sent to a program using the “pkill” command like:

pkill -9 notepad

Lower power microwave ovens can be better

Microwave oven power levels are often prominently displayed, along with their cooking volume. However, larger volume means a larger exterior case, which can waste counter space. Many people are using microwaves for a far smaller volume of food than the maximum capacity, which can lead to uneven cooking. It’s quite important to use “power level” appropriate for the type of cooking being done - reheating vs. defrosting vs. cooking frozen foods, etc. The downsides of higher power (1000 watt plus) microwave ovens include:

  • non-inverter microwave ovens are only on-off to modulate power level, and the “on” portion can be so intense that it can overcook or dry out food, especially when reheating or defrosting.
  • many people do not use the “power level” setting, and the default high power setting is way too intense for refrigerator reheating or defrosting.

A lower power say 0.7 cubic foot microwave oven with 700 watts of power can be far better suited for countertop use. For those users who don’t use the “power level” setting, 700 watts full power is like a 63% power setting of a 1100 watt inverter microwave oven, which is a more reasonable power level for reheating. It’s still beneficial to use power level setting on a 700 watt oven.

Apple Studio Display diagnose Thunderbolt connection

The Apple Studio Display has an onboard CPU with upgradable firmware and uses a Thunderbolt connection from the computer. The 2022 first generation Apple Studio Display uses Thunderbolt 3, and the 2026 second generation Apple Studio Display uses Thunderbolt 5. If Thunderbolt connection isn’t available (due to the computer or cable) then the Studio Display falls back to DisplayPort mode, which lacks features like wake from sleep.

Querying the display Thunderbolt connection is distinct but straightforward across operating systems:

Windows

Get-PnpDevice -PresentOnly | Where-Object { $_.FriendlyName -match 'Thunderbolt|USB4' } | Format-Table Status, Class, FriendlyName, InstanceId -AutoSize

The first generation Apple Studio Display will have a FriendlyName like “Thunderbolt 3(TM) Router, Apple Inc. - Studio Display”

macOS

system_profiler SPThunderboltDataType | grep -A 20 -i "Studio Display"

The Studio display should show up detailing the Thunderbolt connection.

Linux

The bolt utility is available on many desktop Linux distros:

boltctl list -a

and similar should show Thunderbolt-connected display. Alternative:

lspci | grep -iE 'thunderbolt'

Use MSVC in GitHub Actions

GitHub Actions using MSVC in the past might have used the msvc-dev-cmd action, but as of this writing it was last updated in 2023 and giving deprecation warnings. An alternative without needing an Action was based on libass project:


    steps:
    # from https://github.com/libass/libass/blob/0.17.5/.github/workflows/meson.yml#L118-L125
    - name: Setup MSVC
        run: |
        $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
        $vsPath = & $vswhere -latest -products * -property installationPath
        if (-not $vsPath) { throw "Could not find a Visual Studio installation" }
        "VS=$vsPath"
        "VS=$vsPath" >> $env:GITHUB_ENV

This works for ARM64 and x64 builds, example

CMake GCC superbuild

This CMake project builds GCC and high level GCC prerequisites such as GMP. This avoids needing to manually download and configure each project. The CMake GCC superbuild assumes fundamental prerequisites such as libc, autotools, make, CMake are present. The 3-stage compiler bootstrap is enabled to help ensure a working, performant GCC.

Alternative: Homebrew GCC pin script.

Clang-cl and Flang Fortran

Visual Studio can install the LLVM Clang compiler including clang-cl, which is LLVM Clang with an MSVC-compatible command-line interface. Clang-cl helps developers use Clang as a replacement for the Microsoft Visual C++ compiler. The Visual Studio 18 2026 release brought along the LLVM Flang Fortran compiler, but Flang with Visual Studio is currently mostly broken due to missing .mod modules. We demonstrate this issue here as other compilers could be similarly broken if incompletely or improperly installed, as might happen on HPC or cloud resources.

program test
use, intrinsic :: iso_fortran_env
end program

The MSYS2 flang works with that program, but the Visual Studio 2026 Flang does not, as it cannot find the “iso_fortran_env.mod” module.

Compilers like NVHPC and LLVMFlang have actual files like “iso_fortran_env.mod” installed with the compiler. Gfortran and Intel Fortran don’t have a physical file corresponding to these intrinsic Fortran modules. In part since Flang itself isn’t yet working in Visual Studio 2026, CMake isn’t able to recognize the Flang compiler with the ClangCL toolset.

cmake -B build -G "Visual Studio 18 2026" -T ClangCL -DCMAKE_Fortran_COMPILER=flang

results in errors about devenv and “unknown” Fortran compiler. Once Flang is fixed within Visual Studio, hopefully CMake will add support for the Flang compiler with the ClangCL toolset, as this would save users the effort of installing Intel oneAPI if they only want Visual Studio with Fortran.

VNC advantages over X-Forwarding

VNC advantages over X-forwarding include a faster, more responsive whole desktop vs. individual applications. Bandwidth compression means VNC can consume kB/sec instead of X-forwarding that may be up to MB/sec. Upon disconnect and reconnect, the VNC desktop can still be there as it was, whereas single application X-forwarding loses the application state.

To use VNC to HPC, usually the VNC is tunneled over SSH for security, as traditional VNC is not encrypted. The VNC server is already running on the HPC (or started by the user per HPC system documentation), and the user runs a VNC client on their local machine to connect to the VNC server on the HPC. For user workstations, the user might setup a VNC server. Numerous open-source or no-cost VNC clients are available including TigerVNC.

  • Windows: winget install --id TigerVNC.TigerVNC -e
  • macOS: brew install --cask tigervnc
  • Linux: apt install tigervnc-viewer or dnf install tigervnc

Then connect the SSH tunnel for VNC and run the VNC client to connect to the VNC server on the HPC or remote computer.

BZip2 1.1 development archived

It appears that on about July 8, 2026 the BZip2 1.1 development repository was archived with the message:

BZip2/libbz2 is a program and library for lossless, block-sorting data compression. This fork for v1.1+ development is has been archived due to lack of interest, and because there are better options available through the Rust ecosystem.

and further discussion. This Gitlab repo was linked from the original SourceWare BZip2 page.

Fortran compiler standard enforce

Fortran compilers typically have options for enforcing Fortran standards. The compilers raise additional warnings or errors for code that is not deemed compliant. Fortran standard options can make false warnings, so we generally do not enable standards checking for user defaults. However, we do enforce implicit none as a quality measure.

It’s also important to use implicit none so that each variable must be assigned beforehand. We recommend the Fortran 2018 statement:

implicit none (type, external)

which requires explicitly defined procedure interfaces as well.

type
the traditional implicit none default
external
new for Fortran 2018, requires explicit interface for external procedures.

GCC Gfortran -std=f2018 enforces Fortran 2018 standard. Consider these Gfortran options:

gfortran -fimplicit-none

LLVM Flang similarly uses -std=f2018 and similar, as well as:

flang -fimplicit-none

Intel oneAPI -stand:f18 enforces Fortran 2018 standard. Consider these options that also enforce implicit none:

ifx -warn:declarations

Cray Fortran compiler enforces implicit none via option:

ftn -eI

note that’s a capital “I” not a lowercase “ell”.

Nvidia HPC Fortran compiler enforces implicit none via:

nvfortran -Mdclchk

NAG Fortran has -f2018 Fortran 2018 flag. Enforce implicit none by:

nagfor -u

CMake logic to enforce these standards:

if(CMAKE_Fortran_COMPILER_ID STREQUAL "Cray")
  add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-eI>")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU|LLVMFlang")
  add_compile_options(-Wall "$<$<COMPILE_LANGUAGE:Fortran>:-fimplicit-none>")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
  add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-warn:declarations>")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
  add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-Mdclchk>")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "NAG")
  add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-u>")
endif()