diff --git a/.github/workflows/conda_publish.yml b/.github/workflows/conda_publish.yml new file mode 100644 index 0000000000..4207ce5b7a --- /dev/null +++ b/.github/workflows/conda_publish.yml @@ -0,0 +1,249 @@ +name: Test code and publish package + +on: + workflow_dispatch: + workflow_call: + +jobs: + deploy_linux_cuda11: + strategy: + fail-fast: false + matrix: + config_file: + [ + "conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.22python3.9.____cpython.yaml", + "conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.22python3.10.____cpython.yaml", + "conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.23python3.11.____cpython.yaml", + "conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.26python3.12.____cpython.yaml", + ] + + runs-on: ubuntu-latest + container: quay.io/condaforge/linux-anvil-cuda:11.8 + + steps: + - uses: actions/checkout@v1 + + - name: Build openmm package + shell: bash -l {0} + run: | + git config --global --add safe.directory '*' + conda build conda_package/recipe/ --variant-config-files ${{ matrix.config_file }} --output-folder ./pkg/ --no-include-recipe --no-anaconda-upload -c conda-forge + env: + OPENMM_VERSION: ${{ github.ref_name }} + OPENMM_COMMIT: ${{ github.sha }} + + - name: Upload to conda + shell: bash -l {0} + run: | + /opt/conda/bin/anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera pkg/linux-64/openmm-*.tar.bz2 --skip-existing + + deploy_linux_cuda12: + strategy: + fail-fast: false + matrix: + config_file: + [ + "conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.22python3.9.____cpython.yaml", + "conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.22python3.10.____cpython.yaml", + "conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.23python3.11.____cpython.yaml", + "conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.26python3.12.____cpython.yaml", + ] + + runs-on: ubuntu-latest + container: quay.io/condaforge/linux-anvil-cos7-x86_64 + + steps: + - uses: actions/checkout@v1 + + - name: Build openmm package + shell: bash -l {0} + run: | + git config --global --add safe.directory '*' + conda build conda_package/recipe/ --variant-config-files ${{ matrix.config_file }} --output-folder ./pkg/ --no-include-recipe --no-anaconda-upload -c conda-forge + env: + OPENMM_VERSION: ${{ github.ref_name }} + OPENMM_COMMIT: ${{ github.sha }} + + - name: Upload to conda + shell: bash -l {0} + run: | + /opt/conda/bin/anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera pkg/linux-64/openmm-*.tar.bz2 --skip-existing + + deploy_osx_64: + strategy: + fail-fast: false + matrix: + config_file: + [ + "conda_package/variants/osx_64_numpy1.22opencl_implapplepython3.9.____cpython.yaml", + "conda_package/variants/osx_64_numpy1.22opencl_implapplepython3.9.____cpython.yaml", + "conda_package/variants/osx_64_numpy1.22opencl_implkhronospython3.10.____cpython.yaml", + "conda_package/variants/osx_64_numpy1.22opencl_implkhronospython3.9.____cpython.yaml", + "conda_package/variants/osx_64_numpy1.23opencl_implapplepython3.11.____cpython.yaml", + "conda_package/variants/osx_64_numpy1.23opencl_implkhronospython3.11.____cpython.yaml", + "conda_package/variants/osx_64_numpy1.26opencl_implapplepython3.12.____cpython.yaml", + "conda_package/variants/osx_64_numpy1.26opencl_implkhronospython3.12.____cpython.yaml", + ] + runs-on: macos-13 + + steps: + - uses: actions/checkout@v4 + + - uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + activate-environment: ../deploy-env + python-version: "3.10" + + - name: Build openmm package + shell: bash -l {0} + run: | + git config --global --add safe.directory '*' + conda install anaconda-client conda-build + conda build conda_package/recipe/ --variant-config-files ${{ matrix.config_file }} --output-folder ./pkg/ --no-include-recipe --no-anaconda-upload -c conda-forge + env: + OPENMM_VERSION: ${{ github.ref_name }} + OPENMM_COMMIT: ${{ github.sha }} + + - name: Upload to conda + shell: bash -l {0} + run: | + anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera pkg/*/openmm-*.conda --skip-existing + + deploy_osx_arm64: + strategy: + fail-fast: false + matrix: + config_file: + [ + "conda_package/variants/osx_arm64_numpy1.22opencl_implapplepython3.10.____cpython.yaml", + "conda_package/variants/osx_arm64_numpy1.22opencl_implapplepython3.9.____cpython.yaml", + "conda_package/variants/osx_arm64_numpy1.22opencl_implkhronospython3.10.____cpython.yaml", + "conda_package/variants/osx_arm64_numpy1.22opencl_implkhronospython3.9.____cpython.yaml", + "conda_package/variants/osx_arm64_numpy1.23opencl_implapplepython3.11.____cpython.yaml", + "conda_package/variants/osx_arm64_numpy1.23opencl_implkhronospython3.11.____cpython.yaml", + "conda_package/variants/osx_arm64_numpy1.26opencl_implapplepython3.12.____cpython.yaml", + "conda_package/variants/osx_arm64_numpy1.26opencl_implkhronospython3.12.____cpython.yaml", + ] + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + activate-environment: ../deploy-env + python-version: "3.10" + + - name: Build openmm package + shell: bash -l {0} + run: | + git config --global --add safe.directory '*' + conda install anaconda-client conda-build + conda build conda_package/recipe/ --variant-config-files ${{ matrix.config_file }} --output-folder ./pkg/ --no-include-recipe --no-anaconda-upload -c conda-forge + env: + OPENMM_VERSION: ${{ github.ref_name }} + OPENMM_COMMIT: ${{ github.sha }} + + - name: Upload to conda + shell: bash -l {0} + run: | + anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera pkg/*/openmm-*.conda --skip-existing + + deploy_win_64_cuda11: + strategy: + fail-fast: false + matrix: + config_file: + [ + "conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.22python3.10.____cpython.yaml", + "conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.22python3.9.____cpython.yaml", + "conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.23python3.11.____cpython.yaml", + "conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.26python3.12.____cpython.yaml", + ] + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v4 + + - uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + activate-environment: ../deploy-env + python-version: "3.10" + channels: conda-forge + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Setup CUDA Toolkit + id: cuda-toolkit + shell: pwsh + run: conda_package/scripts/setup_cuda.ps1 + env: + INPUT_CUDA_VERSION: 11.8.0 + + - name: Build openmm package + shell: bash -l {0} + run: | + git config --global --add safe.directory '*' + conda install anaconda-client conda-build + conda clean --all -y + conda build conda_package/recipe/ --variant-config-files ${{ matrix.config_file }} --output-folder ./pkg/ --no-include-recipe --no-anaconda-upload -c conda-forge + env: + OPENMM_VERSION: ${{ github.ref_name }} + OPENMM_COMMIT: ${{ github.sha }} + + - name: Upload to conda + shell: bash -l {0} + run: | + anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera pkg/*/openmm-*.conda --skip-existing + + deploy_win_64_cuda12: + strategy: + fail-fast: false + matrix: + config_file: + [ + "conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.22python3.10.____cpython.yaml", + "conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.22python3.9.____cpython.yaml", + "conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.23python3.11.____cpython.yaml", + "conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.26python3.12.____cpython.yaml", + ] + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v4 + + - uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + activate-environment: ../deploy-env + python-version: "3.10" + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Setup CUDA Toolkit + id: cuda-toolkit + shell: pwsh + run: conda_package/scripts/setup_cuda.ps1 + env: + INPUT_CUDA_VERSION: 12.0.0 + + - name: Build openmm package + shell: bash -l {0} + run: | + git config --global --add safe.directory '*' + conda install anaconda-client conda-build + conda clean --all -y + conda build conda_package/recipe/ --variant-config-files ${{ matrix.config_file }} --output-folder ./pkg/ --no-include-recipe --no-anaconda-upload -c conda-forge + env: + OPENMM_VERSION: ${{ github.ref_name }} + OPENMM_COMMIT: ${{ github.sha }} + + - name: Upload to conda + shell: bash -l {0} + run: | + anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera pkg/*/openmm-*.conda --skip-existing diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000..063b53eb3d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,205 @@ +name: Build wheels and publish + +on: + workflow_dispatch: + workflow_call: + +jobs: + build: + name: Build wheels on ${{ matrix.os }}-${{ matrix.accelerator }} + runs-on: ${{ matrix.os }} + permissions: + contents: read + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, ubuntu-24.04-arm, windows-2022, macos-latest] + accelerator: [cpu, cu118, cu120] #, cu124, cu126, cu128, hip] + exclude: + - os: ubuntu-24.04-arm + accelerator: cu118 + - os: ubuntu-24.04-arm + accelerator: cu120 + # - os: ubuntu-24.04-arm + # accelerator: cu124 + # - os: ubuntu-24.04-arm + # accelerator: cu126 + # - os: ubuntu-24.04-arm + # accelerator: cu128 + - os: ubuntu-24.04-arm + accelerator: hip + - os: macos-latest + accelerator: cu118 + - os: macos-latest + accelerator: cu120 + # - os: macos-latest + # accelerator: cu124 + # - os: macos-latest + # accelerator: cu126 + # - os: macos-latest + # accelerator: cu128 + - os: macos-latest + accelerator: hip + + steps: + - name: Free space of Github Runner (otherwise it will fail by running out of disk) + if: matrix.os == 'ubuntu-latest' + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "/usr/local/.ghcup" + sudo rm -rf "/usr/local/julia1.9.2" + sudo rm -rf "/usr/local/lib/android" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==3.1.3 + + - name: Activate MSVC + uses: ilammy/msvc-dev-cmd@v1 + if: matrix.os == 'windows-2022' + + - name: "Install dependencies with choco" + uses: crazy-max/ghaction-chocolatey@v3 + if: matrix.os == 'windows-2022' + with: + args: install doxygen.install jom + + - name: Build wheels + if: matrix.os != 'windows-2022' + shell: bash -l {0} + run: python -m cibuildwheel wrappers/python/ --output-dir wheelhouse + env: + ACCELERATOR: ${{ matrix.accelerator }} + VERSION_SUFFIX: "rc2" + + - name: Build wheels + if: matrix.os == 'windows-2022' + shell: cmd # Use cmd on Windows to avoid bash environment taking priority over MSVC variables + run: python -m cibuildwheel wrappers/python/ --output-dir wheelhouse + env: + DISTUTILS_USE_SDK: "1" # Windows requires this to use vc for building + ACCELERATOR: ${{ matrix.accelerator }} + VERSION_SUFFIX: "rc2" + + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.accelerator }}-cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + publish-to-public-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + strategy: + fail-fast: false + matrix: + accelerator: [cpu, cu118, cu120] #, hip, cu124, cu126, cu128] + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + pattern: "${{ matrix.accelerator }}-cibw-wheels*" + path: dist/ + merge-multiple: true + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PUBLIC_PYPI_API_TOKEN }} + skip-existing: true + + # publish-to-accelera-pypi: + # name: >- + # Publish Python 🐍 distribution 📦 to Acellera PyPI + # needs: + # - build + # runs-on: ubuntu-latest + # permissions: # Needed for GCP authentication + # contents: "read" + # id-token: "write" + # strategy: + # fail-fast: false + # matrix: + # accelerator: [cpu, cu118, cu120, hip] #cu124, cu126, cu128, hip] + + # steps: + # - uses: actions/checkout@v4 # Needed for GCP authentication for some reason + + # - name: Set up Cloud SDK + # uses: google-github-actions/auth@v2 + # with: + # workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + # service_account: ${{ secrets.GCP_PYPI_SERVICE_ACCOUNT }} + + # - name: Download all the dists + # uses: actions/download-artifact@v4 + # with: + # pattern: "${{ matrix.accelerator }}-cibw-wheels*" + # path: dist/ + # merge-multiple: true + + # - name: Publish distribution 📦 to Acellera PyPI + # run: | + # pip install build twine keyring keyrings.google-artifactregistry-auth + # pip install -U packaging + # twine upload --repository-url https://us-central1-python.pkg.dev/pypi-packages-455608/${{ matrix.accelerator }} dist/* --verbose --skip-existing + + github-release: + name: >- + Sign the Python 🐍 distribution 📦 with Sigstore + and upload them to GitHub Release + needs: + - build + runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write # IMPORTANT: mandatory for sigstore + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + path: dist/ + merge-multiple: true + + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v3.0.0 + with: + inputs: >- + ./dist/*.whl + + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + "$GITHUB_REF_NAME" + --repo "$GITHUB_REPOSITORY" + --notes "" + + - name: Upload artifact signatures to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + # Upload to GitHub Release using the `gh` CLI. + # `dist/` contains the built packages, and the + # sigstore-produced signatures and certificates. + run: >- + gh release upload + "$GITHUB_REF_NAME" dist/** + --repo "$GITHUB_REPOSITORY" diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000000..e4035831cc --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,14 @@ +name: Whole + +on: [push] + +jobs: + publish_pypi: + if: startsWith(github.event.ref, 'refs/tags/v') + uses: ./.github/workflows/publish.yml + secrets: inherit + + publish_conda: + if: startsWith(github.event.ref, 'refs/tags/v') + uses: ./.github/workflows/conda_publish.yml + secrets: inherit diff --git a/conda_package/README.md b/conda_package/README.md new file mode 100644 index 0000000000..bf4b2743d3 --- /dev/null +++ b/conda_package/README.md @@ -0,0 +1,10 @@ +# OpeMM Feedstock by Acellera + +This is a partial fork of the conda-forge feedstock for OpenMM. +The idea is to be able to quickly create OpenMM release candidates from specific commits without having to wait for an official OpenMM release. + +To create a new release you need to: + +1. Open the recipe/meta.yaml file and change the package version at the top of the file. +2. Update the git_rev version in the meta.yaml file in the source section to point to the desired commit. +3. Push your changes diff --git a/conda_package/recipe/build_openmm.bat b/conda_package/recipe/build_openmm.bat new file mode 100644 index 0000000000..04fcdc30ca --- /dev/null +++ b/conda_package/recipe/build_openmm.bat @@ -0,0 +1,44 @@ +@echo on + +mkdir build +cd build + +set "CUDA_TOOLKIT_ROOT_DIR=%CUDA_PATH:\=/%" + +if "%with_test_suite%"=="true" ( + set "CMAKE_FLAGS=-DBUILD_TESTING=ON -DOPENMM_BUILD_CUDA_TESTS=ON -DOPENMM_BUILD_OPENCL_TESTS=ON" +) else ( + set "CMAKE_FLAGS=-DBUILD_TESTING=OFF -DOPENMM_BUILD_CUDA_TESTS=OFF -DOPENMM_BUILD_OPENCL_TESTS=OFF" +) + +cmake.exe .. -G "NMake Makefiles JOM" ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ + -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^ + -DCUDA_TOOLKIT_ROOT_DIR="%CUDA_TOOLKIT_ROOT_DIR%" ^ + -DOPENCL_INCLUDE_DIR="%LIBRARY_INC%" ^ + -DOPENCL_LIBRARY="%LIBRARY_LIB%\opencl.lib" ^ + %CMAKE_FLAGS% ^ + || goto :error + +jom -j %NUMBER_OF_PROCESSORS% || goto :error +jom -j %NUMBER_OF_PROCESSORS% install || goto :error +jom -j %NUMBER_OF_PROCESSORS% PythonInstall || goto :error + +:: Better location for examples +mkdir %LIBRARY_PREFIX%\share\openmm || goto :error +move %LIBRARY_PREFIX%\examples %LIBRARY_PREFIX%\share\openmm || goto :error + +if "%with_test_suite%"=="true" ( + mkdir %LIBRARY_PREFIX%\share\openmm\tests\ || goto :error + find . -name "Test*" -type f -exec cp "{}" %LIBRARY_PREFIX%\share\openmm\tests\ ; || goto :error + robocopy /E python\tests\ %LIBRARY_PREFIX%\share\openmm\tests\python + if %errorlevel% GTR 1 ( exit /b %errorlevel% ) +) + + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% diff --git a/conda_package/recipe/build_openmm.sh b/conda_package/recipe/build_openmm.sh new file mode 100644 index 0000000000..1ad92c63a8 --- /dev/null +++ b/conda_package/recipe/build_openmm.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +set -ex + + +CMAKE_FLAGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_BUILD_TYPE=Release" +if [[ "$with_test_suite" == "true" ]]; then + CMAKE_FLAGS+=" -DBUILD_TESTING=ON -DOPENMM_BUILD_OPENCL_TESTS=ON" +else + CMAKE_FLAGS+=" -DBUILD_TESTING=OFF" +fi + + +if [[ "$target_platform" == linux* ]]; then + # CFLAGS + # JRG: Had to add -ldl to prevent linking errors (dlopen, etc) + MINIMAL_CFLAGS+=" -O3 -ldl" + CFLAGS+=" $MINIMAL_CFLAGS" + CXXFLAGS+=" $MINIMAL_CFLAGS" + + # CUDA is enabled in these platforms + if [[ "$target_platform" == linux-64 || "$target_platform" == linux-ppc64le ]]; then + # # CUDA_HOME is defined by nvcc metapackage + CMAKE_FLAGS+=" -DCUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME}" + # CUDA tests won't build, disable for now + # See https://github.com/openmm/openmm/issues/2258#issuecomment-462223634 + CMAKE_FLAGS+=" -DOPENMM_BUILD_CUDA_TESTS=OFF" + # shadow some CMAKE_ARGS bits that interfere with CUDA detection + CMAKE_FLAGS+=" -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH" + fi + + # OpenCL ICD + CMAKE_FLAGS+=" -DOPENCL_INCLUDE_DIR=${PREFIX}/include" + CMAKE_FLAGS+=" -DOPENCL_LIBRARY=${PREFIX}/lib/libOpenCL${SHLIB_EXT}" + +elif [[ "$target_platform" == osx* ]]; then + if [[ "$opencl_impl" == khronos ]]; then + CMAKE_FLAGS+=" -DOPENCL_INCLUDE_DIR=${PREFIX}/include" + CMAKE_FLAGS+=" -DOPENCL_LIBRARY=${PREFIX}/lib/libOpenCL${SHLIB_EXT}" + fi + # When using opencl_impl == apple, CMake will auto-locate it, so no need to provide the flags + # On Conda Forge, this will result in: + # /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/... + # ...SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenCL.framework + # On local builds, it might be: + # /System/Library/Frameworks/OpenCL.framework/OpenCL +fi + +# Set location for FFTW3 on both linux and mac +CMAKE_FLAGS+=" -DFFTW_INCLUDES=${PREFIX}/include/" +CMAKE_FLAGS+=" -DFFTW_LIBRARY=${PREFIX}/lib/libfftw3f${SHLIB_EXT}" +CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=${PREFIX}/lib/libfftw3f_threads${SHLIB_EXT}" +# Disambiguate swig location +CMAKE_FLAGS+=" -DSWIG_EXECUTABLE=$(which swig)" + +# Build in subdirectory and install. +mkdir -p build +cd build +cmake ${CMAKE_FLAGS} ${SRC_DIR} +make -j$CPU_COUNT +make -j$CPU_COUNT install PythonInstall + +# Put examples into an appropriate subdirectory. +mkdir -p ${PREFIX}/share/openmm/ +mv ${PREFIX}/examples ${PREFIX}/share/openmm/ + +# Fix some overlinking warnings/errors +for lib in ${PREFIX}/lib/plugins/*${SHLIB_EXT}; do + ln -s $lib ${PREFIX}/lib/$(basename $lib) || true +done + +if [[ "$with_test_suite" == "true" ]]; then + mkdir -p ${PREFIX}/share/openmm/tests/ + # BSD find vs GNU find: -executable is only available in GNU find + # +0111 is somehow equivalent in BSD, but that's not compatible in GNU + # so we use different commands for each... + if [[ "$target_platform" == osx* ]]; then + find . -name "Test*" -perm +0111 -type f \ + -exec python $RECIPE_DIR/patch_osx_tests.py "{}" \; \ + -exec cp "{}" $PREFIX/share/openmm/tests/ \; + else + find . -name "Test*" -executable -type f -exec cp "{}" $PREFIX/share/openmm/tests/ \; + fi + cp -r python/tests $PREFIX/share/openmm/tests/python +fi diff --git a/conda_package/recipe/meta.yaml b/conda_package/recipe/meta.yaml new file mode 100644 index 0000000000..4b20bd0973 --- /dev/null +++ b/conda_package/recipe/meta.yaml @@ -0,0 +1,146 @@ +{% set name = "openmm" %} +{% set version = environ.get("OPENMM_VERSION", "")[1:] %} +{% set build = 0 %} +{% set with_test_suite = "false" %} +#{% set with_test_suite = "true" %} # [(osx and arm64)] + +{% if cuda_compiler_version in (None, "None", True, False) %} +{% set cuda_major = 0 %} +{% else %} +{% set cuda_major = environ.get("cuda_compiler_version", "11.8").split(".")[0] | int %} +{% endif %} + +package: + name: {{ name }} + version: {{ version }} + +source: + git_url: https://github.com/Acellera/{{ name }}.git + git_rev: {{ environ.get("OPENMM_COMMIT", "") }} + +build: + number: {{ build }} + string: "cuda{{ cuda_compiler_version | replace('.', '') }}py{{ PY_VER.replace('.', '') }}h{{ PKG_HASH }}_{{ build }}" # [cuda_compiler_version != "None"] + string: "py{{ PY_VER.replace('.', '') }}h{{ PKG_HASH }}_{{ build }}_{{ opencl_impl }}" # [osx] + track_features: # make Apple OpenCL low priority + - openmm_opencl_apple # [osx and (opencl_impl == 'apple')] + skip: true # [(cuda_compiler_version in (undefined, 'None') and (linux64 or win)) or ((cuda_compiler_version != '10.2') and (ppc64le))] + # see https://github.com/conda-forge/openmm-feedstock/pull/143#issuecomment-2429793569 + skip: true # [aarch64 and (cuda_compiler_version == '11.8')] + script_env: + - CONFIG + - CUDA_HOME # [ppc64le] + missing_dso_whitelist: + - "*/libcuda.*" # [linux] + - "*/libOpenCL.*" # [unix] + - "*/nvcuda.dll" # [win] + script: + - env with_test_suite={{ with_test_suite }} bash {{ RECIPE_DIR }}/build_openmm.sh # [unix] + - set with_test_suite={{ with_test_suite }} && {{ RECIPE_DIR }}\build_openmm.bat # [win] + +requirements: + build: + - python # [build_platform != target_platform] + - cross-python_{{ target_platform }} # [build_platform != target_platform] + - cython # [build_platform != target_platform] + - numpy # [build_platform != target_platform] + - swig # [build_platform != target_platform] + - {{ compiler('c') }} + - {{ stdlib("c") }} + - {{ compiler('cxx') }} + - {{ compiler('cuda') }} # [(linux or win) and cuda_compiler != "None"] + - cuda-version {{ cuda_compiler_version }} # [(cuda_compiler_version or "None") != "None"] + - {{ cdt('mesa-libgl-devel') }} # [linux] + - cmake + - make # [unix] + - jom # [win] + # needed for Python wrappers + - doxygen +{% if with_test_suite == 'true' %} + - conda-build # [osx] + - m2-findutils # [win] + - m2-coreutils # [win] +{% endif %} + + host: + - python + - swig + - pthread-stubs + - lxml + - numpy + - cython + - setuptools + # OpenCL ICD + - ocl-icd # [linux] + - khronos-opencl-icd-loader # [win or (osx and opencl_impl == 'khronos')] + - cuda-version {{ cuda_compiler_version }} # [(cuda_compiler_version or "None") != "None"] + {% if cuda_major >= 12 %} + - libcufft-dev # [linux or win] + - cuda-profiler-api # [linux or win] + - cuda-nvrtc-dev # [linux or win] + # No cuda-driver-dev in windows + - cuda-driver-dev # [linux] + {% endif %} + run: + - python + - numpy + - scipy <1.14 + # OpenCL ICD + - ocl-icd # [linux] + - ocl-icd-system # [linux] + - khronos-opencl-icd-loader # [win or (osx and opencl_impl == 'khronos')] + - ocl_icd_wrapper_apple # [osx and opencl_impl == 'khronos'] + + run_constrained: + - khronos-opencl-icd-loader ==9999999999 # [osx and opencl_impl == 'apple'] + - ocl_icd_wrapper_apple ==9999999999 # [osx and opencl_impl == 'apple'] + +test: + requires: + # - git + - pocl # [linux] + {% if cuda_major >= 12 %} + # No cuda-driver-dev nor cuda-compat in windows + - cuda-driver-dev # [linux] + - cuda-compat # [linux] + {% endif %} +{% if with_test_suite == 'true' %} + - pytest + - pytest-xdist +{% endif %} + files: + - test_openmm.sh # [unix] + - test_openmm.bat # [win] + imports: + - openmm + commands: + - env with_test_suite={{ with_test_suite }} bash test_openmm.sh # [unix] + - set with_test_suite={{ with_test_suite }} && .\test_openmm.bat # [win] + +about: + home: http://openmm.org + license: LGPL-3.0-or-later + license_family: LGPL + license_file: + - docs-source/licenses/Licenses.txt + - docs-source/licenses/LGPL.txt + - docs-source/licenses/GPL.txt + summary: A high performance toolkit for molecular simulation. + + description: | + OpenMM 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. OpenMM is MIT licensed with some LGPL portions (CUDA and OpenCL + platforms). + doc_url: http://docs.openmm.org + dev_url: https://github.com/openmm/openmm + +extra: + recipe-maintainers: + - mikemhenry + - jchodera + - jaimergp + - peastman diff --git a/conda_package/recipe/patch_osx_tests.py b/conda_package/recipe/patch_osx_tests.py new file mode 100644 index 0000000000..8ddbe86b9e --- /dev/null +++ b/conda_package/recipe/patch_osx_tests.py @@ -0,0 +1,22 @@ +import os +import sys +from pathlib import Path +from conda_build.os_utils import macho + + +def name_callback(path, dylib): + prefix = os.environ["SRC_DIR"] + if prefix.endswith("/"): + prefix = prefix[:-1] + + if dylib["name"].startswith(prefix): + return f"@rpath/{Path(dylib['name']).name}" + + +def main(path): + dylibs = macho.otool(path) + macho.install_name_change(path, None, name_callback, dylibs, verbose=True) + + +if __name__ == "__main__": + main(sys.argv[1]) \ No newline at end of file diff --git a/conda_package/recipe/test_openmm.bat b/conda_package/recipe/test_openmm.bat new file mode 100644 index 0000000000..e732530991 --- /dev/null +++ b/conda_package/recipe/test_openmm.bat @@ -0,0 +1,107 @@ +@echo on + +:: Are we running on CI? CONFIG is defined for the whole Azure pipeline +:: and we are bringing it in through `script_env` in meta.yaml +if not "%CONFIG%"=="" set CI="True" + +:: Existence tests +if not exist %LIBRARY_LIB%/OpenMM.lib exit 1 +if not exist %LIBRARY_LIB%/plugins/OpenMMCPU.lib exit 1 +if not exist %LIBRARY_LIB%/plugins/OpenMMPME.lib exit 1 +if not exist %LIBRARY_LIB%/plugins/OpenMMOpenCL.lib exit 1 +if not exist %LIBRARY_LIB%/plugins/OpenMMCUDA.lib exit 1 + +:: Debug silent errors in plugin loading +python -c "import openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')" + +:: Check that hardcoded library path was correctly replaced by conda-build +python -c "import os, openmm.version as v; print(v.openmm_library_path); assert os.path.isdir(v.openmm_library_path), 'Directory does not exist'" || goto :error + +:: Check all platforms +python -m openmm.testInstallation + +:: On CI, Windows will only see 2 platforms because the driver nvcuda.dll is missing and that throws a 126 error +:: We expect that people running this locally will have Nvidia properly installed, so they should all platforms (4) +if "%CI%"=="" ( + set n_platforms=4 +) else ( + set n_platforms=2 +) +python -c "from openmm import Platform as P; n = P.getNumPlatforms(); assert n == %n_platforms%, f'n_platforms ({n}) != %n_platforms%'" || goto :error + +:: Now let's run a little MD +cd %LIBRARY_PREFIX%/share/openmm/examples/benchmarks +python benchmark.py --test=rf --seconds=10 --platform=Reference || goto :error +python benchmark.py --test=rf --seconds=10 --platform=CPU || goto :error +if "%CI%"=="" ( + python benchmark.py --test=rf --seconds=10 --platform=CUDA || goto :error + python benchmark.py --test=rf --seconds=10 --platform=OpenCL || goto :error +) + +:: Check version metadata looks ok, only for final releases, RCs are not checked! +:: See https://stackoverflow.com/a/7006016/3407590 for substring checks in CMD +if x%PKG_VERSION:rc=%==x%PKG_VERSION% ( + if x%PKG_VERSION:beta=%==x%PKG_VERSION% ( + if x%PKG_VERSION:dev=%==x%PKG_VERSION% ( + python -c "from openmm import Platform; v = Platform.getOpenMMVersion(); assert '%PKG_VERSION%' in (v, v+'.0'), v + '!=%PKG_VERSION%'" || goto :error + for /f "usebackq tokens=1" %%a in (`git ls-remote https://github.com/openmm/openmm.git %PKG_VERSION%`) do ( + python -c "from openmm.version import git_revision; r = git_revision; assert r == '%%a', r + '!=%%a'" || goto :error + ) + ) + ) +) else ( + echo "!!! WARNING !!!" + echo "This is a release candidate build (%PKG_VERSION%). Please check versions and git hashes manually!" +) + + +(set \n=^ +%=This hack is required to store newlines=% +) + +:: Run the full test suite, if requested +if "%with_test_suite%"=="true" ( + SETLOCAL EnableDelayedExpansion + @echo off + cd %LIBRARY_PREFIX%\share\openmm\tests + + :: Start with C++ tests + if not "%CI%"=="" ( + del /Q /F TestCuda* TestOpenCL* + ) + set count=0 + set exitcode=0 + set summary= + FOR %%F IN ( Test* ) do ( + set testexe=%%~F + set /a count=!count!+1 + echo; + echo #!count!: !testexe! + .\!testexe! + set thisexitcode=!errorlevel! + set summary=!summary! + if not "!thisexitcode!"=="0" ( set "summary=!summary!#!count! !testexe!\n!" ) + set /a exitcode=!exitcode!+!thisexitcode! + ) + if not "!exitcode!"=="0" ( + echo; + echo ------------ + echo Failed tests + echo ------------ + echo; + echo !summary! + exit /b !exitcode! + ) + @echo on + :: Python unit tests + cd python + python -m pytest -v -n %CPU_COUNT% || goto :error + + ENDLOCAL +) + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% diff --git a/conda_package/recipe/test_openmm.sh b/conda_package/recipe/test_openmm.sh new file mode 100644 index 0000000000..663016e9bb --- /dev/null +++ b/conda_package/recipe/test_openmm.sh @@ -0,0 +1,91 @@ +#!/bin/bash +set -ex +with_cuda="no" + +# Existence tests +test -f $PREFIX/lib/libOpenMM$SHLIB_EXT +test -f $PREFIX/lib/plugins/libOpenMMCPU$SHLIB_EXT +test -f $PREFIX/lib/plugins/libOpenMMPME$SHLIB_EXT +test -f $PREFIX/lib/plugins/libOpenMMOpenCL$SHLIB_EXT +if [[ "$target_platform" == linux-64 || "$target_platform" == linux-ppc64le ]]; then + with_cuda="yes" + test -f $PREFIX/lib/plugins/libOpenMMCUDA$SHLIB_EXT +fi + +## Do they work properly? +# Debug silent errors in plugin loading +python -c "import openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')" +# Check that hardcoded library path was correctly replaced by conda-build +python -c "import os, openmm.version as v; print(v.openmm_library_path); assert os.path.isdir(v.openmm_library_path), 'Directory does not exist'" + +# Check all platforms +if [[ "$target_platform" == linux-ppc64le || "$target_platform" == linux-aarch64 ]]; then + python -m openmm.testInstallation || true # OpenCL will fail but that's ok +else + python -m openmm.testInstallation +fi +if [[ $with_cuda == yes ]]; then + # Linux64 / PPC see all 4 platforms, but CUDA is not usable because there's no GPU there + n_platforms=4 +else + # MacOS / ARM only see 3 because CUDA is not available there + n_platforms=3 +fi +# testing cuda 12 changes, see https://github.com/conda-forge/openmm-feedstock/pull/108#issuecomment-1692190752 +#python -c "from openmm import Platform as P; n = P.getNumPlatforms(); assert n == $n_platforms, f'n_platforms ({n}) != $n_platforms'" + +# Run a small MD +cd ${PREFIX}/share/openmm/examples/benchmarks +python benchmark.py --test=rf --seconds=10 --platform=Reference +python benchmark.py --test=rf --seconds=10 --platform=CPU +if [[ -z ${CI-} ]]; then # Run only outside CI, assuming there will be a GPU there + python benchmark.py --test=rf --seconds=10 --platform=OpenCL + if [[ $with_cuda == yes ]]; then + python benchmark.py --test=rf --seconds=10 --platform=CUDA + fi +fi + +# Check version metadata looks ok, only for final releases, RCs are not checked! +if [[ ${PKG_VERSION} != *"rc"* && ${PKG_VERSION} != *"beta"* && ${PKG_VERSION} != *"dev"* ]]; then + python -c "from openmm import Platform; v = Platform.getOpenMMVersion(); assert \"$PKG_VERSION\" in (v, v+'.0'), v + \"!=$PKG_VERSION\"" + git_revision=$(git ls-remote https://github.com/openmm/openmm.git $PKG_VERSION | awk '{ print $1}') + python -c "from openmm.version import git_revision; r = git_revision; assert r == \"$git_revision\", r + \"!=$git_revision\"" +else + echo "!!! WARNING !!!" + echo "This is a release candidate build ($PKG_VERSION). Please check versions and git hashes manually!" +fi + +if [[ $with_test_suite == "true" ]]; then + cd $PREFIX/share/openmm/tests + set +ex + + # C++ tests + summary=""; exitcode=0; count=0; + for f in Test*; do + if [[ -n ${CI-} && ( $f == *Cuda* || $f == *OpenCL* ) ]]; then continue; fi + ((count+=1)) + echo -e "\n#$count: $f" + # Retry three times so stochastic tests have a chance + attempts=0 + while true; do + ./${f} + thisexitcode=$? + ((attempts+=1)) + if [[ $thisexitcode == 0 || $attempts == 3 ]]; then break; fi + done + if [[ $thisexitcode != 0 ]]; then summary+="\n#$count ${f}"; fi + ((exitcode+=$thisexitcode)) + done + if [[ $exitcode != 0 ]]; then + echo "------------" + echo "Failed tests" + echo "------------" + echo -e "${summary}" + exit $exitcode + fi + + # Python tests + set -ex + cd python + python -m pytest -v -n $CPU_COUNT +fi diff --git a/conda_package/scripts/setup_cuda.ps1 b/conda_package/scripts/setup_cuda.ps1 new file mode 100644 index 0000000000..8029aa3be1 --- /dev/null +++ b/conda_package/scripts/setup_cuda.ps1 @@ -0,0 +1,102 @@ +$CUDA_VERSION_FULL = $env:INPUT_CUDA_VERSION # v12.5.0 or v11.8.0 or v12.0.0 + +# Make sure CUDA_VERSION_FULL is set and valid, otherwise error. +# Validate CUDA version, extracting components via regex +$cuda_ver_matched = $CUDA_VERSION_FULL -match "^(?[1-9][0-9]*)\.(?[0-9]+)\.(?[0-9]+)$" +if(-not $cuda_ver_matched){ + Write-Output "Invalid CUDA version specified, .. required. '$CUDA_VERSION_FULL'." + exit 1 +} +$CUDA_MAJOR=$Matches.major +$CUDA_MINOR=$Matches.minor +$CUDA_PATCH=$Matches.patch + +Write-Output "Selected CUDA version: $CUDA_VERSION_FULL" + +$src = "cuda" +$dst = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$($CUDA_MAJOR).$($CUDA_MINOR)" +$installer = "cuda.exe" + +if ($CUDA_VERSION_FULL -eq "12.5.0") { + $downloadUrl = "https://developer.download.nvidia.com/compute/cuda/12.5.0/local_installers/cuda_12.5.0_555.85_windows.exe" +} elseif ($CUDA_VERSION_FULL -eq "12.0.0") { + $downloadUrl = "https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda_12.0.0_527.41_windows.exe" +} elseif ($CUDA_VERSION_FULL -eq "11.8.0") { + $downloadUrl = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_522.06_windows.exe" +} else { + Write-Output "Unsupported CUDA version specified" + exit 1 +} + +# Download cuda +Write-Output "Downloading CUDA from: $downloadUrl" +if (-not (Test-Path -Path $installer)) { + Write-Output "Downloading CUDA installer..." + # If the file does not exist, download it + & "C:\msys64\usr\bin\wget" $downloadUrl -O $installer -q +} + +# Extract cuda +if (-not (Test-Path -Path $src -Type Container)) { + # Extract CUDA using 7-Zip + Write-Output "Extracting CUDA using 7-Zip..." + mkdir "$src" + & 'C:\Program Files\7-Zip\7z' x $installer -o"$src" +} + +# Create destination directory if it doesn't exist +if (-Not (Test-Path -Path $dst)) { + Write-Output "Creating destination directory: $dst" + New-Item -Path $dst -ItemType Directory +} + +# Get directories to process from the source path +$directories = Get-ChildItem -Directory -Path $src +$whitelist = @("CUDA_Toolkit_Release_Notes.txt", "DOCS", "EULA.txt", "LICENSE", "README", "version.json") + +foreach ($dir in $directories) { + # Get all subdirectories and files in the current directory + $items = Get-ChildItem -Path (Join-Path $src $dir.Name) + + foreach ($item in $items) { + if ($item.PSIsContainer) { + # If the item is a directory, copy its contents + Write-Output "Copying contents of directory $($item.FullName) to $dst" + Copy-Item -Path "$($item.FullName)\*" -Destination $dst -Recurse -Force + } else { + if ($whitelist -contains $item.Name) { + Write-Output "Copying file $($item.FullName) to $dst" + Copy-Item -Path $item.FullName -Destination $dst -Force + } + } + } +} + +# Add msbuild cuda extensions +$msBuildExtensions = (Get-ChildItem "$src\visual_studio_integration\CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions").fullname +(Get-ChildItem 'C:\Program Files\Microsoft Visual Studio\2022\*\MSBuild\Microsoft\VC\*\BuildCustomizations').FullName | ForEach-Object { + $destination = $_ + $msBuildExtensions | ForEach-Object { + $extension = $_ + Copy-Item $extension -Destination $destination -Force + Write-Output "Copied $extension to $destination" + } +} + +# Add to Github env +Write-Output "Setting environment variables for GitHub Actions..." + +Write-Output "CUDA_PATH=$dst" +Write-Output "CUDA_PATH_V$($CUDA_MAJOR)_$($CUDA_MINOR)=$dst" +Write-Output "CUDA_PATH_VX_Y=CUDA_PATH_V$($CUDA_MAJOR)_$($CUDA_MINOR)" +Write-Output "CUDA_VERSION=$CUDA_VERSION_FULL" + +Write-Output "CUDA_PATH=$dst" >> $env:GITHUB_ENV +Write-Output "CUDA_PATH_V$($CUDA_MAJOR)_$($CUDA_MINOR)=$dst" >> $env:GITHUB_ENV +Write-Output "CUDA_PATH_VX_Y=CUDA_PATH_V$($CUDA_MAJOR)_$($CUDA_MINOR)" >> $env:GITHUB_ENV +Write-Output "CudaToolkitDir=$dst" >> $env:GITHUB_ENV +Write-Output "CMAKE_CUDA_COMPILER=$dst\bin\nvcc.exe" >> $env:GITHUB_ENV +Write-Output "NVCC_APPEND_FLAGS=-allow-unsupported-compiler" >> $env:GITHUB_ENV + +Write-Output "CUDA_VERSION=$CUDA_VERSION_FULL" >> $env:GITHUB_ENV +Write-Output "Setup completed." diff --git a/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.22python3.10.____cpython.yaml b/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.22python3.10.____cpython.yaml new file mode 100644 index 0000000000..6b185941c8 --- /dev/null +++ b/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.22python3.10.____cpython.yaml @@ -0,0 +1,44 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +numpy: +- '1.22' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image +- - python + - numpy diff --git a/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.22python3.9.____cpython.yaml b/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.22python3.9.____cpython.yaml new file mode 100644 index 0000000000..9ad9e134e0 --- /dev/null +++ b/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.22python3.9.____cpython.yaml @@ -0,0 +1,44 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +numpy: +- '1.22' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image +- - python + - numpy diff --git a/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.23python3.11.____cpython.yaml b/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.23python3.11.____cpython.yaml new file mode 100644 index 0000000000..d8ab21ac73 --- /dev/null +++ b/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.23python3.11.____cpython.yaml @@ -0,0 +1,44 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +numpy: +- '1.23' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image +- - python + - numpy diff --git a/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.26python3.12.____cpython.yaml b/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.26python3.12.____cpython.yaml new file mode 100644 index 0000000000..f7ca5554e2 --- /dev/null +++ b/conda_package/variants/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11numpy1.26python3.12.____cpython.yaml @@ -0,0 +1,44 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +numpy: +- '1.26' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image +- - python + - numpy diff --git a/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.22python3.10.____cpython.yaml b/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.22python3.10.____cpython.yaml new file mode 100644 index 0000000000..50c3797f71 --- /dev/null +++ b/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.22python3.10.____cpython.yaml @@ -0,0 +1,44 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +numpy: +- '1.22' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image +- - python + - numpy diff --git a/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.22python3.9.____cpython.yaml b/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.22python3.9.____cpython.yaml new file mode 100644 index 0000000000..0b8971faaf --- /dev/null +++ b/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.22python3.9.____cpython.yaml @@ -0,0 +1,44 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +numpy: +- '1.22' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image +- - python + - numpy diff --git a/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.23python3.11.____cpython.yaml b/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.23python3.11.____cpython.yaml new file mode 100644 index 0000000000..2bd7f50443 --- /dev/null +++ b/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.23python3.11.____cpython.yaml @@ -0,0 +1,44 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +numpy: +- '1.23' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image +- - python + - numpy diff --git a/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.26python3.12.____cpython.yaml b/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.26python3.12.____cpython.yaml new file mode 100644 index 0000000000..66671ce7dd --- /dev/null +++ b/conda_package/variants/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12numpy1.26python3.12.____cpython.yaml @@ -0,0 +1,44 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +numpy: +- '1.26' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image +- - python + - numpy diff --git a/conda_package/variants/osx_64_numpy1.22opencl_implapplepython3.10.____cpython.yaml b/conda_package/variants/osx_64_numpy1.22opencl_implapplepython3.10.____cpython.yaml new file mode 100644 index 0000000000..f147e53caa --- /dev/null +++ b/conda_package/variants/osx_64_numpy1.22opencl_implapplepython3.10.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- x86_64-apple-darwin13.4.0 +numpy: +- '1.22' +opencl_impl: +- apple +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_64_numpy1.22opencl_implapplepython3.9.____cpython.yaml b/conda_package/variants/osx_64_numpy1.22opencl_implapplepython3.9.____cpython.yaml new file mode 100644 index 0000000000..6a659ea44a --- /dev/null +++ b/conda_package/variants/osx_64_numpy1.22opencl_implapplepython3.9.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- x86_64-apple-darwin13.4.0 +numpy: +- '1.22' +opencl_impl: +- apple +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_64_numpy1.22opencl_implkhronospython3.10.____cpython.yaml b/conda_package/variants/osx_64_numpy1.22opencl_implkhronospython3.10.____cpython.yaml new file mode 100644 index 0000000000..881b77e905 --- /dev/null +++ b/conda_package/variants/osx_64_numpy1.22opencl_implkhronospython3.10.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- x86_64-apple-darwin13.4.0 +numpy: +- '1.22' +opencl_impl: +- khronos +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_64_numpy1.22opencl_implkhronospython3.9.____cpython.yaml b/conda_package/variants/osx_64_numpy1.22opencl_implkhronospython3.9.____cpython.yaml new file mode 100644 index 0000000000..604c27a1b5 --- /dev/null +++ b/conda_package/variants/osx_64_numpy1.22opencl_implkhronospython3.9.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- x86_64-apple-darwin13.4.0 +numpy: +- '1.22' +opencl_impl: +- khronos +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_64_numpy1.23opencl_implapplepython3.11.____cpython.yaml b/conda_package/variants/osx_64_numpy1.23opencl_implapplepython3.11.____cpython.yaml new file mode 100644 index 0000000000..66526dc731 --- /dev/null +++ b/conda_package/variants/osx_64_numpy1.23opencl_implapplepython3.11.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- x86_64-apple-darwin13.4.0 +numpy: +- '1.23' +opencl_impl: +- apple +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_64_numpy1.23opencl_implkhronospython3.11.____cpython.yaml b/conda_package/variants/osx_64_numpy1.23opencl_implkhronospython3.11.____cpython.yaml new file mode 100644 index 0000000000..7a41b6ed89 --- /dev/null +++ b/conda_package/variants/osx_64_numpy1.23opencl_implkhronospython3.11.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- x86_64-apple-darwin13.4.0 +numpy: +- '1.23' +opencl_impl: +- khronos +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_64_numpy1.26opencl_implapplepython3.12.____cpython.yaml b/conda_package/variants/osx_64_numpy1.26opencl_implapplepython3.12.____cpython.yaml new file mode 100644 index 0000000000..4ed488532d --- /dev/null +++ b/conda_package/variants/osx_64_numpy1.26opencl_implapplepython3.12.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- x86_64-apple-darwin13.4.0 +numpy: +- '1.26' +opencl_impl: +- apple +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_64_numpy1.26opencl_implkhronospython3.12.____cpython.yaml b/conda_package/variants/osx_64_numpy1.26opencl_implkhronospython3.12.____cpython.yaml new file mode 100644 index 0000000000..d642f02219 --- /dev/null +++ b/conda_package/variants/osx_64_numpy1.26opencl_implkhronospython3.12.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- x86_64-apple-darwin13.4.0 +numpy: +- '1.26' +opencl_impl: +- khronos +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_arm64_numpy1.22opencl_implapplepython3.10.____cpython.yaml b/conda_package/variants/osx_arm64_numpy1.22opencl_implapplepython3.10.____cpython.yaml new file mode 100644 index 0000000000..46289cb78a --- /dev/null +++ b/conda_package/variants/osx_arm64_numpy1.22opencl_implapplepython3.10.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +MACOSX_SDK_VERSION: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- arm64-apple-darwin20.0.0 +numpy: +- '1.22' +opencl_impl: +- apple +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_arm64_numpy1.22opencl_implapplepython3.9.____cpython.yaml b/conda_package/variants/osx_arm64_numpy1.22opencl_implapplepython3.9.____cpython.yaml new file mode 100644 index 0000000000..e68ce0782b --- /dev/null +++ b/conda_package/variants/osx_arm64_numpy1.22opencl_implapplepython3.9.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +MACOSX_SDK_VERSION: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- arm64-apple-darwin20.0.0 +numpy: +- '1.22' +opencl_impl: +- apple +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_arm64_numpy1.22opencl_implkhronospython3.10.____cpython.yaml b/conda_package/variants/osx_arm64_numpy1.22opencl_implkhronospython3.10.____cpython.yaml new file mode 100644 index 0000000000..e8cb0c3b99 --- /dev/null +++ b/conda_package/variants/osx_arm64_numpy1.22opencl_implkhronospython3.10.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +MACOSX_SDK_VERSION: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- arm64-apple-darwin20.0.0 +numpy: +- '1.22' +opencl_impl: +- khronos +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_arm64_numpy1.22opencl_implkhronospython3.9.____cpython.yaml b/conda_package/variants/osx_arm64_numpy1.22opencl_implkhronospython3.9.____cpython.yaml new file mode 100644 index 0000000000..5751f6c3f1 --- /dev/null +++ b/conda_package/variants/osx_arm64_numpy1.22opencl_implkhronospython3.9.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +MACOSX_SDK_VERSION: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- arm64-apple-darwin20.0.0 +numpy: +- '1.22' +opencl_impl: +- khronos +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_arm64_numpy1.23opencl_implapplepython3.11.____cpython.yaml b/conda_package/variants/osx_arm64_numpy1.23opencl_implapplepython3.11.____cpython.yaml new file mode 100644 index 0000000000..ec02403c92 --- /dev/null +++ b/conda_package/variants/osx_arm64_numpy1.23opencl_implapplepython3.11.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +MACOSX_SDK_VERSION: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- arm64-apple-darwin20.0.0 +numpy: +- '1.23' +opencl_impl: +- apple +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_arm64_numpy1.23opencl_implkhronospython3.11.____cpython.yaml b/conda_package/variants/osx_arm64_numpy1.23opencl_implkhronospython3.11.____cpython.yaml new file mode 100644 index 0000000000..2561123ed5 --- /dev/null +++ b/conda_package/variants/osx_arm64_numpy1.23opencl_implkhronospython3.11.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +MACOSX_SDK_VERSION: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- arm64-apple-darwin20.0.0 +numpy: +- '1.23' +opencl_impl: +- khronos +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_arm64_numpy1.26opencl_implapplepython3.12.____cpython.yaml b/conda_package/variants/osx_arm64_numpy1.26opencl_implapplepython3.12.____cpython.yaml new file mode 100644 index 0000000000..f43b3e9898 --- /dev/null +++ b/conda_package/variants/osx_arm64_numpy1.26opencl_implapplepython3.12.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +MACOSX_SDK_VERSION: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- arm64-apple-darwin20.0.0 +numpy: +- '1.26' +opencl_impl: +- apple +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/osx_arm64_numpy1.26opencl_implkhronospython3.12.____cpython.yaml b/conda_package/variants/osx_arm64_numpy1.26opencl_implkhronospython3.12.____cpython.yaml new file mode 100644 index 0000000000..5d03516237 --- /dev/null +++ b/conda_package/variants/osx_arm64_numpy1.26opencl_implkhronospython3.12.____cpython.yaml @@ -0,0 +1,43 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +MACOSX_SDK_VERSION: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '18' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '18' +macos_machine: +- arm64-apple-darwin20.0.0 +numpy: +- '1.26' +opencl_impl: +- khronos +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +- - python + - numpy diff --git a/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.22python3.10.____cpython.yaml b/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.22python3.10.____cpython.yaml new file mode 100644 index 0000000000..660e26a5a1 --- /dev/null +++ b/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.22python3.10.____cpython.yaml @@ -0,0 +1,29 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- vs2019 +numpy: +- '1.22' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version +- - python + - numpy diff --git a/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.22python3.9.____cpython.yaml b/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.22python3.9.____cpython.yaml new file mode 100644 index 0000000000..bb509a35c3 --- /dev/null +++ b/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.22python3.9.____cpython.yaml @@ -0,0 +1,29 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- vs2019 +numpy: +- '1.22' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version +- - python + - numpy diff --git a/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.23python3.11.____cpython.yaml b/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.23python3.11.____cpython.yaml new file mode 100644 index 0000000000..fb6c253b15 --- /dev/null +++ b/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.23python3.11.____cpython.yaml @@ -0,0 +1,29 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- vs2019 +numpy: +- '1.23' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version +- - python + - numpy diff --git a/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.26python3.12.____cpython.yaml b/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.26python3.12.____cpython.yaml new file mode 100644 index 0000000000..5aee6a6b3c --- /dev/null +++ b/conda_package/variants/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0numpy1.26python3.12.____cpython.yaml @@ -0,0 +1,29 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- vs2019 +numpy: +- '1.26' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version +- - python + - numpy diff --git a/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.22python3.10.____cpython.yaml b/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.22python3.10.____cpython.yaml new file mode 100644 index 0000000000..e10dc24ff2 --- /dev/null +++ b/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.22python3.10.____cpython.yaml @@ -0,0 +1,29 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- vs2019 +numpy: +- '1.22' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version +- - python + - numpy diff --git a/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.22python3.9.____cpython.yaml b/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.22python3.9.____cpython.yaml new file mode 100644 index 0000000000..1c4db9181b --- /dev/null +++ b/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.22python3.9.____cpython.yaml @@ -0,0 +1,29 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- vs2019 +numpy: +- '1.22' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version +- - python + - numpy diff --git a/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.23python3.11.____cpython.yaml b/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.23python3.11.____cpython.yaml new file mode 100644 index 0000000000..978ba439a4 --- /dev/null +++ b/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.23python3.11.____cpython.yaml @@ -0,0 +1,29 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- vs2019 +numpy: +- '1.23' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version +- - python + - numpy diff --git a/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.26python3.12.____cpython.yaml b/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.26python3.12.____cpython.yaml new file mode 100644 index 0000000000..e6432be9d2 --- /dev/null +++ b/conda_package/variants/win_64_cuda_compilernvcccuda_compiler_version11.8numpy1.26python3.12.____cpython.yaml @@ -0,0 +1,29 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- vs2019 +numpy: +- '1.26' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version +- - python + - numpy diff --git a/platforms/cuda/sharedTarget/CMakeLists.txt b/platforms/cuda/sharedTarget/CMakeLists.txt index cdc0336ae8..8248a532de 100644 --- a/platforms/cuda/sharedTarget/CMakeLists.txt +++ b/platforms/cuda/sharedTarget/CMakeLists.txt @@ -22,4 +22,5 @@ ELSE (APPLE) SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES LINK_FLAGS "${EXTRA_LINK_FLAGS}") ENDIF (APPLE) +SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN/..;$ORIGIN/../../../nvidia/cufft/lib;$ORIGIN/../../../nvidia/cuda_nvrtc/lib;") INSTALL_TARGETS(/lib/plugins RUNTIME_DIRECTORY /lib/plugins ${SHARED_TARGET}) diff --git a/wrappers/python/MANIFEST.in b/wrappers/python/MANIFEST.in index c9af15ab45..12cc448ab9 100644 --- a/wrappers/python/MANIFEST.in +++ b/wrappers/python/MANIFEST.in @@ -8,4 +8,5 @@ recursive-include src *.txt *.py *.i *.c *.cxx *.h *.sh Doxyfile prune src/swig_doxygen/doxygen/html prune src/swig_doxygen/doxygen/xml global-exclude CMakeLists.txt - +graft openmm/lib +graft openmm/include \ No newline at end of file diff --git a/wrappers/python/cibuildwheel_support/prepare_build_environment_linux.sh b/wrappers/python/cibuildwheel_support/prepare_build_environment_linux.sh new file mode 100755 index 0000000000..27d09164e8 --- /dev/null +++ b/wrappers/python/cibuildwheel_support/prepare_build_environment_linux.sh @@ -0,0 +1,58 @@ +#! /bin/bash + +set -e +set -x + +# Install dependencies with yum +dnf install -y doxygen zip opencl-headers ocl-icd + +if [ "$ACCELERATOR" == "cu118" ]; then + # Install CUDA 11.8 + dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo + + dnf install --setopt=obsoletes=0 -y \ + cuda-compiler-11-8-11.8.0-1 \ + cuda-libraries-11-8-11.8.0-1 \ + cuda-libraries-devel-11-8-11.8.0-1 + + ln -s cuda-11.8 /usr/local/cuda + + export CUDA_HOME="/usr/local/cuda" +elif [ "$ACCELERATOR" == "cu120" ]; then + # Install CUDA 12.0 + dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo + + dnf install --setopt=obsoletes=0 -y \ + cuda-compiler-12-0-12.0.1-1 \ + cuda-libraries-12-0-12.0.1-1 \ + cuda-libraries-devel-12-0-12.0.1-1 + + ln -s cuda-12.0 /usr/local/cuda + + export CUDA_HOME="/usr/local/cuda" +elif [ "$ACCELERATOR" == "hip" ]; then + # Install HIP 6.2 + dnf install -y https://repo.radeon.com/amdgpu-install/6.2.2/el/8.10/amdgpu-install-6.2.60202-1.el8.noarch.rpm + dnf install -y rocm-device-libs hip-devel hip-runtime-amd hipcc +fi + +# Configure build with Cmake +mkdir -p build +mkdir -p openmm-install +cd build +cmake .. \ + -DCMAKE_INSTALL_PREFIX=openmm-install \ + -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=1' \ + -DOPENMM_BUILD_OPENCL_LIB=ON \ + -DOPENCL_INCLUDE_DIR=/usr/include/CL \ + -DOPENCL_LIBRARY=/usr/lib64/libOpenCL.so.1 + +# Build OpenMM +make -j4 install +make -j4 PythonInstall + +cd .. + +cp -r build/python/* wrappers/python/ +cp -r build/openmm-install/include wrappers/python/openmm/ +cp -r build/openmm-install/lib wrappers/python/openmm/ diff --git a/wrappers/python/cibuildwheel_support/prepare_build_environment_osx.sh b/wrappers/python/cibuildwheel_support/prepare_build_environment_osx.sh new file mode 100755 index 0000000000..f527c3dc24 --- /dev/null +++ b/wrappers/python/cibuildwheel_support/prepare_build_environment_osx.sh @@ -0,0 +1,18 @@ +#! /bin/bash + +set -e +set -x + +brew install doxygen swig + +mkdir build +cd build +cmake .. -DCMAKE_INSTALL_PREFIX=openmm-install +make -j4 install +make -j4 PythonInstall + +cd .. + +cp -r build/python/* wrappers/python/ +cp -r build/openmm-install/include wrappers/python/openmm/ +cp -r build/openmm-install/lib wrappers/python/openmm/ diff --git a/wrappers/python/cibuildwheel_support/prepare_build_environment_windows.sh b/wrappers/python/cibuildwheel_support/prepare_build_environment_windows.sh new file mode 100755 index 0000000000..80dad2620a --- /dev/null +++ b/wrappers/python/cibuildwheel_support/prepare_build_environment_windows.sh @@ -0,0 +1,55 @@ +#! /bin/bash + +set -e +set -x + +if [ "$ACCELERATOR" == "cu118" ]; then + curl --netrc-optional -L -nv -o cuda.exe https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_522.06_windows.exe + ./cuda.exe -s nvcc_11.8 nvrtc_11.8 nvrtc_dev_11.8 cudart_11.8 cufft_11.8 cufft_dev_11.8 cuda_profiler_api_11.8 + rm cuda.exe + # Move CUDA folder to a path without spaces + mv "/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8" /c/CUDA + export CUDA_PATH="/c/CUDA" +elif [ "$ACCELERATOR" == "cu120" ]; then + curl --netrc-optional -L -nv -o cuda.exe https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda_12.0.0_527.41_windows.exe + ./cuda.exe -s nvcc_12.0 nvrtc_12.0 nvrtc_dev_12.0 cudart_12.0 cufft_12.0 cufft_dev_12.0 cuda_profiler_api_12.0 + rm cuda.exe + # Move CUDA folder to a path without spaces + mv "/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.0" /c/CUDA + export CUDA_PATH="/c/CUDA" +elif [ "$ACCELERATOR" == "hip" ]; then + curl.exe --output HIP.exe --url https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-Win10-Win11-For-HIP.exe + ./HIP.exe -install + rm HIP.exe +fi + +# Download and extract OpenCL +curl --netrc-optional -L -nv -o OpenCL-SDK.zip https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v2024.10.24/OpenCL-SDK-v2024.10.24-Win-x64.zip +unzip OpenCL-SDK.zip +OPENCL_PATH="$(pwd)/OpenCL-SDK-v2024.10.24-Win-x64" + + +# Configure build with Cmake +mkdir -p build +mkdir -p openmm-install +cd build +cmake -G "NMake Makefiles JOM" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=openmm-install \ + -DCMAKE_PREFIX_PATH="openmm-install;C:\Program Files\AMD\ROCm\6.1" \ + -DCMAKE_CXX_COMPILER=cl.exe \ + -DCMAKE_C_COMPILER=cl.exe \ + -DOPENCL_INCLUDE_DIR="${OPENCL_PATH}/include" \ + -DOPENCL_LIBRARY="${OPENCL_PATH}/lib/OpenCL.lib" \ + -DHIP_PLATFORM=amd \ + .. + +# Build OpenMM +jom -j 4 install +jom -j 4 PythonInstall + +cd .. + +cp -r build/python/* wrappers/python/ +cp -r build/openmm-install/include wrappers/python/openmm/ +cp -r build/openmm-install/lib wrappers/python/openmm/ diff --git a/wrappers/python/openmm/__init__.py b/wrappers/python/openmm/__init__.py index 26a1a2aeaf..b593a81d3d 100644 --- a/wrappers/python/openmm/__init__.py +++ b/wrappers/python/openmm/__init__.py @@ -9,14 +9,25 @@ import os, os.path import sys -from . import version + + +openmm_library_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib')) +if not os.path.exists(openmm_library_path): + # The conda package installs all the libraries in the env/lib directory + import site + + openmm_library_path = os.path.abspath(os.path.join(site.getsitepackages()[0], '..', '..')) + if sys.platform == 'win32': + # Don't move this in the next if below. it should only happen on conda packages where + # lib is not under the package root. + openmm_library_path = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'Library', 'lib') if sys.platform == 'win32': _path = os.environ['PATH'] os.environ['PATH'] = r'%(lib)s;%(lib)s\plugins;%(path)s' % { - 'lib': version.openmm_library_path, 'path': _path} + 'lib': openmm_library_path, 'path': _path} try: - with os.add_dll_directory(version.openmm_library_path): + with os.add_dll_directory(openmm_library_path): from . import _openmm except: pass @@ -26,8 +37,8 @@ from openmm.mtsintegrator import MTSIntegrator, MTSLangevinIntegrator from openmm.amd import AMDIntegrator, AMDForceGroupIntegrator, DualAMDIntegrator -if os.getenv('OPENMM_PLUGIN_DIR') is None and os.path.isdir(version.openmm_library_path): - pluginLoadedLibNames = Platform.loadPluginsFromDirectory(os.path.join(version.openmm_library_path, 'plugins')) +if os.getenv('OPENMM_PLUGIN_DIR') is None and os.path.isdir(openmm_library_path): + pluginLoadedLibNames = Platform.loadPluginsFromDirectory(os.path.join(openmm_library_path, 'plugins')) else: pluginLoadedLibNames = Platform.loadPluginsFromDirectory(Platform.getDefaultPluginsDirectory()) @@ -39,3 +50,5 @@ class OpenMMException(Exception): """This is the class used for all exceptions thrown by the C++ library.""" pass + +from . import version diff --git a/wrappers/python/pyproject.toml b/wrappers/python/pyproject.toml new file mode 100644 index 0000000000..54734e9fe4 --- /dev/null +++ b/wrappers/python/pyproject.toml @@ -0,0 +1,46 @@ +[project] +name = "PLACEHOLDER" +description = "Python wrapper for OpenMM (a C++ MD package)" +authors = [{ name = "Peter Eastman", email = "peastman@stanford.edu" }] +readme = "README.md" +license = "PSF-2.0" +requires-python = ">=3.8" +dynamic = ["version", "dependencies"] +classifiers = [ + "Programming Language :: Python :: 3", +] + +[project.urls] +"Homepage" = "https://openmm.org" +"Bug Tracker" = "https://github.com/openmm/openmm/issues" +"Download URL" = "https://openmm.org" + +[tool.setuptools.packages.find] +include = ["openmm*", "simtk*"] + +[build-system] +requires = ["setuptools>=78", "setuptools-scm>=8", "numpy", "cython"] +build-backend = "setuptools.build_meta" + +[tool.cibuildwheel] +skip = ["cp38-*", "cp314t-*", "*win32", "*armv7l", "*_i686", "*_ppc64le", "*_s390x", "*_universal2", "*-musllinux_*"] +test-requires = ["pytest"] +test-command = "cd {project}/wrappers/python/tests; pytest" +environment-pass = ["ACCELERATOR", "VERSION_SUFFIX"] +# container-engine = "docker; create_args: --gpus all" + +[tool.cibuildwheel.windows] +before-all = "bash wrappers/python/cibuildwheel_support/prepare_build_environment_windows.sh" +test-command = "cp -r {project}/wrappers/python/tests/systems . && pytest {project}/wrappers/python/tests" + +[tool.cibuildwheel.linux] +before-all = "wrappers/python/cibuildwheel_support/prepare_build_environment_linux.sh" +repair-wheel-command = [ + "auditwheel repair --exclude libOpenMM.so --exclude libOpenMMCUDA.so --exclude libOpenMMHIP.so --exclude libOpenMMOpenCL.so --exclude libOpenMMDrude.so --exclude libOpenMMAmoeba.so --exclude libOpenMMRPMD.so --exclude libOpenCL.so.1 --exclude libcuda.so.1 --exclude libcufft.so.11 --exclude libcufft.so.10 --exclude libnvrtc.so.11.2 --exclude libnvrtc.so.12 --exclude libhiprtc.so.6 --exclude libamdhip64.so.6 -w {dest_dir} {wheel}", +] + +[tool.cibuildwheel.macos] +before-all = "wrappers/python/cibuildwheel_support/prepare_build_environment_osx.sh" +repair-wheel-command = [ + "delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel}", +] \ No newline at end of file diff --git a/wrappers/python/setup.py b/wrappers/python/setup.py index ca26e66a54..28d261150d 100644 --- a/wrappers/python/setup.py +++ b/wrappers/python/setup.py @@ -85,12 +85,13 @@ def writeVersionPy(filename="openmm/version.py", major_version_num=MAJOR_VERSION cnt = """ # THIS FILE IS GENERATED FROM OPENMM SETUP.PY +from openmm import openmm_library_path + short_version = '%(version)s' version = '%(version)s' full_version = '%(full_version)s' git_revision = '%(git_revision)s' release = %(isrelease)s -openmm_library_path = r'%(path)s' if not release: version = full_version @@ -118,25 +119,28 @@ def writeVersionPy(filename="openmm/version.py", major_version_num=MAJOR_VERSION a.write(cnt % {'version': version, 'full_version' : full_version, 'git_revision' : git_revision, - 'isrelease': str(IS_RELEASED), - 'path': os.getenv('OPENMM_LIB_PATH')}) + 'isrelease': str(IS_RELEASED)}) + +def _replace_name(name): + import pathlib + + pyproject_path = pathlib.Path(__file__).parent / "pyproject.toml" + with open(pyproject_path, 'r') as f: + pyproject_text = f.read() + pyproject_text = pyproject_text.replace("PLACEHOLDER", name) + with open(pyproject_path, 'w') as f: + f.write(pyproject_text) def buildKeywordDictionary(major_version_num=MAJOR_VERSION_NUM, minor_version_num=MINOR_VERSION_NUM, build_info=BUILD_INFO): from setuptools import Extension setupKeywords = {} - setupKeywords["name"] = "OpenMM" setupKeywords["version"] = "%s.%s.%s%s" % (major_version_num, minor_version_num, build_info, os.getenv('VERSION_SUFFIX', '')) - setupKeywords["author"] = "Peter Eastman" - setupKeywords["license"] = \ - "Python Software Foundation License (BSD-like)" - setupKeywords["url"] = "https://openmm.org" - setupKeywords["download_url"] = "https://openmm.org" setupKeywords["packages"] = [ "simtk", "simtk.unit", @@ -151,6 +155,7 @@ def buildKeywordDictionary(major_version_num=MAJOR_VERSION_NUM, "openmm.app.internal.pdbx", "openmm.app.internal.pdbx.reader", "openmm.app.internal.pdbx.writer"] + setupKeywords["data_files"] = [] setupKeywords["package_data"] = {"openmm" : [], "openmm.app" : ['data/*.xml', 'data/*.pdb', 'data/amber14/*.xml', 'data/amber19/*.xml', 'data/charmm36/*.xml', 'data/charmm36_2024/*.xml', 'data/implicit/*.xml'], @@ -167,6 +172,20 @@ def buildKeywordDictionary(major_version_num=MAJOR_VERSION_NUM, (especially on recent GPUs) that make it truly unique among simulation codes. """ + if os.getenv("ACCELERATOR", "").startswith("cpu"): + _replace_name("openmm-unofficial-cpu") + if os.getenv("ACCELERATOR", "").startswith("hip"): + _replace_name("openmm-unofficial-hip") + if os.getenv("ACCELERATOR", "").startswith("cu"): + cuda_ver = os.getenv("ACCELERATOR", "")[2:4] + _replace_name(f"openmm-unofficial-cu{cuda_ver}") + setupKeywords["install_requires"] += [f'nvidia-cuda-runtime-cu{cuda_ver}', + f'nvidia-cuda-nvcc-cu{cuda_ver}', + f'nvidia-cuda-nvrtc-cu{cuda_ver}', + f'nvidia-cuda-cupti-cu{cuda_ver}', + f'nvidia-cufft-cu{cuda_ver}'] + + define_macros = [('MAJOR_VERSION', major_version_num), ('MINOR_VERSION', minor_version_num)] @@ -184,14 +203,10 @@ def buildKeywordDictionary(major_version_num=MAJOR_VERSION_NUM, libraries[ii]="%s_d" % libraries[ii] sys.stdout.write("%s\n" % libraries[ii]) - openmm_include_path = os.getenv('OPENMM_INCLUDE_PATH') - if not openmm_include_path: - reportError("Set OPENMM_INCLUDE_PATH to point to the include directory for OpenMM") - openmm_lib_path = os.getenv('OPENMM_LIB_PATH') - if not openmm_lib_path: - reportError("Set OPENMM_LIB_PATH to point to the lib directory for OpenMM") + openmm_include_path = os.getenv('OPENMM_INCLUDE_PATH', 'openmm/include') + openmm_lib_path = os.getenv('OPENMM_LIB_PATH', 'openmm/lib') - extra_compile_args=['-std=c++11'] + extra_compile_args=['-std=c++11', '-D_GLIBCXX_USE_CXX11_ABI=1'] extra_link_args=[] if platform.system() == "Windows": define_macros.append( ('WIN32', None) ) @@ -199,9 +214,10 @@ def buildKeywordDictionary(major_version_num=MAJOR_VERSION_NUM, define_macros.append( (' _MSC_VER', None) ) extra_compile_args.append('/EHsc') else: + extra_link_args += ['-Wl,-rpath,$ORIGIN/lib'] if platform.system() == 'Darwin': extra_compile_args += ['-stdlib=libc++'] - extra_link_args += ['-stdlib=libc++', '-Wl', '-rpath', openmm_lib_path] + extra_link_args += ['-stdlib=libc++', '-Wl', '-rpath', '@loader_path/lib'] if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ and platform.processor() != 'arm': extra_compile_args += ['-mmacosx-version-min=10.7'] extra_link_args += ['-mmacosx-version-min=10.7']