openmm / openmm-wheels

BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

switch repo to openmm org in download wheel script + other fixes #2

Open mikemhenry opened 5 months ago

mikemhenry commented 5 months ago

I am going to use this PR for all the little tweaks I need to make to get the wheels working

mikemhenry commented 4 months ago

weird this patch works upstream https://github.com/openmm/openmm/pull/4537

mikemhenry commented 4 months ago
       Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/home/conda/feedstock_root/build_artifacts/openmm_1715871358768/work/build/python/setup.py", line 279, in <module>
          main()
        File "/home/conda/feedstock_root/build_artifacts/openmm_1715871358768/work/build/python/setup.py", line 275, in main
          writeVersionPy()
        File "/home/conda/feedstock_root/build_artifacts/openmm_1715871358768/work/build/python/setup.py", line 85, in writeVersionPy
          setupKeywords["install_requires"]  = ["numpy"]
      NameError: name 'setupKeywords' is not defined
      [end of output]
mikemhenry commented 4 months ago

looks like the patch applied correctly

Applying patch: /home/conda/recipe_root/0001-wheels.patch
Applying: wheels
Applying patch: /home/conda/recipe_root/gh4498.patch
Applying: Do not build versioned libraries
Applying patch: /home/conda/recipe_root/gh4537.patch
Applying patch: /home/conda/recipe_root/gh4537.patch with args:
['-Np1', '-i', '/tmp/tmpvyl9yfyt/gh4537.patch.native', '--binary']
checking file wrappers/python/setup.py
Hunk #1 succeeded at 82 with fuzz 2 (offset -82 lines).
patching file wrappers/python/setup.py
Hunk #1 succeeded at 82 with fuzz 2 (offset -82 lines).
Patch analysis gives:
[[ RA-MD1LOVE ]] - [[                                                       0001-wheels.patch ]]
[[ RA-MD1L-VE ]] - [[                                                            gh4498.patch ]]
[[ RA-MD1L--E ]] - [[                                                            gh4537.patch ]]

Key:

R :: Reversible                       A :: Applicable
Y :: Build-prefix patch in use        M :: Minimal, non-amalgamated
D :: Dry-runnable                     N :: Patch level (1 is preferred)
L :: Patch level not-ambiguous        O :: Patch applies without offsets
V :: Patch applies without fuzz       E :: Patch applies without emitting to stderr
mikemhenry commented 4 months ago

full error:

python -m pip wheel . --wheel-dir=dist
Processing $SRC_DIR/build/python
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      Compiling openmm/app/internal/compiled.pyx because it changed.
      [1/1] Cythonizing openmm/app/internal/compiled.pyx
      Compiling openmm/app/internal/xtc_utils/xtc.pyx because it changed.
      [1/1] Cythonizing openmm/app/internal/xtc_utils/xtc.pyx
      /home/conda/feedstock_root/build_artifacts/openmm_1715871358768/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/conda/feedstock_root/build_artifacts/openmm_1715871358768/work/build/python/openmm/app/internal/xtc_utils/xtc.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
                                        author                                               Peter Eastman
                                    data_files                                                          []
                                   description                Python wrapper for OpenMM (a C++ MD package)
                                  download_url                                          https://openmm.org/
                                   ext_modules[<setuptools.extension.Extension('openmm._openmm') at 0x7fcf4edb49d0>, <setuptools.extension.Extension('openmm.app.internal.compiled') at 0x7fcf4debc430>, <setuptools.extension.Extension('openmm.app.internal.xtc_utils') at 0x7fcf47057fd0>]
                                extras_require{'cuda12': 'openmm-cuda==8.1.1.12', 'cuda11.2': 'openmm-cuda==8.1.1.11.2', 'cuda11.8': 'openmm-cuda==8.1.1.11.8'}
                                       license               Python Software Foundation License (BSD-like)
                              long_descriptionOpenMM is a toolkit for molecular simulation. It can be used either as a
          stand-alone application for running simulations, or as a library you call
          from your own code. It provides a combination of extreme flexibility
          (through custom forces and integrators), openness, and high performance
          (especially on recent GPUs) that make it truly unique among simulation codes.

                                          name                                                      OpenMM
                                  package_data{'openmm': [], 'openmm.app': ['data/*.xml', 'data/*.pdb', 'data/amber14/*.xml', 'data/charmm36/*.xml', 'data/implicit/*.xml'], 'openmm.app.internal': []}
                                      packages['simtk', 'simtk.unit', 'simtk.openmm', 'simtk.openmm.app', 'openmm', 'openmm.unit', 'openmm', 'openmm.app', 'openmm.app.internal', 'openmm.app.internal.charmm', 'openmm.app.internal.pdbx', 'openmm.app.internal.pdbx.reader', 'openmm.app.internal.pdbx.writer']
                                     platforms                            ['Linux', 'Mac OS X', 'Windows']
                                           url                                          https://openmm.org/
                                       version                                                       8.1.1
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/home/conda/feedstock_root/build_artifacts/openmm_1715871358768/work/build/python/setup.py", line 279, in <module>
          main()
        File "/home/conda/feedstock_root/build_artifacts/openmm_1715871358768/work/build/python/setup.py", line 275, in main
          writeVersionPy()
        File "/home/conda/feedstock_root/build_artifacts/openmm_1715871358768/work/build/python/setup.py", line 85, in writeVersionPy
          setupKeywords["install_requires"]  = ["numpy"]
      NameError: name 'setupKeywords' is not defined
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Traceback (most recent call last):
  File "/opt/conda/bin/conda-build", line 11, in <module>
    sys.exit(execute())
  File "/opt/conda/lib/python3.10/site-packages/conda_build/cli/main_build.py", line 590, in execute
    api.build(
  File "/opt/conda/lib/python3.10/site-packages/conda_build/api.py", line 250, in build
    return build_tree(
  File "/opt/conda/lib/python3.10/site-packages/conda_build/build.py", line 3638, in build_tree
    packages_from_this = build(
  File "/opt/conda/lib/python3.10/site-packages/conda_build/build.py", line 2506, in build
    utils.check_call_env(
  File "/opt/conda/lib/python3.10/site-packages/conda_build/utils.py", line 405, in check_call_env
    return _func_defaulting_env_to_os_environ("call", *popenargs, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/conda_build/utils.py", line 381, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['/bin/bash', '-o', 'errexit', '/home/conda/feedstock_root/build_artifacts/openmm_1715871358768/work/conda_build.sh']' returned non-zero exit status 1.

will see if I can reporduce this locally with python -m pip wheel . --wheel-dir=dist

mikemhenry commented 4 months ago

I think the issue was that another patch modified setup.py so things got mangled

mikemhenry commented 4 months ago

hmmm, commenting out patch to see if its something I did, but now everything fails with:

import: 'openmm'
Traceback (most recent call last):
  File "/home/conda/feedstock_root/build_artifacts/openmm_1715884974079/test_tmp/run_test.py", line 2, in <module>
    import openmm
  File "/home/conda/feedstock_root/build_artifacts/openmm_1715884974079/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/python3.10/site-packages/openmm/__init__.py", line 24, in <module>
    from openmm.openmm import *
  File "/home/conda/feedstock_root/build_artifacts/openmm_1715884974079/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/python3.10/site-packages/openmm/openmm.py", line 10, in <module>
    from . import _openmm
ImportError: libOpenMM.so: cannot open shared object file: No such file or directory
WARNING: Tests failed for openmm-8.1.1-py310hc0006f9_1.conda - moving package to /home/conda/feedstock_root/build_artifacts/broken
TESTS FAILED: openmm-8.1.1-py310hc0006f9_1.conda
isuruf commented 4 months ago

Try pinning auditwheel to 5.x

mikemhenry commented 4 months ago

Okay I think that pin fixed the linux builds but osx delocate.libsana.DelocationError: Library dependencies do not satisfy target MacOS version 10.9: /private/tmp/tmp4fhx7qu4/wheel/openmm/.dylibs/libc++.1.0.dylib has a minimum target of 10.13 is unhappy

EDIT: I need to use unix and not linux I bet EDIT: auditwheel is a linux only thing

mikemhenry commented 4 months ago

It looks like numpy 1.22 is the oldest version we build against, and 1.26 is the newest and we are building python3.8 wheels, so we might need to use something like oldest-supported-numpy to make this work robustly

mikemhenry commented 4 months ago

Not sure why delocate-wheel was working, I will have to ding into the older builds

isuruf commented 4 months ago

All green now

mikemhenry commented 3 months ago

@peastman this is ready to merge!