Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

mikemhenry
Copy link
Contributor

No description provided.

@mikemhenry mikemhenry changed the title switch repo to openmm org in download wheel script switch repo to openmm org in download wheel script + other fixes May 11, 2024
@mikemhenry
Copy link
Contributor Author

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

@mikemhenry
Copy link
Contributor Author

weird this patch works upstream openmm/openmm#4537

@mikemhenry
Copy link
Contributor Author

       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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@@ -1,10 +1,11 @@


- name: Upload artifacts to Github
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
Copy link
Contributor Author

Choose a reason for hiding this comment

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

v2 is getting deprecated in june so I figured might as well update now

with:
path: build_artifacts/pypi_wheels
name: ${{ matrix.CONFIG }}
overwrite: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

see issue #4

(especially on recent GPUs) that make it truly unique among simulation codes.
"""
setupKeywords["extras_require"] = {"cuda12": f"openmm-cuda=={setupKeywords['version']}.12", "cuda11.2": f"openmm-cuda=={setupKeywords['version']}.11.2", "cuda11.8": f"openmm-cuda=={setupKeywords['version']}.11.8"}
+ setupKeywords["install_requires"] = ["numpy"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mikemhenry
Copy link
Contributor Author

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
Copy link
Collaborator

isuruf commented May 17, 2024

Try pinning auditwheel to 5.x

@mikemhenry
Copy link
Contributor Author

mikemhenry commented May 17, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@isuruf
Copy link
Collaborator

isuruf commented Jun 3, 2024

All green now

@mikemhenry
Copy link
Contributor Author

@peastman this is ready to merge!

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.

3 participants