Skip to content
Snippets Groups Projects
Commit 3b165747 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Allow macport regtests on plumed/plumed2 repository

It works creating a local Portfile so as to test
non released plumed versions.
parent ba641ce0
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,13 @@ matrix:
# osx parallel
- os: osx
env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ PLUMED_CXXFLAGS=-O3
# osx serial macports
- os: osx
env: PLUMED_MACPORTS="plumed"
# osx serial macports debug variant
- os: osx
env: PLUMED_MACPORTS="plumed +crystallization +manyrestraints"
# I don't put any mpi variant with macports since it takes too long to compile
allow_failures:
# I allow this to fail temporarily
- env: CPPCHECK=yes CPPCHECK_VERSION=1.74
......@@ -66,7 +73,7 @@ install:
- ./.travis/check.log valgrind || VALGRIND=no
- ./.travis/check.log almost || ALMOST=no
# update packages
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update > /dev/null ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && test -z "$PLUMED_MACPORTS" ; then brew update > /dev/null ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq ; fi
# install some package - these are fast, we install them anyway
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libmatheval-dev ; fi
......@@ -94,6 +101,15 @@ install:
# moreover, we hardcode path to dynamic library, required for xdrfile to link properly
# I do it only when LD_LIBRARY_PATH is non blank, since otherwise clang gives problems
- if test -n "$LD_LIBRARY_PATH" ; then PLUMED_LDFLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" ; fi
# macports related stuff
- if test -n "$PLUMED_MACPORTS" ; then stty rows 40 columns 80 ; fi
- if test -n "$PLUMED_MACPORTS" ; then wget https://distfiles.macports.org/MacPorts/MacPorts-2.3.4.tar.bz2 && tar xvfj MacPorts-2.3.4.tar.bz2 ; fi
- if test -n "$PLUMED_MACPORTS" ; then cd MacPorts-2.3.4 && ./configure && sudo make install && cd - && sudo rm -fr MacPorts-2.3.4 ; fi
- if test -n "$PLUMED_MACPORTS" ; then export PATH=/opt/local/bin:$PATH ; fi
- if test -n "$PLUMED_MACPORTS" ; then sudo port -v selfupdate ; fi
- if test -n "$PLUMED_MACPORTS" ; then make macports ; fi
- if test -n "$PLUMED_MACPORTS" ; then ./.travis/config.macports.sh ; fi
script:
# we enable crystallization and manyrestraints modules
- CONFIG_FLAGS="$CONFIG_FLAGS --enable-modules=crystallization:manyrestraints"
......@@ -107,12 +123,15 @@ script:
# we install plumed so that it is in the path
- if test "$PLUMED_CXX" ; then make install prefix="$HOME/opt" ; fi
# build using macports
- if test -n "$PLUMED_MACPORTS" ; then sudo port install $PLUMED_MACPORTS ; fi
# TEST:
- if test "$VALGRIND" == yes ; then OPT=valgrind ; else OPT="" ; fi
- if test "$PLUMED_CXX" ; then make -C regtest $OPT ; fi
- if test "$PLUMED_CXX" || test -n "$PLUMED_MACPORTS" ; then make -C regtest $OPT ; fi
- if test "$MAKEDOC" == yes ; then make -C regtest copytodoc ; fi
- if test "$MAKEDOC" == yes ; then make doc >/dev/null ; fi
- if test "$PLUMED_CXX" ; then make -C regtest checkfail ; fi
- if test "$PLUMED_CXX" || test -n "$PLUMED_MACPORTS" ; then make -C regtest checkfail ; fi
# CPPCHECK:
# this is required so as to have all the include files inplace:
......
#! /bin/bash
set -e
set -x
cd macports
cp /opt/local/etc/macports/sources.conf $$
awk -v repo="file://$PWD" '{if($NF=="[default]") print repo; print}' $$ > $$.new
sudo mv -f $$.new /opt/local/etc/macports/sources.conf
echo "** NEW SOURCES"
cat /opt/local/etc/macports/sources.conf
echo "** END NEW SOURCES"
rm -f $$
portindex
......@@ -4,12 +4,12 @@ endif
SRCDIRS := src test
SUBDIRS := $(SRCDIRS) user-doc developer-doc regtest
SUBDIRS := $(SRCDIRS) user-doc developer-doc regtest macports
SUBDIRSCLEAN:=$(addsuffix .clean,$(SUBDIRS))
.PHONY: all lib clean $(SRCDIRS) doc docclean check cppcheck distclean all_plus_docs
.PHONY: all lib clean $(SRCDIRS) doc docclean check cppcheck distclean all_plus_docs macports
# if machine dependent configuration has been found:
ifdef GCCDEP
......@@ -90,6 +90,9 @@ docclean:
cppcheck:
$(MAKE) -C src cppcheck
macports:
$(MAKE) -C macports
# stamp-h file keeps track of when ./configure was last applied
# the procedure below is taken from:
# https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Automatic-Remaking.html#Automatic-Remaking
......
/science
all:
./generate-portfile.sh
clean:
rm -fr science
# -*- 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
# $Id: Portfile 123374 2014-08-08 21:53:07Z mojca@macports.org $
PortSystem 1.0
name plumed
PortGroup mpi 1.0
PortGroup linear_algebra 1.0
PortGroup debug 1.0
version @_VERSION_@
revision @_REVISION_@
categories science
license LGPL-3
maintainers gmail.com:giovanni.bussi
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_@
# 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:
# Disable additional features.
# they are then re-enabled when selecting proper variants
# this is important for features that require an additional package to be
# sure that even if the user has that package already installed plumed is
# not going to use it.
configure.args-append \
--disable-matheval \
--disable-xdrfile \
--disable-molfile-plugins \
--disable-zlib \
--disable-mpi \
--disable-gsl
# 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
mpi.setup
if {[mpi_variant_isset]} {
configure.args-replace --disable-mpi --enable-mpi
}
variant matheval description {Enable libmatheval} {
configure.args-replace --disable-matheval --enable-matheval
depends_lib-append port:libmatheval
}
variant xdrfile description {Enable xdrfile} {
configure.args-replace --disable-xdrfile --enable-xdrfile
depends_lib-append port:xdrfile
}
variant zlib description {Enable zlib} {
configure.args-replace --disable-zlib --enable-zlib
depends_lib-append port:zlib
}
variant gsl description {Enable gsl} {
configure.args-replace --disable-gsl --enable-gsl
depends_lib-append port:gsl
}
variant molfile description {Enable molfile - includes some BSD code} {
license ${license} BSD
configure.args-replace --disable-molfile-plugins --enable-molfile-plugins
}
variant doc description {Also compile documentation} {
depends_build-append port:doxygen
depends_build-append port:graphviz
build.target all_plus_docs
}
# this is a tcl variable contains a concatenated list of modules
# to be activated
set plumed_modules reset
variant crystallization description {Enable crystallization module} {
set plumed_modules ${plumed_modules}+crystallization
}
variant manyrestraints description {Enable manyrestraints module} {
set plumed_modules ${plumed_modules}+manyrestraints
}
#### I leave this out momentarily since it has problems
# variant imd description {Enable imd module - includes some proprietary code} {
# license ${license} Restrictive
# set plumed_modules ${plumed_modules}+imd
# }
pre-configure {
# commands should be included in a pre-configure block to access tcl variables
configure.args-append --enable-modules=${plumed_modules}
configure.ldflags-append ${linalglib}
}
# Default variants include no optional modules.
# Additionally, the link libraries that are very useful (e.g. matheval of xdrfile)
# and quick to compile
default_variants +matheval +xdrfile +zlib +molfile
# This is required since PLUMED installation does not do it explicitly.
# It might be removed when this will be incorporated upstream
post-destroot {
system "install_name_tool -id ${prefix}/lib/libplumed.dylib ${destroot}${prefix}/lib/libplumed.dylib"
system "install_name_tool -id ${prefix}/lib/libplumedKernel.dylib ${destroot}${prefix}/lib/libplumedKernel.dylib"
}
#! /bin/bash
# This script generates a Portfile in science/plumed
# Currently the portfile is aimed at testing the currect git hash
# TODO:
# - Analyze configure.ac to generate the list of variants
# - Allow for a proper release port.
# This would require a portfile that is based on a tag (e.g. v2.3.0),
# optionally including patches, that can be then uploaded to macports
hash=$( git log -1 --format="%h")
mkdir -p science/plumed
# parent directory:
repository="${PWD%/*}"
cat Portfile.in |
sed "
s/@_VERSION_@/$hash/
s/@_REVISION_@/0/
" | awk '{
if($1=="@_FETCH_@"){
print "fetch.type git"
print "git.url '$repository'"
# notice that if instead of hashtag we want to put a version, then it should be
# git.branch v${version}
print "git.branch ${version}"
} else print
}' > science/plumed/Portfile
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment