Skip to content

Add Windows 64-bit build support (MinGW-w64 gfortran)#22

Open
aminkvh wants to merge 1 commit into
osmart:masterfrom
aminkvh:windows-build-support
Open

Add Windows 64-bit build support (MinGW-w64 gfortran)#22
aminkvh wants to merge 1 commit into
osmart:masterfrom
aminkvh:windows-build-support

Conversation

@aminkvh
Copy link
Copy Markdown

@aminkvh aminkvh commented May 13, 2026

Windows 64-bit Build Support

Adds native Windows 64-bit compilation support using MinGW-w64 gfortran. All 13 HOLE2 executables build and run successfully.

Changes

File Type Description
src/machine_dep.win64 New Windows machine-dependency routines — replaces Unix date shell call with DATE_AND_TIME() intrinsic; DTILDA() is a no-op
src/build_windows.ps1 New PowerShell build script for MinGW-w64 gfortran
src/cguess.f Fix Replace REAL DO loop control variable (DO RCOUNT=-5.,5.,1.) which causes a silent crash in gfortran 16 on Windows; fix is standards-compliant on all platforms
src/hp_flush.c Fix Add flush_() alias for gfortran name-mangling on Windows
README_windows.md New Windows build and usage instructions

How the Linux build is unaffected

The build script copies machine_dep.win64machine_dep.f before compiling. The existing machine_dep.g77 and the Makefile are untouched. The cguess.f fix is backward-compatible.

Tested

  • Compiler: GNU Fortran 16.1.0 (MSYS2/MinGW-w64)
  • OS: Windows 10 x64
  • Verified with gramicidin example (1GRM): Rmin = 1.198 Å, normal completion

Closes #16

- Add machine_dep.win64: Windows machine-dependency routines
  - Replaces Unix 'date' shell call with portable DATE_AND_TIME() intrinsic
  - DTILDA() is a no-op (tilde paths not applicable on Windows)
  - Removes READONLY/SHARED keywords incompatible with gfortran on Windows
- Add build_windows.ps1: PowerShell build script for MinGW-w64
  - Statically linked executables, no DLL dependencies at runtime
  - Builds all 13 HOLE2 programs
- Fix cguess.f: replace REAL DO loop control variable with INTEGER
  - REAL loop variable causes silent crash in gfortran 16 on Windows
  - Behavior identical, fix is standards-compliant on all platforms
- Fix hp_flush.c: add flush_() alias for gfortran name-mangling
- Add README_windows.md: Windows build and usage instructions

Tested: GNU Fortran 16.1.0 (MSYS2/MinGW-w64), Windows 10 x64
Verified with gramicidin 1GRM example (Rmin=1.198 Ang, normal completion)

Closes osmart#16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No hole2 executable for Windows

1 participant