Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/cmakeAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
jobs:
buildAndTest:
strategy:
fail-fast: false
matrix:
compiler: [gcc]
mpi: [mpi, nompi]
Expand Down Expand Up @@ -179,14 +180,11 @@ jobs:
cmake -B ${{github.workspace}}/build
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install"
-Doption_relaxed_dependencies=ON
-Dallmodules_activate=ON
-Denable_boost_serialization=ON
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-Dallmodules_activate=ON
-Denable_boost_serialization=ON
-Denable_warnings_basic=OFF
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install";
-Denable_warnings_basic=OFF ;
ccache -s -M 100M

- name: Build
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/localcmakeTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- 'cmake**'
jobs:
runBasicTests:
uses: ./.github/workflows/cmakeAndTest.yml
# runBasicTests:
# uses: ./.github/workflows/cmakeAndTest.yml
# secrets: inherit

mac:
uses: ./.github/workflows/macWF.yml
secrets: inherit
136 changes: 81 additions & 55 deletions .github/workflows/macWF.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,68 +14,94 @@ env:

jobs:

macports:
runs-on: macos-11
strategy:
fail-fast: false
matrix:
variant: [ "" , "+allmodules" ]
# see https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 for possible exclusions
env:
PYVERS: "py37 py38 py39 py310"
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.macports-ci-ccache
key: ccache-macports-${{ matrix.variant }}-${{ github.sha }}
restore-keys: ccache-macports-${{ matrix.variant }}-
- name: Install MacPorts
run: |
wget https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
source ./macports-ci install
source ./macports-ci ccache
- name: Build local Portfile
run: |
make macports
source ./macports-ci localports macports
- name: Build PLUMED
run: |
sudo port -N -k install plumed ${{ matrix.variant }}
plumed config show
for p in $PYVERS ; do
sudo port -N install $p-plumed
done
source ./macports-ci ccache --save
- name: Run tests
run: |
sudo port -N -d test plumed ${{ matrix.variant }}
- name: Run python tests
run: |
for p in $PYVERS ; do
sudo port test $p-plumed
done
# macports:
# runs-on: macos-11
# strategy:
# fail-fast: false
# matrix:
# variant: [ "" , "+allmodules" ]
# # see https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 for possible exclusions
# env:
# PYVERS: "py37 py38 py39 py310"
# steps:
# - uses: actions/checkout@v3
# - uses: actions/cache@v3
# with:
# path: ~/.macports-ci-ccache
# key: ccache-macports-${{ matrix.variant }}-${{ github.sha }}
# restore-keys: ccache-macports-${{ matrix.variant }}-
# - name: Install MacPorts
# run: |
# wget https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
# source ./macports-ci install
# source ./macports-ci ccache
# - name: Build local Portfile
# run: |
# make macports
# source ./macports-ci localports macports
# - name: Build PLUMED
# run: |
# sudo port -N -k install plumed ${{ matrix.variant }}
# plumed config show
# for p in $PYVERS ; do
# sudo port -N install $p-plumed
# done
# source ./macports-ci ccache --save
# - name: Run tests
# run: |
# sudo port -N -d test plumed ${{ matrix.variant }}
# - name: Run python tests
# run: |
# for p in $PYVERS ; do
# sudo port test $p-plumed
# done

macsimple:
runs-on: macos-11
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v3
- name: Set paths
run: |
echo "$HOME/opt/bin" >> $GITHUB_PATH
echo "CPATH=$HOME/opt/include:$CPATH" >> $GITHUB_ENV
echo "INCLUDE=$HOME/opt/include:$INCLUDE" >> $GITHUB_ENV
echo "LIBRARY_PATH=$HOME/opt/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Build PLUMED
echo "$HOME/opt/bin:${{github.workspace}}/install/bin" >> $GITHUB_PATH
echo "CPATH=$HOME/opt/include:${{github.workspace}}/install/include:$CPATH" >> $GITHUB_ENV
echo "INCLUDE=$HOME/opt/include:${{github.workspace}}/install/include:$INCLUDE" >> $GITHUB_ENV
echo "LIBRARY_PATH=$HOME/opt/lib:${{github.workspace}}/install/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/opt/lib:${{github.workspace}}/install/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Update the environment
run: |
brew update > /dev/null
brew install gawk
./configure --disable-dependency-tracking --prefix="$HOME/opt"
make -j 4
make install
- name: Run tests
run: |
make --no-print-directory -C regtest
# these can fail for numerical reasons
make -C regtest checkfail

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
#set up without warnings
run: >
cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install"
-Doption_relaxed_dependencies=ON
-DCMAKE_INSTALL_LIBDIR=lib
-Denable_warnings_basic=OFF


- name: Build
working-directory: ${{github.workspace}}/build
# Build your program with the given configuration
run: cmake --build . --config ${{env.BUILD_TYPE}} --parallel 4

- name: Checking the tests
working-directory: ${{github.workspace}}/build
#does only the tests marked with the label "testIntegrity".
#These checks ensure that the test suite works as intended,
#if these do not pass there is something very wrong!
run: ctest --output-on-failure -L testIntegrity

- name: Test
id: tests
working-directory: ${{github.workspace}}/build

run: ctest -j4 --output-on-failure
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ makefile.dep
/config.*
/autom4*
/stamp-h
#the cmake standard build dir
build/
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ add_subdirectory(src)
add_subdirectory(scripts)
add_subdirectory(fortran)
add_subdirectory(vim)
add_subdirectory(macports)

install(DIRECTORY patches
DESTINATION ${DIRS_EXTRA_INSTALL})
Expand Down
139 changes: 139 additions & 0 deletions macports/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
add_custom_command(OUTPUT
science/plumed/Portfile
python/py-plumed/Portfile
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/generate-portfile.sh $<TARGET_FILE:Plumed2::plumed_bin> ${PLUMEDVIM_BINARY_DIR}
DEPENDS Plumed2::plumed_bin
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating vim syntax files")

add_custom_target(macports
DEPENDS science/plumed/Portfile
python/py-plumed/Portfile
)
set (_REVISION_ 0)
set (_VERSION_ ${PLUMED_VERSION_GIT})
FILE(CONFIGURE OUTPUT science/plumed/Portfile
CONTENT
[=[# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup mpi 1.0
PortGroup linear_algebra 1.0
PortGroup debug 1.0
PortGroup cmake 1.1

version @_VERSION_@
revision @_REVISION_@
name plumed
categories science

# Most of the PLUMED code is L-GPL3. However, PLUMED containts
# molfile plugins from VMD that are released with a BSD-like license
# http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/
license LGPL-3 BSD
maintainers {gmail.com:giovanni.bussi @GiovanniBussi} openmaintainer
description PLUMED is a plugin for molecular dynamics
long_description PLUMED is a plugin for molecular dynamics that can be used \
in combination with popular molecular dynamics codes to perform biased simulations. \
Additionally, it can be used as a standalone tool to analyze trajectories.

platforms darwin

homepage http://www.plumed.org/

fetch.type git
git.url @GIT_URL@
git.branch @GIT_VERSION@

### This is required so that patch made with "git format-patch" work correctly
# patch.pre_args -p1
### In case patches from github should be included to fix behavior on macports one should
### - put patch files (as obtained with git format-patch) in files/ directory
### - list their name here:
# patchfiles file1 \
# file2
### etc

# Disable additional features.
# --disable-doc: Do not create documentation, and avoid searching for Doxygen.
# --disable-libsearch: Avoid searching libraries using their default names.
# This forces the libraries names to be explicitly passed (e.g. "-lz").
# It has the advantage that during compilation from source it does not
# link packages that are not explicitely required.
# --disable-static-patch: Avoid a number of tests that are only required when linking plumed
# statically to an MD code.
# --disable-mpi: Do not search for MPI compiler (replaced when enabling mpi, see below)
# --disable-python: Python wrappers will be installed with a separate python port
configure.args-append \
-DCMAKE_BUILD_TYPE=Release \
-Doption_relaxed_dependencies=ON \
-Denable_mpi=OFF \
-Denable_python=OFF \
-Denable_static_linking=OFF \
-Denable_doc=OFF

# install bash completions
#configure.args-append -DBASH_COMPLETION_DIR=${prefix}/share/bash-completion/completions

# Hardcode path for libplumedKernel.dylib.
# This allows to patch MD codes using the --runtime option but using as
# default kernel the installed one. In this way, MacPorts users
# can just use patched MD codes with the installed plumed or replace it
# by setting PLUMED_KERNEL at runtime
configure.cppflags-append "-D__PLUMED_DEFAULT_KERNEL=${prefix}/lib/libplumedKernel.dylib"

compilers.choose cc cxx
compiler.cxx_standard 2011

mpi.setup

# To enable mpi, replace a configure flag
if {[mpi_variant_isset]} {
configure.args-replace -Denable_mpi=OFF -Denable_mpi=ON
# command should be included in a pre-configure block to access properly the mpi.exec variable
# pre-configure {
# # MPIEXEC is stored so that it can be used to perform tests
# configure.args-append MPIEXEC="${mpi.exec}"
# }
}

# Libraries.
# Library names are specified here to make sure that
# only requested packages are linked.

depends_lib-append port:fftw-3 \
port:gawk \
port:gsl \
port:zlib

# C++ library
# Required in order to use clang with gcc library on old OSX versions.
# See https://github.com/macports/macports-ports/pull/1254
if {[string match *clang* ${configure.compiler}]} {
configure.ldflags-append -stdlib=${configure.cxx_stdlib}
}

# This variant enables optional modules in PLUMED.
# Notice that one of the optional modules (drr) requires boost_serialization
variant allmodules description {Enable all optional modules} {
configure.args-append \
-Dallmodules_activate=ON \
-Denable_boost_serialization=ON
#configure.ldflags-append -lboost_serialization-mt
depends_lib-append port:boost
}

# Link lapack/blas libraries
# pre-configure {
# # commands should be included in a pre-configure block to access tcl variables
# configure.ldflags-append ${linalglib}
# }

# Allow running tests from MacPorts
test.run yes
test.target check

]=]
@ONLY
)
#TODO: Bash completitions
8 changes: 4 additions & 4 deletions regtest/basic/rt-make-8/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ int main(){
}
int inca=1;
int incb=1;
ofs<<plumed_blas_ddot(&size,&ad[0],&inca,&bd[0],&incb)<<"\n";
ofs<<plumed_blas_sdot(&size,&af[0],&inca,&bf[0],&incb)<<"\n";
ofs<<plumed_lapack_dlapy2(&ad[0],&bd[0])<<"\n";
ofs<<plumed_lapack_slapy2(&af[0],&bf[0])<<"\n";
ofs<< "plumed_blas_ddot = " <<plumed_blas_ddot(&size,&ad[0],&inca,&bd[0],&incb)<<"\n";
ofs<< "plumed_blas_sdot = " <<plumed_blas_sdot(&size,&af[0],&inca,&bf[0],&incb)<<"\n";
ofs<< "plumed_lapack_dlapy2 = " <<plumed_lapack_dlapy2(&ad[0],&bd[0])<<"\n";
ofs<< "plumed_lapack_slapy2 = " <<plumed_lapack_slapy2(&af[0],&bf[0])<<"\n";
return 0;
}
8 changes: 4 additions & 4 deletions regtest/basic/rt-make-8/output.reference
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
75
75
7.07107
7.07107
plumed_blas_ddot = 75
plumed_blas_sdot = 75
plumed_lapack_dlapy2 = 7.07107
plumed_lapack_slapy2 = 7.07107
Loading