Scientific Computing

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()

Fortran undefined and unused variable warnings

Like other coding languages, Fortran code might have variables that are used before they are defined, or variables that are defined but never used. Uninitialized variables cause unexpected behavior that can be difficult to debug. Variables that are defined but never used are a waste of memory and possibly computation time and make the code less readable. Here is a trivial example of a Fortran program that has an undefined variable, that Fortran compilers generally don’t warn about by default, and may not even be able to warn at compile time.

program test
implicit none
integer :: i, j

i = j + 1
print '(i0)', i

end program test

We provide over 20 such tests in a CMake project that outputs JSON for the compiler tested.

GCC Gfortran 17 new compile-time warnings

GCC / GFortran 17 adds two Fortran compiler options to provide more robust (less false positive and false negative) warnings about undefined and unused variables. This is a potentially significant improvement over the -Wuninitialized and -Wmaybe-uninitialized flags, which operate on the Static Single Assignment (SSA) form and are known to be more likely to produce false positives and false negatives.

These new options are

The new -Wundefined-vars option by Thomas Koenig is in effect a front-end static analysis tool using tables of variable definitions and uses to determine if a variable is used before it is defined.

LLVM Flang Fortran compiler

The LLVM Flang compiler has an option -Wused-undefined-variable that at least in Flang 22.1 didn’t catch the undefined variable in the toy example above, but does catch the unused variable with the option -pedantic. It is mentioned in the Flang forums that the Flang team considers some of the cases Gfortran 17 catches to be for possibly future implemented runtime checks rather than compile-time checks as in GCC 17.

warning: Value of uninitialized local variable ‘i’ is used but never defined [-Wused-undefined-variable]

Intel oneAPI Fortran compiler

Uninitialized variable warnings are a runtime -check:uninit with “ifx” Fortran compiler, not currently available in compile-time -warn.

NVIDIA HPC SDK Fortran compiler

The “nvfortran” compiler nvfortran -help didn’t reveal any options to detect undefined variables beyond the usual -Mdclchk that enforces implicit none - but that’s a declaration check, not a defined variable check.

Xcode 15.x ld_classic linker workaround

Whether using Clang / LLVM or Homebrew GNU GCC compiler, GNU ld is not supported on macOS. Only the Apple macOS Xcode ld is supported. The new ld linker in Xcode 15 broke numerous projects, including OpenMPI < 4.1.6.

A special workaround for Xcode 15.x only is the linker flag -ld_classic, which is deprecated in Xcode 16 and removed in Xcode 27.

Set in file “~/.zshrc”

export LDFLAGS="$LDFLAGS -Wl,-ld_classic"

Note that for CMake, LDFLAGS environment variable is read only on the first CMake configure and cached.