conda-forge / ambertools-feedstock

A conda-smithy repository for ambertools.
BSD 3-Clause "New" or "Revised" License
8 stars 14 forks source link

(Some?) AmberTools 23 binaries do not work on macOS 13 #140

Open mattwthompson opened 5 months ago

mattwthompson commented 5 months ago

Solution to issue cannot be found in the documentation.

Issue

Existing AmberTools 23 binaries (or at least antechamber) crash on macOS 13 where they would fail on macOS 12. This was discovered when GitHub Actions recently bumped macos-latest from using 12 (x64) to 14 (M1) nudging some of us to 13 (the newest x86 runner). @ialibay has found this is limited to the 23/13 combination; older macOS and older AmberTools don't crash like this. Unfortunately we (or at least my projects) must use 23 because sticking with x86 and Python 3.10 is not workable.

There's some stuff in the knoweldge base about macOS SDKs but I don't think it's directly relevant: https://conda-forge.org/docs/maintainer/knowledge_base/#requiring-newer-macos-sdks

https://github.com/IAlibay/partial_charge_experiments/actions/runs/8846838752/job/24293490978 https://github.com/IAlibay/partial_charge_experiments/blob/8bb003f237fa112341d9d306e3a4a1aee5292fac/.github/workflows/at_test.yaml

Run antechamber -i datafiles/CN.sdf -fi sdf -c bcc -at gaff2 -o test.mol2 -fo mol2
  antechamber -i datafiles/CN.sdf -fi sdf -c bcc -at gaff[2](https://github.com/IAlibay/partial_charge_experiments/actions/runs/8846838752/job/24293490978#step:4:2) -o test.mol2 -fo mol2
  shell: /bin/bash -l {0}
  env:
    MAMBA_ROOT_PREFIX: /Users/runner/micromamba
    MAMBA_EXE: /Users/runner/micromamba-bin/micromamba
    CONDARC: /Users/runner/work/_temp/setup-micromamba/.condarc

Welcome to antechamber 22.0: molecular input file processor.

Info: acdoctor mode is on: check and diagnose problems in the input file.
Info: The atom type is set to gaff2; the options available to the -at flag are
      gaff, gaff2, amber, bcc, and sybyl.

-- Check Format for sdf File --
   Status: pass
-- Check Unusual Elements --
   Status: pass
-- Check Open Valences --
Warning: This molecule has no hydrogens nor halogens.
         It is quite possible that there are unfilled valences.
-- Check Geometry --
      for those bonded   
      for those not bonded   
   Status: pass
-- Check Weird Bonds --
   Status: pass
-- Check Number of Units --
   Status: pass
acdoctor mode has completed checking the input file.

Info: Total number of electrons: 0; net charge: 0

Running: /Users/runner/micromamba/envs/test_env/bin/sqm -O -i sqm.in -o sqm.out
/Users/runner/micromamba/envs/test_env/bin/wrapped_progs/antechamber: Fatal Error!
Cannot properly run "/Users/runner/micromamba/envs/test_env/bin/sqm -O -i sqm.in -o sqm.out".
Error: Process completed with exit code 1.

Installed packages

List of packages in environment: "/Users/runner/micromamba/envs/test_env"

    Name                 Version       Build               Channel    
  ──────────────────────────────────────────────────────────────────────
    ambertools           22.5          py39h5c1900f_0      conda-forge
    arpack               3.7.0         hefb7bc6_2          conda-forge
    blosc                1.21.5        hafa3907_1          conda-forge
    boost-cpp            1.78.0        h2f2b2fd_4          conda-forge
    brotli               1.1.0         h0dc2134_1          conda-forge
    brotli-bin           1.1.0         h0dc2134_1          conda-forge
    bzip2                1.0.8         h10d778d_5          conda-forge
    c-ares               1.28.1        h10d778d_0          conda-forge
    ca-certificates      2024.2.2      h8857fd0_0          conda-forge
    certifi              2024.2.2      pyhd8ed1ab_0        conda-forge
    contourpy            1.2.1         py39h0ca7971_0      conda-forge
    cycler               0.12.1        pyhd8ed1ab_0        conda-forge
    cython               3.0.10        py39hd253f6c_0      conda-forge
    fftw                 3.3.10        nompi_h4fa670e_108  conda-forge
    fonttools            4.51.0        py39ha09f3b3_0      conda-forge
    freetype             2.12.1        h60636b9_2          conda-forge
    hdf4                 4.2.15        h8138101_7          conda-forge
    hdf5                 1.14.3        nompi_h691f4bf_100  conda-forge
    icu                  73.2          hf5e326d_0          conda-forge
    importlib-resources  6.4.0         pyhd8ed1ab_0        conda-forge
    importlib_resources  6.4.0         pyhd8ed1ab_0        conda-forge
    kiwisolver           1.4.5         py39h8ee36c8_1      conda-forge
    krb5                 1.21.2        hb884880_0          conda-forge
    lcms2                2.16          ha2f27b4_0          conda-forge
    lerc                 4.0.0         hb486fe8_0          conda-forge
    libaec               1.1.3         h73e2aa4_0          conda-forge
    libblas              3.9.0         22_osx64_openblas   conda-forge
    readline             8.2           h9e318b2_1          conda-forge
    scipy                1.13.0        py39h0ed1e0f_0      conda-forge
    setuptools           69.5.1        pyhd8ed1ab_0        conda-forge
    six                  1.16.0        pyh6c4a22f_0        conda-forge
    snappy               1.2.0         h6dc393e_1          conda-forge
    tk                   8.6.13        h1abcd95_1          conda-forge
    tzdata               2024a         h0c530f3_0          conda-forge
    unicodedata2         15.1.0        py39hdc70f33_0      conda-forge
    wheel                0.43.0        pyhd8ed1ab_1        conda-forge
    xorg-kbproto         1.0.7         h35c211d_1002       conda-forge
    xorg-libice          1.1.1         h0dc2134_0          conda-forge
    xorg-libsm           1.2.4         h0dc2134_0          conda-forge
    xorg-libx11          1.8.9         hc955faf_0          conda-forge
    xorg-libxau          1.0.11        h0dc2134_0          conda-forge
    xorg-libxdmcp        1.1.3         h35c211d_0          conda-forge
    xorg-libxext         1.3.4         hb7f2c08_2          conda-forge
    xorg-libxt           1.3.0         h0dc2134_1          conda-forge
    xorg-xextproto       7.3.0         hb7f2c08_1003       conda-forge
    xorg-xproto          7.0.31        h35c211d_1007       conda-forge
    xz                   5.2.6         h775f41a_0          conda-forge
    zipp                 3.17.0        pyhd8ed1ab_0        conda-forge
    zlib                 1.2.13        h8a1eda9_5          conda-forge
    zstd                 1.5.5         h829000d_0          conda-forge

Environment info

/Users/runner/micromamba-bin/micromamba info -r /Users/runner/micromamba -n test_env

         libmamba version : 1.5.8
       micromamba version : 1.5.8
             curl version : libcurl/8.6.0 SecureTransport (OpenSSL/3.2.1) zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0
       libarchive version : libarchive 3.7.2 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.5
         envs directories : /Users/runner/micromamba/envs
            package cache : /Users/runner/micromamba/pkgs
                            /Users/runner/.mamba/pkgs
              environment : test_env
             env location : /Users/runner/micromamba/envs/test_env
        user config files : /Users/runner/.mambarc
   populated config files : /Users/runner/work/_temp/setup-micromamba/.condarc
         virtual packages : __unix=0=0
                            __osx=13.6.6=0
                            __archspec=1=x86_64-v3
                 channels : https://conda.anaconda.org/conda-forge/osx-64
                            https://conda.anaconda.org/conda-forge/noarch
         base environment : /Users/runner/micromamba
                 platform : osx-64
dacase commented 5 months ago

I don't have an answer, but the origin of the problem arises in the sqm code which is called by antechamber:

Cannot properly run "/Users/runner/micromamba/envs/test_env/bin/sqm -O -i sqm.in -o sqm.out".

Two ideas about how to debug:

  1. Can you get access to the sqm.in file for this case? Is it empty or obviously mal-formed? Also look at the sqm.out file to see if there are any clues there.
  2. Does the problem only show up with sdf input files?

Fewer and fewer Amber developers are using OSX, but some are, with both x86 and Apple silicon hardware. But the compilers being used tend to come from homebrew or macports, and may not be the same compilers that conda-forge is using.

mattwthompson commented 5 months ago

Something's borked in the sqm.in file indeed. From https://github.com/mattwthompson/partial_charge_experiments/actions/runs/8850845954/job/24306045345

2024-04-26T15:48:12.1491180Z ##[group]Run cat sqm.in
2024-04-26T15:48:12.1491890Z cat sqm.in
2024-04-26T15:48:12.1492290Z cat sqm.out
2024-04-26T15:48:12.1639160Z shell: /bin/bash -l {0}
2024-04-26T15:48:12.1639670Z env:
2024-04-26T15:48:12.1640110Z   MAMBA_ROOT_PREFIX: /Users/runner/micromamba
2024-04-26T15:48:12.1640800Z   MAMBA_EXE: /Users/runner/micromamba-bin/micromamba
2024-04-26T15:48:12.1641610Z   CONDARC: /Users/runner/work/_temp/setup-micromamba/.condarc
2024-04-26T15:48:12.1642310Z ##[endgroup]
2024-04-26T15:48:12.3016330Z Run semi-empirical minimization
2024-04-26T15:48:12.3017570Z  &qmmm
2024-04-26T15:48:12.3018100Z     qm_theory='AM1', grms_tol=0.0005,
2024-04-26T15:48:12.3018770Z  scfconv=1.d-10, ndiis_attempts=700,   qmcharge=0,
2024-04-26T15:48:12.3019380Z  /
2024-04-26T15:48:12.3019560Z 
2024-04-26T15:48:12.3039260Z             --------------------------------------------------------
2024-04-26T15:48:12.3040440Z                              AMBER SQM VERSION 19
2024-04-26T15:48:12.3041150Z  
2024-04-26T15:48:12.3041550Z                                      By
2024-04-26T15:48:12.3042530Z               Ross C. Walker, Michael F. Crowley, Scott Brozell,
2024-04-26T15:48:12.3043520Z                          Tim Giese, Andreas W. Goetz,
2024-04-26T15:48:12.3044710Z                         Tai-Sung Lee and David A. Case
2024-04-26T15:48:12.3045300Z  
2024-04-26T15:48:12.3045830Z             --------------------------------------------------------
2024-04-26T15:48:12.3046410Z  
2024-04-26T15:48:12.3046830Z  QM ATOM VALIDATION: nquant has a value of        0
2024-04-26T15:48:12.3047550Z  SANDER BOMB in subroutine validate_qm_atoms
2024-04-26T15:48:12.3048140Z  nquant illegal
2024-04-26T15:48:12.3048510Z  Need 0 < nquant <= natom

Here are the input and output files on my machine (M1, macOS 14) for comparison

In:

$ cat sqm.in
Run semi-empirical minimization
 &qmmm
    qm_theory='AM1', grms_tol=0.0005,
 scfconv=1.d-10, ndiis_attempts=700,   qmcharge=0,
 /
   6    C1       -0.5450        0.0220       -0.1810
   7    N1        0.8590       -0.2900        0.0150
   1    H1       -0.7260        0.3460       -1.2100
   1    H2       -1.1600       -0.8590        0.0220
   1    H3       -0.8530        0.8210        0.4980
   1    H4        0.9510       -1.2560        0.3290
   1    H5        1.2330        0.2880        0.7670

Out:

```shell $ cat sqm.out -------------------------------------------------------- AMBER SQM VERSION 19 By Ross C. Walker, Michael F. Crowley, Scott Brozell, Tim Giese, Andreas W. Goetz, Tai-Sung Lee and David A. Case -------------------------------------------------------- -------------------------------------------------------------------------------- QM CALCULATION INFO -------------------------------------------------------------------------------- | QMMM: Citation for AMBER QMMM Run: | QMMM: R.C. Walker, M.F. Crowley and D.A. Case, J. COMP. CHEM. 29:1019, 2008 QMMM: SINGLET STATE CALCULATION QMMM: RHF CALCULATION, NO. OF DOUBLY OCCUPIED LEVELS = 7 | QMMM: *** Selected Hamiltonian *** | QMMM: AM1 | QMMM: *** Parameter sets in use *** | QMMM: C : M.J.S.DEWAR et al. JACS, 107, 3902, (1985) | QMMM: N : M.J.S.DEWAR et al. JACS, 107, 3902, (1985) | QMMM: H : M.J.S.DEWAR et al. JACS, 107, 3902, (1985) | QMMM: *** SCF convergence criteria *** | QMMM: Energy change : 0.1D-09 kcal/mol | QMMM: Error matrix |FP-PF| : 0.1D+00 au | QMMM: Density matrix change : 0.5D-06 | QMMM: Maximum number of SCF cycles : 1000 | QMMM: *** Diagonalization Routine Information *** | QMMM: Pseudo diagonalizations are allowed. | QMMM: Auto diagonalization routine selection is in use. | QMMM: | QMMM: Timing diagonalization routines: | QMMM: norbs = 13 | QMMM: diag iterations used for timing = 20 | QMMM: | QMMM: Internal diag routine = 0.000279 seconds | QMMM: Dspev diag routine = 0.000584 seconds | QMMM: Dspevd diag routine = 0.000330 seconds | QMMM: Dspevx diag routine = 0.001440 seconds | QMMM: Dsyev diag routine = 0.000344 seconds | QMMM: Dsyevd diag routine = 0.000334 seconds | QMMM: Dsyevr diag routine = 0.000488 seconds | QMMM: | QMMM: Pseudo diag routine = 0.000027 seconds | QMMM: | QMMM: Using internal diagonalization routine (diag_routine=1). QMMM: QM Region Cartesian Coordinates (*=link atom) QMMM: QM_NO. MM_NO. ATOM X Y Z QMMM: 1 1 C -0.5450 0.0220 -0.1810 QMMM: 2 2 N 0.8590 -0.2900 0.0150 QMMM: 3 3 H -0.7260 0.3460 -1.2100 QMMM: 4 4 H -1.1600 -0.8590 0.0220 QMMM: 5 5 H -0.8530 0.8210 0.4980 QMMM: 6 6 H 0.9510 -1.2560 0.3290 QMMM: 7 7 H 1.2330 0.2880 0.7670 -------------------------------------------------------------------------------- RESULTS -------------------------------------------------------------------------------- iter sqm energy rms gradient ---- ------------------- ----------------------- xmin 10 -6.1496 kcal/mol 0.0041 kcal/(mol*A) xmin 20 -6.1496 kcal/mol 0.0367 kcal/(mol*A) xmin 30 -6.1570 kcal/mol 0.4607 kcal/(mol*A) xmin 40 -6.1887 kcal/mol 0.2174 kcal/(mol*A) xmin 50 -7.0054 kcal/mol 0.8043 kcal/(mol*A) xmin 60 -7.4113 kcal/mol 0.4518 kcal/(mol*A) xmin 70 -7.4192 kcal/mol 0.0634 kcal/(mol*A) xmin 80 -7.4202 kcal/mol 0.0416 kcal/(mol*A) xmin 90 -7.4203 kcal/mol 0.0011 kcal/(mol*A) ... geometry converged ! Final MO eigenvalues (eV): -35.3791 -25.3552 -17.0678 -15.5827 -14.0413 -12.4709 -9.7554 3.8125 4.2261 4.2858 4.7939 6.2309 6.2783 Heat of formation = -7.42028957 kcal/mol ( -0.32176790 eV) Total SCF energy = -9319.74329157 kcal/mol ( -404.13439537 eV) Electronic energy = -22989.97173688 kcal/mol ( -996.91998339 eV) Core-core repulsion = 13670.22844532 kcal/mol ( 592.78558802 eV) Atomic Charges for Step 1 : Atom Element Mulliken Charge 1 C -0.129 2 N -0.351 3 H 0.082 4 H 0.031 5 H 0.082 6 H 0.143 7 H 0.143 Total Mulliken Charge = -0.000 X Y Z TOTAL QM DIPOLE -0.820 -0.954 0.808 1.495 Final Structure QMMM: QM Region Cartesian Coordinates (*=link atom) QMMM: QM_NO. MM_NO. ATOM X Y Z QMMM: 1 1 C -0.5304 0.0553 -0.1459 QMMM: 2 2 N 0.8510 -0.2066 0.1273 QMMM: 3 3 H -0.7179 -0.0789 -1.2442 QMMM: 4 4 H -1.2474 -0.6096 0.4124 QMMM: 5 5 H -0.7618 1.1192 0.1265 QMMM: 6 6 H 1.1024 -1.1396 -0.1310 QMMM: 7 7 H 1.0632 -0.0678 1.0949 --------- Calculation Completed ---------- ```

Results look the same on AmberTools 22 and 23, which makes sense as the underlying tools look the same

This is the SDF file, which does have hydrogens and generally looks normal (RDKit and OEChem parse it no problem): https://github.com/mattwthompson/partial_charge_experiments/blob/main/datafiles/CN.sdf

You can see from this job matrix that only a couple of OS/AmberTools combinations are affected: https://github.com/mattwthompson/partial_charge_experiments/actions/runs/8850845954