source: trunk/dports/science/gromacs/Portfile

Last change on this file was 153335, checked in by dstrubbe@…, 12 months ago

gromacs: Fix testing, via some hacks of dylibs. Enable choice of linear algebra library, rather than just using whatever the cmake configure can find (OpenBLAS in fact being its preference).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1# -*- 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
2# $Id: Portfile 153335 2016-09-29 04:55:39Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           muniversal 1.0
6PortGroup           cmake 1.0
7PortGroup           mpi 1.0
8PortGroup           linear_algebra 1.0
9
10name                gromacs
11revision            1
12version             5.1.4
13categories          science math
14license             GPL-2
15maintainers         dstrubbe openmaintainer
16description         The World's fastest Molecular Dynamics package
17long_description    GROMACS is a versatile package to perform molecular \
18                    dynamics, i.e. simulate the Newtonian equations of motion for \
19                    systems with hundreds to millions of particles. It is primarily \
20                    designed for biochemical molecules like proteins and lipids that \
21                    have a lot of complicated bonded interactions, but since GROMACS is \
22                    extremely fast at calculating the nonbonded interactions (that \
23                    usually dominate simulations) many groups are also using it for \
24                    research on non-biological systems, e.g. polymers.
25platforms           darwin
26
27homepage            http://www.gromacs.org/
28master_sites        http://ftp.gromacs.org/pub/gromacs
29
30# md5 published at http://www.gromacs.org/Downloads
31checksums           rmd160  d14fdd219dfe3a0252fc594031b8e9ce890ef3c6 \
32                    sha256  0f3793d8f1f0be747cf9ebb0b588fb2b2b5dc5acc32c3046a7bee2d2c03437bc \
33                    md5 ba2e34d59b3982603b4935d650c08040
34
35depends_build-append \
36                    port:pkgconfig
37
38depends_lib-append  port:fftw-3-single port:libxml2
39
40# FIXME: enable use of avx when appropriate, instead of just SSE
41configure.args-append  -DGMX_SIMD:STRING="SSE4.1" -DBUILD_TESTING:BOOL=ON -DGMX_X11:BOOL=OFF
42# boost?
43
44variant x11 description {Enable GMX view via X11} {
45    configure.args-replace  -DGMX_X11:BOOL=OFF -DGMX_X11:BOOL=ON
46    depends_lib-append      port:xorg-libX11 port:xorg-libXext
47}
48
49# FIXME: use threads.
50#:info:configure -- Could NOT find OpenMP (missing:  OpenMP_C_FLAGS OpenMP_CXX_FLAGS)
51#:info:configure CMake Warning at cmake/gmxManageOpenMP.cmake:78 (message):
52#:info:configure   The compiler you are using does not support OpenMP parallelism.  This might
53#:info:configure   hurt your performance a lot, in particular with GPUs.  Try using a more
54#:info:configure   recent version, or a different compiler.  For now, we are proceeding by
55#:info:configure   turning off OpenMP.
56
57compilers.choose    cc cxx
58mpi.setup
59
60test.run     yes
61test.target  check
62pre-test {
63    if {[mpi_variant_isset]} {
64        set suffix _mpi
65    } else {
66        set suffix ""
67    }
68    system -W ${worksrcpath} "install_name_tool -change ${prefix}/lib/libgromacs${suffix}.1.dylib @executable_path/../lib/libgromacs${suffix}.1.dylib bin/gmx${suffix}"
69    # reset name for new executables that will be built in this phase
70    system -W ${worksrcpath} "install_name_tool -id @executable_path/../lib/libgromacs${suffix}.1.dylib lib/libgromacs${suffix}.1.dylib"
71}
72post-test {
73    # undo changes, in case 'install' is done afterward
74    system -W ${worksrcpath} "install_name_tool -change @executable_path/../lib/libgromacs${suffix}.1.dylib ${prefix}/lib/libgromacs.1.dylib bin/gmx${suffix}"
75    system -W ${worksrcpath} "install_name_tool -id ${prefix}/lib/libgromacs${suffix}.1.dylib lib/libgromacs${suffix}.1.dylib"
76}
77
78# I encountered this problem with the last test, when using MPI:
79#Program mdrun-mpi-test, VERSION 5.1.4
80#Memory allocation/freeing error:
81#Character buffer too small!
82#For more information and tips for troubleshooting, please check the GROMACS
83#website at http://www.gromacs.org/Documentation/Errors
84
85linalg.setup  noveclibfort
86pre-configure {
87    if {[mpi_variant_isset]} {
88        configure.args-append  -DGMX_MPI:BOOL=ON -DMPIEXEC:STRING="${mpi.exec}"
89    }
90    configure.args-append      -DGMX_BLAS_USER="${linalglib}"
91}
92
93variant double description "Build in double precision" {
94    depends_lib-delete      port:fftw-3-single
95    depends_lib-append      port:fftw-3
96    configure.args-append   --enable-double
97}
98
99subport ${name}-double {
100    replaced_by gromacs
101    PortGroup obsolete 1.0
102    revision 1
103    pre-fetch {
104        ui_warn "Subport 'gromacs-double' is replaced by variant 'gromacs +double'."
105    }
106}
107
108livecheck.type          regex
109livecheck.url           ${homepage}Downloads
110livecheck.regex         ${name}-(\[0-9.\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.