Fetching contributors…
Cannot retrieve contributors at this time
131 lines (111 sloc) 5.28 KB
# -*- 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 github 1.0
# Notice that this rules out gcc variants.
# See
PortGroup cxx11 1.1
PortGroup mpi 1.0
PortGroup linear_algebra 1.0
PortGroup debug 1.0
github.setup plumed plumed2 2.4.3 v
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
license LGPL-3 BSD
maintainers { @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
checksums rmd160 75a56b958c3d1d64cd73011baa9ca9e5566ecada \
sha256 2bcedb4576da0b24d513d2c9125abeeaff134a6e4935a8dae3af633b2940666a \
size 62368138
# 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)
configure.args-append \
--disable-doc \
--disable-libsearch \
--disable-static-patch \
# 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
# To enable mpi, replace a configure flag
if {[mpi_variant_isset]} {
configure.args-replace --disable-mpi --enable-mpi
# 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}"
# Optimization flags.
# Notice that plumed is computationally heavy and that
# this change has a significant impact in plumed performances
configure.cxxflags-replace -Os -O3
# Libraries.
# Library names are specified here to make sure that
# only requested packages are linked.
configure.ldflags-append \
-lmatheval -lxdrfile -lz -lgsl
depends_lib-append port:gsl \
port:libmatheval \
port:xdrfile \
# C++ library
# Required in order to use clang with gcc library on old OSX versions.
# See
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 --enable-modules=all
configure.args-append --enable-boost-serialization
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}
# plumed-devel subport
# This subport installs the developer version
subport plumed-devel {
github.setup plumed plumed2 831f17cee3c266a92ccd55133d80fd5ee1944a02
version 2.5-20181005
description ${description} (development version)
long_description ${long_description} (development version)
conflicts plumed
checksums rmd160 7ad58c8e684f9d64fa51bb9412c62107f81d587d \
sha256 ae1c839a00f633bd723db674ecdb928f3c8b1f12f6f91f812ef662c75a75527b \
size 66992403
configure.ldflags-delete -lmatheval
depends_lib-delete port:libmatheval
# plumed 2.5 supports python. However, I disable it here since it is
# not correctly integrated with MacPorts yet
configure.args-append --disable-python
# install bash completions
configure.args-append BASH_COMPLETION_DIR=${prefix}/share/bash-completion/completions
# Allow running tests from MacPorts yes check