diff --git a/.github/conda_build_config.yaml b/.github/conda_build_config.yaml new file mode 100644 index 0000000..582b463 --- /dev/null +++ b/.github/conda_build_config.yaml @@ -0,0 +1,5 @@ +CONDA_BUILD_SYSROOT: + - /opt/MacOSX11.0.sdk # [osx] + +MACOSX_DEPLOYMENT_TARGET: + - 11.0 # [osx] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3248b4..1eec3f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,34 +9,43 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04 , macos-11] + os: [ubuntu-22.04, macos-13, macos-14] runs-on: ${{ matrix.os }} + env: + MAKEFLAGS: -j3 steps: - uses: actions/checkout@v2 - name: Install conda run: | curl -LO https://raw.githubusercontent.com/GiovanniBussi/conda-ci/master/conda-ci source ./conda-ci install - source ./conda-ci install-conda-build - - name: Build + source ./conda-ci install-conda-build --sdk=11.0 + - name: Build plumed run: | - export MAKEFLAGS=-j3 - conda create --name build - source activate build - conda-build -c conda-forge 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 + - name: Build py-plumed + run: | + conda-build -m .github/conda_build_config.yaml -c conda-forge py-plumed + - name: Build gromacs + run: | + conda-build -m .github/conda_build_config.yaml -c conda-forge gromacs + - name: Build lammps + run: | + conda-build -m .github/conda_build_config.yaml -c conda-forge lammps - name: Deploy + # Do not deploy when running CI for PR + if: github.event_name != 'pull_request' env: 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/*/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: | - 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 +53,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 +64,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 diff --git a/gromacs/build.sh b/gromacs/build.sh index 4d38f7c..d29dc20 100644 --- a/gromacs/build.sh +++ b/gromacs/build.sh @@ -14,6 +14,10 @@ else LIBS="$LIBS $PREFIX/lib/libhwloc.so" fi +if [[ "$OSX_ARCH" != "arm64" ]]; then + opt="$opt -DGMX_SIMD=SSE2" +fi + $PREFIX/bin/plumed-patch -p --runtime -e gromacs-$PKG_VERSION # this is to fix a missing header file in gromacs 2020 @@ -35,7 +39,6 @@ cmake .. \ -DGMXAPI=OFF \ -DGMX_THREAD_MPI=OFF \ -DGMX_GPU=OFF \ - -DGMX_SIMD=SSE2 \ -DCMAKE_PREFIX_PATH=$PREFIX \ -DCMAKE_INSTALL_PREFIX=$PREFIX make VERBOSE=1 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/gromacs/meta.yaml b/gromacs/meta.yaml index e5fa76b..ba26b4b 100644 --- a/gromacs/meta.yaml +++ b/gromacs/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "2020.7" %} +{% set version = "2023.5" %} package: name: gromacs @@ -11,20 +11,20 @@ build: source: url: http://ftp.gromacs.org/pub/gromacs/gromacs-{{ version }}.tar.gz - sha256: 744158d8f61b0d36ffe89ec934519b7e0981a7af438897740160da648d36c2f0 + sha256: 9cc491d3601a5fe0ec0de727e4432c34877f596fe8a463d4cf0f0f53fb34d08b 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/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/lammps/meta.yaml b/lammps/meta.yaml index f1ce22b..49e079d 100644 --- a/lammps/meta.yaml +++ b/lammps/meta.yaml @@ -3,7 +3,7 @@ package: version: 2022.06.23 build: - number: 1 + number: 2 source: url: https://github.com/lammps/lammps/archive/refs/tags/stable_23Jun2022.tar.gz @@ -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 - 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/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/plumed/meta.yaml b/plumed/meta.yaml index dd7bbf1..a7b3d62 100644 --- a/plumed/meta.yaml +++ b/plumed/meta.yaml @@ -1,18 +1,20 @@ {% set name = "plumed" %} -{% set version = "2.9.0" %} +{% set version = "2.10.dev1" %} +{% set git_rev = "d12388b23ee71cd4c61d845db22697f95b9489c9" %} package: name: {{ name|lower }} version: {{ version }} 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 + 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. @@ -34,12 +36,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: 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..0fde6e5 --- /dev/null +++ b/py-plumed/conda_build_config.yaml @@ -0,0 +1,6 @@ +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..cc79367 --- /dev/null +++ b/py-plumed/meta.yaml @@ -0,0 +1,53 @@ +{% set name = "py-plumed" %} +{% set version = "2.10.dev1" %} +{% set git_rev = "d12388b23ee71cd4c61d845db22697f95b9489c9" %} + +package: + name: {{ name|lower }} + version: {{ version }} + +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 + string: git.{{ git_rev }} + 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