Skip to content

Support building on MacOS and test in CI - #219

Merged
danielhollas merged 26 commits into
masterfrom
macos-build
May 1, 2026
Merged

danielhollas merged 26 commits into
masterfrom
macos-build

Conversation

@danielhollas

@danielhollas danielhollas commented Oct 22, 2025 •

Copy link
Copy Markdown
Contributor

Changes to support MacOS:

  • ldd not available, ignore that error
  • make numdiff.py and test.sh portable
  • make various bash scripts more portable, tail -n 6 instead of tail -6 (same for head)

@danielhollas

Copy link
Copy Markdown
Contributor Author

@JanosJiri would you mind trying to build ABIN and run tests on this branch? I am having trouble to make the tests pass on Github but don't know why

@JanosJiri

Copy link
Copy Markdown
Contributor

@JanosJiri would you mind trying to build ABIN and run tests on this branch? I am having trouble to make the tests pass on Github but don't know why

I tested on my MacBook (M1, macOS Tahoe) and I was able to compile ABIN, yet all the tests failed except for two (the same as here on GitHub). ABIN produces the following error:

 This program was compiled by GCC version 15.2.0
 using the following compiler options:
 -cpp -iprefix /opt/homebrew/Cellar/gcc/15.2.0_1/bin/../lib/gcc/current/gcc/aarch64-apple-darwin25/15/ -D__DYNAMIC__ -D GIT_COMMIT='600cbe5c46a995e11af3f907ceb8ad46fdc1618b' -fPIC -mmacosx-version-min=26.0.0 -mcpu=apple-m1 -mlittle-endian -mabi=lp64 -O2 -Wall -Wno-integer-division -Wno-maybe-uninitialized -fopenmp -fimplicit-none
 ######################################################      

           RUNTIME INFO

 Running on node:
JiriMacBook
Working directory:
/Users/janosj/Downloads/ABIN/tests/SH_BAECK-AN

 /Users/janosj/Downloads/ABIN/bin/abin -x mini.xyz -v velocities.in

sh: ldd: command not found
Fortran runtime error: EXECUTE_COMMAND_LINE: Invalid command line

Error termination. Backtrace:
#0  0x104792103
#1  0x104792cd7
#2  0x104792fdf
#3  0x1048cefbf
#4  0x1048cf157
#5  0x1048cf297
#6  0x10451d993
#7  0x104525fbb
#8  0x1044c8e07
#9  0x10452e39f

@danielhollas

Copy link
Copy Markdown
Contributor Author

Thanks, that was very helpful. Now most tests pass, but still something wrong with some surface hopping tests.

@JanosJiri

Copy link
Copy Markdown
Contributor

Thanks, that was very helpful. Now most tests pass, but still something wrong with some surface hopping tests.

I tried running the tests and this wast the error in abin.out.

Process ID (PID): 74848
Number of OpenMP threads: 1

Initializing Surface Hopping
Using analytic ab initio couplings.
Rescaling velocity along the NAC vector after hop.
If there is not enough energy, try rescaling along the velocity vector.
tail: -: No such file or directory
tail: 6: No such file or directory
ERROR: Could not read gradients from file engrad.dat.001
ERROR at force_abin.F90:314 External forces error
STOP 1

@danielhollas danielhollas mentioned this pull request Apr 30, 2026
Comment thread src/compile_info.F90

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file are purely cosmetic

@danielhollas
danielhollas requested a review from JanosJiri April 30, 2026 15:56
@danielhollas

Copy link
Copy Markdown
Contributor Author

Alright, @JanosJiri, I think things should now be working! Can you test again?

In terms of PR review, please take a look at #237 first, where I've split some minor changes not related to macos.

It would be also nice to test some actual interface, the easiest would probably be ORCA since you can download their MacOS arm64 binaries. But that testing can be done later when you have time.

@danielhollas danielhollas mentioned this pull request Apr 30, 2026

@JanosJiri JanosJiri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, it's cool to run ABIN on Mac. All the changes here look fine to me and the tests pass for macos-15 here. However, two tests do not pass on my macbook: SH_BUTCHER_PHASE and SH_RK4_PHASE. The problem appears to be in empty restart_sh.bin.diff. The binaries are different based on simple diff -q restart_sh.bin restart_sh.bin.ref but the subsequent diff -y -W 500 restart_sh.bin restart_sh.bin.ref | grep -e '|' -e '<' -e '>' > $test_file.diff produces empty file, which then breaks numdif.py.

=======================
Entering directory SH_BUTCHER_PHASE
Comparing numerical differences in file hopgeom.3.2.6.xyz.diff
Comparing numerical differences in file restart.xyz.5.diff
Comparing numerical differences in file restart.xyz.diff
Comparing numerical differences in file restart_sh.bin.diff
File 'restart_sh.bin.diff' is empty!
Comparing numerical differences in file stateall_grad.dat.diff
Comparing numerical differences in file wfcoef.dat.diff
SH_BUTCHER_PHASE FAILED
=======================

and

=======================
Entering directory SH_RK4_PHASE
Comparing numerical differences in file bkl.dat.diff
Comparing numerical differences in file restart.xyz.10.diff
Comparing numerical differences in file restart.xyz.diff
Comparing numerical differences in file restart_sh.bin.10.diff
File 'restart_sh.bin.10.diff' is empty!
Comparing numerical differences in file restart_sh.bin.diff
File 'restart_sh.bin.diff' is empty!
Comparing numerical differences in file wfcoef.dat.diff
SH_RK4_PHASE FAILED
=======================

Comment thread .github/workflows/gfortran.yml Outdated
@codecov

codecov Bot commented May 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.02%. Comparing base (3d4cb5d) to head (462d52e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #219      +/-   ##
==========================================
+ Coverage   78.10%   84.02%   +5.91%     
==========================================
  Files          47       47              
  Lines        5938     6617     +679     
  Branches      668      766      +98     
==========================================
+ Hits         4638     5560     +922     
+ Misses       1124      858     -266     
- Partials      176      199      +23     
Flag Coverage Δ
unittests 18.35% <0.00%> (+0.79%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/compile_info.F90 100.00% <100.00%> (ø)
src/init.F90 82.62% <100.00%> (+6.76%) ⬆️

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danielhollas

Copy link
Copy Markdown
Contributor Author

However, two tests do not pass on my macbook: SH_BUTCHER_PHASE and SH_RK4_PHASE.

I've opened #239 as a follow-up to this. Going to merge since this is clearly a big improvement already.

@danielhollas
danielhollas merged commit 8f08506 into master May 1, 2026
27 of 28 checks passed
@danielhollas
danielhollas deleted the macos-build branch May 1, 2026 11:29
@danielhollas danielhollas changed the title CI: Macos build Support building on MacOS and test in CI May 1, 2026
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.

2 participants