From 49bcc458eb38b813b62107036a1ac7c1bc11f862 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Fri, 11 Oct 2024 17:09:42 +0200 Subject: [PATCH 1/7] Rename label to tutorials-2024 --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3248b4..c990422 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,12 +31,12 @@ jobs: CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }} run: | source activate base # needed to have correct CONDA_PREFIX - anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l cecam-2023 $CONDA_PREFIX/conda-bld/*/lammps*.tar.bz2 --force - anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l cecam-2023 $CONDA_PREFIX/conda-bld/*/plumed*.tar.bz2 --force - anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l cecam-2023 $CONDA_PREFIX/conda-bld/*/gromacs*.tar.bz2 --force + anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l tutorials-2024 $CONDA_PREFIX/conda-bld/*/lammps*.tar.bz2 --force + anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l tutorials-2024 $CONDA_PREFIX/conda-bld/*/plumed*.tar.bz2 --force + anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l tutorials-2024 $CONDA_PREFIX/conda-bld/*/gromacs*.tar.bz2 --force - name: Test run: | - conda create --name plumed-masterclass + conda create --name plumed-masterclass source activate plumed-masterclass conda install -y -c conda-forge plumed py-plumed numpy pandas matplotlib notebook mdtraj mdanalysis git # check if python module is working @@ -44,8 +44,8 @@ jobs: # first install serial gromacs conda install -y --strict-channel-priority -c plumed/label/masterclass -c conda-forge gromacs # then replace with parallel gromacs and plumed - conda install -y --strict-channel-priority -c plumed/label/cecam-2023 -c conda-forge plumed - conda install -y --strict-channel-priority -c plumed/label/cecam-2023 -c conda-forge gromacs + conda install -y --strict-channel-priority -c plumed/label/tutorials-2024 -c conda-forge plumed + conda install -y --strict-channel-priority -c plumed/label/tutorials-2024 -c conda-forge gromacs # check if python module is working python -c "import plumed; p=plumed.Plumed(); print(p)" cd test @@ -55,7 +55,7 @@ jobs: cat dir*/colvar*.dat # install lammps cd - - conda install -y --strict-channel-priority -c plumed/label/cecam-2023 -c conda-forge plumed lammps + conda install -y --strict-channel-priority -c plumed/label/tutorial-2024 -c conda-forge plumed lammps cd test-lammps mpiexec lmp -in start.lmp cat COLVAR From 1b8e6fc10864e266185e6b0ed4eb50759c7d3b85 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Mon, 14 Oct 2024 12:12:28 +0200 Subject: [PATCH 2/7] Build HEAD of v2.10 branch, and enable metatensor package --- plumed/build.sh | 15 +++++++++++++-- plumed/meta.yaml | 17 +++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/plumed/build.sh b/plumed/build.sh index 338ec44..ba0bd14 100644 --- a/plumed/build.sh +++ b/plumed/build.sh @@ -18,6 +18,10 @@ export CXXFLAGS="${CXXFLAGS//-O2/-O3}" # libraries are explicitly listed here due to --disable-libsearch export LIBS="-lboost_serialization -lfftw3 -lgsl -lgslcblas -llapack -lblas -lz $LIBS" +export LIBS="-lmetatensor_torch -lmetatensor -ltorch -lc10 -ltorch_cpu $LIBS" + +# libtorch puts some headers in a non-standard place +export CPPFLAGS="-I$PREFIX/include/torch/csrc/api/include $CPPFLAGS" # enable MPI export CXX=mpic++ @@ -26,8 +30,15 @@ export CXX=mpic++ # --disable-libsearch forces to link only explicitely requested libraries # --disable-static-patch avoid tests that are only required for static patches # --disable-static-archive makes package smaller -./configure --prefix=$PREFIX --disable-python --disable-libsearch --disable-static-patch --disable-static-archive --enable-modules=all --enable-boost_serialization +./configure --prefix=$PREFIX \ + --disable-python \ + --disable-libsearch \ + --disable-static-patch \ + --disable-static-archive \ + --enable-modules=all \ + --enable-boost_serialization \ + --enable-metatensor \ + --enable-libtorch make -j3 make install - diff --git a/plumed/meta.yaml b/plumed/meta.yaml index dd7bbf1..08eb637 100644 --- a/plumed/meta.yaml +++ b/plumed/meta.yaml @@ -1,15 +1,16 @@ {% set name = "plumed" %} -{% set version = "2.9.0" %} +{% set version = "2.10" %} +{% set git_rev = "b0ffcb55ad8cc3c71ec5c30a1bd46f68dd33bceb" %} package: name: {{ name|lower }} - version: {{ version }} + version: {{ version }}.git.{{ git_rev }} source: - url: https://github.com/plumed/plumed2/archive/v{{ version }}.tar.gz - sha256: 612d2387416b5f82dd8545709921440370e144fd46cef633654cf0ee43bac5f8 - #git_url: https://github.com/plumed/plumed2.git - #git_rev: ddb59d16b21d6afb054fd9f6352f5d290e8575bf + # url: https://github.com/plumed/plumed2/archive/v{{ version }}.tar.gz + # sha256: 612d2387416b5f82dd8545709921440370e144fd46cef633654cf0ee43bac5f8 + git_url: https://github.com/plumed/plumed2.git + git_rev: {{ git_rev }} build: number: 0 @@ -34,12 +35,16 @@ requirements: - liblapack - llvm-openmp # [osx] - zlib + - libtorch + - libmetatensor-torch >=0.5.0,<0.6.0 run: # for some not clear reason boost-cpp is needed here as well - boost-cpp - openmpi - gawk - llvm-openmp # [osx] + - libtorch + - libmetatensor-torch >=0.5.0,<0.6.0 test: commands: From e4e97585d5b73d62654981b71edd51f7502997df Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Mon, 14 Oct 2024 12:13:09 +0200 Subject: [PATCH 3/7] Add py-plumed to the build --- .github/workflows/ci.yml | 2 ++ py-plumed/build.sh | 9 ++++++ py-plumed/conda_build_config.yaml | 9 ++++++ py-plumed/meta.yaml | 52 +++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 py-plumed/build.sh create mode 100644 py-plumed/conda_build_config.yaml create mode 100644 py-plumed/meta.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c990422..eb71ff0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: conda create --name build source activate build conda-build -c conda-forge plumed + conda-build -c conda-forge py-plumed conda-build -c conda-forge gromacs conda-build -c conda-forge lammps - name: Deploy @@ -33,6 +34,7 @@ jobs: source activate base # needed to have correct CONDA_PREFIX anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l tutorials-2024 $CONDA_PREFIX/conda-bld/*/lammps*.tar.bz2 --force anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l tutorials-2024 $CONDA_PREFIX/conda-bld/*/plumed*.tar.bz2 --force + anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l tutorials-2024 $CONDA_PREFIX/conda-bld/*/py-plumed*.tar.bz2 --force anaconda -t $CONDA_UPLOAD_TOKEN upload -u plumed -l tutorials-2024 $CONDA_PREFIX/conda-bld/*/gromacs*.tar.bz2 --force - name: Test run: | diff --git a/py-plumed/build.sh b/py-plumed/build.sh new file mode 100644 index 0000000..e69fc30 --- /dev/null +++ b/py-plumed/build.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env bash + +cd python +make pip +export plumed_default_kernel=$PREFIX/lib/libplumedKernel$SHLIB_EXT +#export plumed_disable_rtld_deepbind=yes + +$PYTHON -m pip install . --no-deps -vv + diff --git a/py-plumed/conda_build_config.yaml b/py-plumed/conda_build_config.yaml new file mode 100644 index 0000000..65a50c6 --- /dev/null +++ b/py-plumed/conda_build_config.yaml @@ -0,0 +1,9 @@ +CONDA_BUILD_SYSROOT: + - /opt/MacOSX10.13.sdk # [osx and x86_64] + - /opt/MacOSX11.0.sdk # [osx and arm64] +python: + - 3.8 + - 3.9 + - 3.10 + - 3.11 + - 3.12 diff --git a/py-plumed/meta.yaml b/py-plumed/meta.yaml new file mode 100644 index 0000000..86a9c5f --- /dev/null +++ b/py-plumed/meta.yaml @@ -0,0 +1,52 @@ +{% set name = "py-plumed" %} +{% set version = "2.10" %} +{% set git_rev = "b0ffcb55ad8cc3c71ec5c30a1bd46f68dd33bceb" %} + +package: + name: {{ name|lower }} + version: {{ version }}.git.{{ git_rev }} + +source: + # url: https://github.com/plumed/plumed2/archive/v{{ version }}.tar.gz + # sha256: 612d2387416b5f82dd8545709921440370e144fd46cef633654cf0ee43bac5f8 + git_url: https://github.com/plumed/plumed2.git + git_rev: {{ git_rev }} + +build: + number: 0 + skip: True # [win or py2k] + +requirements: + build: + - {{ compiler('c') }} + - make + host: + - python + - pip + - cython + run: + - plumed + - python + +test: + imports: + - plumed + commands: + - python -c "import plumed; p=plumed.Plumed(); print(p)" + +about: + home: http://www.plumed.org/ + license: LGPL-3.0 + license_family: GPL + license_file: COPYING.LESSER + summary: 'Python wrappers for plumed library' + description: | + PLUMED is an open source library for free energy calculations in + molecular systems which works together with some of the most + popular molecular dynamics engines. + doc_url: https://www.plumed.org/doc + dev_url: https://github.com/plumed/plumed2 + +extra: + recipe-maintainers: + - GiovanniBussi From 4eb7dd115ddc00471f48cbdfab1349f30b5c8d0f Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Mon, 14 Oct 2024 12:14:10 +0200 Subject: [PATCH 4/7] Only define CONDA_BUILD_SYSROOT on CI It prevents local builds if the macOS SDK are installed in a different location --- .github/conda_build_config.yaml | 3 +++ .github/workflows/ci.yml | 10 +++++----- gromacs/conda_build_config.yaml | 2 -- lammps/conda_build_config.yaml | 2 -- plumed/conda_build_config.yaml | 2 -- py-plumed/conda_build_config.yaml | 3 --- 6 files changed, 8 insertions(+), 14 deletions(-) create mode 100644 .github/conda_build_config.yaml delete mode 100644 gromacs/conda_build_config.yaml delete mode 100644 lammps/conda_build_config.yaml diff --git a/.github/conda_build_config.yaml b/.github/conda_build_config.yaml new file mode 100644 index 0000000..b90d011 --- /dev/null +++ b/.github/conda_build_config.yaml @@ -0,0 +1,3 @@ +CONDA_BUILD_SYSROOT: + - /opt/MacOSX10.13.sdk # [osx and x86_64] + - /opt/MacOSX11.0.sdk # [osx and arm64] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb71ff0..e9286fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04 , macos-11] + os: [ubuntu-22.04, macos-11, macos-14] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -23,10 +23,10 @@ jobs: export MAKEFLAGS=-j3 conda create --name build source activate build - conda-build -c conda-forge plumed - conda-build -c conda-forge py-plumed - conda-build -c conda-forge gromacs - conda-build -c conda-forge lammps + conda-build -m .github/conda_build_config.yaml -c conda-forge plumed + conda-build -m .github/conda_build_config.yaml -c conda-forge py-plumed + conda-build -m .github/conda_build_config.yaml -c conda-forge gromacs + conda-build -m .github/conda_build_config.yaml -c conda-forge lammps - name: Deploy env: CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }} diff --git a/gromacs/conda_build_config.yaml b/gromacs/conda_build_config.yaml deleted file mode 100644 index e4cb6f2..0000000 --- a/gromacs/conda_build_config.yaml +++ /dev/null @@ -1,2 +0,0 @@ -CONDA_BUILD_SYSROOT: - - /opt/MacOSX10.9.sdk # [osx] diff --git a/lammps/conda_build_config.yaml b/lammps/conda_build_config.yaml deleted file mode 100644 index e4cb6f2..0000000 --- a/lammps/conda_build_config.yaml +++ /dev/null @@ -1,2 +0,0 @@ -CONDA_BUILD_SYSROOT: - - /opt/MacOSX10.9.sdk # [osx] diff --git a/plumed/conda_build_config.yaml b/plumed/conda_build_config.yaml index 428ae80..289631f 100644 --- a/plumed/conda_build_config.yaml +++ b/plumed/conda_build_config.yaml @@ -1,5 +1,3 @@ -CONDA_BUILD_SYSROOT: - - /opt/MacOSX10.9.sdk # [osx] mpi: - mpich - openmpi diff --git a/py-plumed/conda_build_config.yaml b/py-plumed/conda_build_config.yaml index 65a50c6..0fde6e5 100644 --- a/py-plumed/conda_build_config.yaml +++ b/py-plumed/conda_build_config.yaml @@ -1,6 +1,3 @@ -CONDA_BUILD_SYSROOT: - - /opt/MacOSX10.13.sdk # [osx and x86_64] - - /opt/MacOSX11.0.sdk # [osx and arm64] python: - 3.8 - 3.9 From c70c69ec3a49e60534084793bcc1bb0e14a7d6e5 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Tue, 15 Oct 2024 16:28:54 +0200 Subject: [PATCH 5/7] Update version/build string handling --- plumed/meta.yaml | 5 +++-- py-plumed/meta.yaml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plumed/meta.yaml b/plumed/meta.yaml index 08eb637..5c3158c 100644 --- a/plumed/meta.yaml +++ b/plumed/meta.yaml @@ -1,10 +1,10 @@ {% set name = "plumed" %} -{% set version = "2.10" %} +{% set version = "2.10.dev1" %} {% set git_rev = "b0ffcb55ad8cc3c71ec5c30a1bd46f68dd33bceb" %} package: name: {{ name|lower }} - version: {{ version }}.git.{{ git_rev }} + version: {{ version }} source: # url: https://github.com/plumed/plumed2/archive/v{{ version }}.tar.gz @@ -14,6 +14,7 @@ source: build: number: 0 + string: git.{{ git_rev }} skip: True # [win] # Most programs should link libplumedWrapper.a so that libplumedKernel.so will be loaded # with dlopen. There is no need for pinning thus. diff --git a/py-plumed/meta.yaml b/py-plumed/meta.yaml index 86a9c5f..2a3f0e8 100644 --- a/py-plumed/meta.yaml +++ b/py-plumed/meta.yaml @@ -1,10 +1,10 @@ {% set name = "py-plumed" %} -{% set version = "2.10" %} +{% set version = "2.10.dev1" %} {% set git_rev = "b0ffcb55ad8cc3c71ec5c30a1bd46f68dd33bceb" %} package: name: {{ name|lower }} - version: {{ version }}.git.{{ git_rev }} + version: {{ version }} source: # url: https://github.com/plumed/plumed2/archive/v{{ version }}.tar.gz @@ -14,6 +14,7 @@ source: build: number: 0 + string: git.{{ git_rev }} skip: True # [win or py2k] requirements: From b11220c64b9004c495f94e633155f08cbb71a9f7 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Wed, 16 Oct 2024 11:56:29 +0200 Subject: [PATCH 6/7] macos-11 builders are not provided anymore macos-13 is the one to use for x86_64 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9286fd..b6765b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-11, macos-14] + os: [ubuntu-22.04, macos-13, macos-14] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 From 0878ef18bde4560e4c360b7410de8b9b01e2133c Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Wed, 16 Oct 2024 11:58:28 +0200 Subject: [PATCH 7/7] Do not pull binutils/hwloc on macos-arm64 --- gromacs/meta.yaml | 7 +++---- lammps/meta.yaml | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gromacs/meta.yaml b/gromacs/meta.yaml index e5fa76b..abaf928 100644 --- a/gromacs/meta.yaml +++ b/gromacs/meta.yaml @@ -17,14 +17,14 @@ requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} - - binutils + - binutils # [not (osx and arm64)] - cmake - llvm-openmp # [osx] - python host: - openmpi - fftw - - libhwloc 1.* + - libhwloc 1.* # [not (osx and arm64)] - libblas - liblapack - llvm-openmp # [osx] @@ -32,7 +32,7 @@ requirements: run: - openmpi - fftw - - libhwloc 1.* + - libhwloc 1.* # [not (osx and arm64)] - llvm-openmp # [osx] - plumed >=2 @@ -45,4 +45,3 @@ about: home: http://www.gromacs.org/ license: GNU Lesser General Public License (LGPL) summary: GROMACS is a versatile package to perform molecular dynamics. - diff --git a/lammps/meta.yaml b/lammps/meta.yaml index f1ce22b..5dd4612 100644 --- a/lammps/meta.yaml +++ b/lammps/meta.yaml @@ -13,7 +13,7 @@ requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} - - binutils + - binutils # [not (osx and arm64)] - sed - make - cmake @@ -50,4 +50,3 @@ about: under the terms of the GNU Public License (GPL). doc_url: http://lammps.sandia.gov/doc/Manual.html dev_url: https://github.com/lammps/lammps -