Scientific Computing

Shared Fortran / C++ libraries on Windows

Windows has particular linking requirements for shared libraries that can become challenging with MSVC-like compilers such as Intel oneAPI when linking Fortran and C libraries together. In short, the workaround is to use static libraries instead of shared libraries for such cases on Windows.

Example: MUMPS-superbuild project provides MUMPS libraries in the same way as the original MUMPS project’s Makefiles, that is with a library called “mumps_common” and then a library for each of 4 numerical precisions “smumps”, “dmumps”, “cmumps”, and “zmumps” that link against “mumps_common”. This is quite robust across compilers and linkers - the only issue is on Windows with oneAPI when building shared libraries.

Building shared libraries for MUMPS-superbuild is done by:

cmake --workflow shared

Most unresolved externals with oneAPI on Windows were symbols like:

MUMPS_BUF_COMMON_mp_...
MUMPS_OOC_COMMON_mp_...
MUMPS_LR_COMMON_mp_...
MUMPS_LR_STATS_mp_...

A first hypothesis was that auto-export was incomplete. CMake on Windows can auto-export symbols via CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS. In mixed C and Fortran projects, that is often good enough. Given the unresolved names, it was reasonable to suspect missing DATA exports from mumps_common.dll.

We ran a few checks to diagnose:

  1. Inspected linker diagnostics to collect unresolved symbol families.
  2. Inspected generated export definition .def files to see what CMake actually exported.
  3. Compared expected names versus actual exports in the produced DLL/import library path.
  4. Tested oneAPI-specific compile/link flag ideas.

Auto-export did miss symbols that appeared in unresolved lists. But even after supplementing exports, unresolved externals persisted. We tested multiple fixes, including:

  • Supplemental export definitions for missing DATA symbols.
  • oneAPI flag experiments intended to improve dynamic common/module handling.
  • Internal bridge-style link topology changes.

Why these were rejected:

  • Supplemental exports alone did not clear unresolved module-data references.
  • oneAPI flag experiments were either ineffective or unstable for this build.
  • Bridge-link approaches can alter expected import-library behavior and create downstream risk for users linking mumps_common.lib.

The root cause appears to be broader than CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS. Auto-export can be incomplete, but even with explicit extra exports, oneAPI Fortran on Windows still struggled to resolve cross-DLL module/common data references in this configuration.

Practical recommendations

To maintain mixed Fortran/C HPC packaging across compilers, validate shared-library topology on every target compiler, especially Windows. Treat Fortran module/common data across Windows DLL boundaries as a first-class risk. To keep it simple - use static libraries.

Enhancing OS clipboard security

Captchas provide a means to limit automated access to web services. Users have become accustomed to solving captchas to access common web resources. Malicious actors are exploiting users with fake captcha prompts to trick them into pasting malicious content from the clipboard, even when the user never copied the content themselves. There are multiple approaches to mitigate clipboard-based attacks, such as disabling clipboard history and cross-device synchronization. These measures can reduce the risk of accidentally pasting harmful data.

Note that disabling web browser clipboard features may impact legitimate sites (e.g., Google Docs or other cloud editors).

Browser Settings

  • Firefox: In about:config, set dom.event.clipboardevents.enabled to false.
  • Chrome / Edge: Go to chrome://settings/content/clipboard (or equivalent in Edge).
  • Safari: Go to Settings → Websites → Clipboard.

Cross-Device Risks

These attacks become more dangerous when clipboard synchronization is enabled across devices, such as Apple’s Universal Clipboard or Microsoft Cloud Clipboard.

Windows: Disable Clipboard History & Cross-Device Sync

The following policy keys are the most effective way to disable these features:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\AllowClipboardHistory → Set to 0
  • HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\AllowCrossDeviceClipboard → Set to 0

You can check them with PowerShell:

Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory"
Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowCrossDeviceClipboard"

macOS disable Universal Clipboard and clipboard history

To disable Universal Clipboard on macOS, users can turn off the Handoff feature, which is responsible for clipboard synchronization across Apple devices. This can be done by disabling Handoff in System Preferences under the General settings. This prevents the clipboard from being shared between devices, reducing the risk of spreading malicious content. macOS clipboard history can be disabled in System Settings. In the sidebar, click Spotlight. Turn off the toggle for “Results from Clipboard”.

Satellite radio broadcast services

SDARS satellite radio broadcasts of music or video to mobile receivers have largely been a North American phenomenon since the 1990s. Increased need for terrestrial repeaters arose as geostationary SDARS satellites took over from geosynchronous orbits. A key appeal of S-band SDARS is the ability to cover vast areas with a few satellites and coin-sized receiver antennas. The SDARS signal is easily blocked by buildings or terrain, necessitating the use of terrestrial repeaters in urban areas to ensure reliable reception. The SiriusXM 360L receivers seamlessly integrate satellite, terrestrial, and streaming content.

SDARS never took off on other continents, which instead focused on vast terrestrial radio networks such as DAB+ and DRM. DRM is increasingly adopted throughout Africa and Asia, while DAB+ is more popular in Europe. This free DRM broadcast schedule database helps listeners find DRM broadcasts worldwide. It is of note that parts of Europe are trending towards retaining VHF FM broadcast radio (besides DAB+), with multiple nations adding mandates for FM tuners in new cars. North America terrestrial radio networks may use HD Radio for improved audio quality and additional data services. 5G broadcast is being tested by multiple countries as a way to deliver broadcast content to mobile devices instead of individual mobile data streams.

Home satellite TV

In contrast to satellite radio broadcast services, Direct Broadcast Service (DBS) / Direct To Home (DTH) satellite TV has been a global phenomenon with the emergence of sub-60 centimeter dish antennas using 12 GHz Ku-band frequencies by DirectTV and Dish Network emerging in the mid-1990s and analogous services on other continents.

Using dotnet build

For .NET projects using file-based C# .cs apps or .slnx project files, the dotnet build command is used to compile the project and its dependencies. This command is part of the .NET CLI (Command Line Interface) to build .NET applications from the command line. The complementary dotnet run command builds and runs the application in one step. To create standalone, self-contained dotnet publish binary executables cross-compiled for different CPU arches, see CI example.

Zoom Windows install by WinGet

Zoom can be installed and updated by WinGet, automatically installing the appropriate binary for the CPU architecture.

winget install Zoom.Zoom

The 32-bit Zoom client was discontinued in December 2025. If the 32-bit Zoom was originally installed, reinstalling the Zoom 64-bit Windows client will improve Zoom performance, especially choppy audio / video under high CPU usage. It’s generally recommended to use the match the binary architecture to the CPU (e.g. 64-bit program on a 64-bit CPU) to avoid emulation performance penalties. Latency-sensitive 32-bit Windows programs may not work as well as 64-bit programs on 64-bit Windows due to WOW64 emulation for 32-bit programs on 64-bit Windows.

Create RAM drives with open source tools

RAM drives are a filesystem mount point mapped to RAM instead of a hardware storage device. RAM drives are very fast and have high IOPS compared to durable storage devices, which is useful for applications like interprocess communication (when network socket pipes are not usable), temporary files, and caches. Unless synced or copied to durable storage, the contents of RAM drives are ephemeral and may be lost on reboot, logout, or unmounting. We give simple examples of creating / using RAM drives on Windows, Linux, and macOS with open source tools.

Linux RAM drive

On Linux systems, RAM drives are typically built into the OS. Mount points /dev/shm/ and /run/shm/ map shmem shared memory to a RAM drive. They are also present in Windows Subsystem for Linux (WSL).

df -kh /dev/shm
free -h

# Write 1 GB to shmem
dd if=/dev/zero of=/dev/shm/blah bs=10M count=100

df -kh /dev/shm
free -h

See which one has 1GB space more used. This tells if hard drive or RAM was used.

For programs using shared memory for heavy writing operations:

  1. order(s) of magnitude slower /dev/shm/ operations when HDD is used versus RAM
  2. wearing of solid state drive if /dev/shm is pointed there

Example data bandwidths:

  • SSD: 100s of MB/sec
  • HDD: 10s of MB/sec
  • RAM: 1000s of MB/sec

macOS RAM drive

macOS factory program diskutil can create a RAM drive via factory program hdiutil like:

diskutil partitionDisk $(hdiutil attach -nomount ram://2097152) 1 GPTFormat APFS "RAMDisk" '100%'

The command line options are:

partitionDisk
partitions a disk
$(hdiutil attach -nomount ram://2097152)
creates a RAM drive
-nomount
prevents RAM drive from being automatically mounted in Finder
ram://2097152
creates a 1 GB RAM drive (512 bytes/sector * 2097152 sectors = 1 GB)
1
creates 1 partition on the RAM drive
GPTFormat
formats the partition with GPT
APFS
formats the partition with APFS
"RAMDisk"
names the partition “RAMDisk”
'100%'
uses 100% of the RAM drive for the partition

There is a shell utility to simplify the process of creating and managing RAM drives on macOS with command line options. A Swift GUI open source app for those who prefer a graphical interface is also available.

References:

Windows RAM drive

On Windows, RAM drives can be created with the open source tool RamDrive. This is a user-mode RAM drive that can be created and used without administrator privileges, unlike kernel-mode RAM drives such as ERAM.

Update Conda from command line

From time to time generally it’s good to update Conda from Command Prompt / Terminal. Conda itself will remind the user to do this.

conda update -n base -c defaults conda

If it’s been a long time since updating, sometimes instead of updating conda, conda just repeats than an update is available and finally # All requested packages already installed. To workaround this issue, do a complete conda update by:

conda update -n base conda --all

After this, purge old package install info by:

conda clean --all

Install Rust lang on Windows

Even if not directly coding in Rust, one may need to build programs in Rust. For example, to control Apple Studio Display brightness from Windows, one would build the asdbctl Rust program. Many revivals (and newly developed) open-source games are in Rust, such as the classic forest-fire game firefighter.

Rust programs are generally OS-agnostic, unless the Rust code itself uses OS-specific features. Install the Rust toolchain on Windows using WinGet:

winget install --id=Rustlang.Rustup -e

Building and running a Rust program is generally accomplished from the directory containing the Cargo.toml manifest file:

cargo run --release

Intel oneAPI compiler flag syntax

The Intel oneAPI compiler flags are generally somewhat distinct on Windows and Linux. However, there is a platform-agnostic syntax that can be used to specify the flags in a way that works on Windows and Linux without if-else logic needed in the build system (e.g. CMake). The oneAPI OS-agnostic compiler flag syntax is as follows:

-option:value

Where option is the name of the compiler flag and value is the value to be passed to the flag. Observe this is a hybrid of Linux options that use - as a prefix, and Windows options that use : as a separator between the option and its value. This syntax allows developers to write build scripts and command lines that are portable across both Windows and Linux without needing to change the syntax of the compiler flags. This method is used internal to CMake for example, as a demonstration of its robustness.

Fortran Package Manager install

The Fortran Package Manager (fpm) is a tool for building Fortran projects and their dependencies. FPM stands alone, written in Rust, as an alternative to CMake, Meson, or Make for building hierarchies of Fortran projects. The fpm build command is used to build a Fortran project and its dependencies. If a main executable program exists, fpm run runs the executable after building. The fpm install command is used to install a Fortran project and its dependencies. fpm test is used to run tests after building.

FPM itself is easily installed by:

  • Windows winget install FortranLang.fpm
  • macOS: brew install fpm

In general and including for Linux, downloadable FPM binaries are available from the FPM GitHub releases page.