source: trunk/dports/science/octopus/Portfile

Last change on this file was 152373, checked in by dstrubbe@…, 15 months ago

octopus: Remove some logic about number of processor for test, which is now handled by the code itself.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.2 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 152373 2016-09-06 04:24:46Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           mpi 1.0
6PortGroup           linear_algebra 1.0
7
8name                octopus
9version             6.0
10categories          science
11platforms           darwin
12license             GPL-2+
13maintainers         dstrubbe
14
15description         A real-space (time-dependent) density-functional theory code.
16long_description    Octopus is a scientific program aimed at ab initio virtual experimentation \
17                    on a hopefully ever-increasing range of system types. \
18                    Electrons are described quantum-mechanically within density-functional \
19                    theory (DFT), in its time-dependent form (TDDFT) when doing simulations \
20                    in time. Nuclei are described classically as point particles. Electron-nucleus \
21                    interaction is described within the pseudopotential approximation.
22homepage            http://www.tddft.org/programs/octopus
23master_sites        ${homepage}/download/${version}
24
25checksums           rmd160  24d568fcf3429cdf3cc3556594b5f8087fd38c7f \
26                    sha256  4a802ee86c1e06846aa7fa317bd2216c6170871632c9e03d020d7970a08a8198
27
28# clang38: errors on operate.o
29compiler.blacklist  macports-clang-3.8
30
31# clang versions are unnecessary
32# dragonegg34-gcc46 segfaults on varia.c
33mpi.setup           require_fortran -dragonegg34 -clang
34
35# this incorrectly passes if libxc +gcc5, octopus +mpich, mpich-default +gcc49
36compilers.enforce_fortran libxc
37compilers.enforce_some_fortran fftw-3
38
39depends_lib         port:libxc port:fftw-3 port:gsl
40
41configure.args      --with-libxc-prefix=${prefix} --with-fftw-prefix=${prefix} \
42                    --disable-gdlib --without-sparskit --with-netcdf-prefix=no \
43                    --with-etsf-io-prefix=no --with-berkeleygw-prefix=no \
44                    --with-arpack=no --with-parpack=no --with-feast=no \
45                    --with-isf-prefix=no --with-pnfft-prefix=no --with-metis-prefix=no \
46                    --with-parmetis-prefix=no --with-libfm=no --with-pfft-prefix=no \
47                    --with-pspio-prefix=no --with-nfft=no --with-blacs=no \
48                    --with-scalapack=no
49# configure will find and use these other libraries unless they are explicitly disabled
50configure.optflags  -O3
51
52default_variants +newuoa
53
54# FIXME: does fortran default variant not happen in time to make fftw-3 get
55# installed +gcc48?
56# gfortran -> gfortran5?
57
58if {[mpi_variant_isset]} {
59    configure.args-delete  --disable-mpi
60    configure.args-append  --enable-mpi
61}
62
63pre-configure {
64    configure.args-append --with-blas="-L${prefix}/lib ${linalglib}"
65}
66
67# no way to turn off PAPI, but there is no port for this anyway.
68
69# libxc does not have universal variant, so octopus cannot either
70universal_variant   no
71
72test.run            yes
73test.target         check
74
75pre-test {
76    if {[mpi_variant_isset]} {
77        test.env-append MPIEXEC=${prefix}/bin/${mpi.exec}
78    }
79
80    # test infrastructure uses /bin/ps for job parallelism which is forbidden by sandboxing
81    append portsandbox_profile " (allow process-exec (literal \"/bin/ps\") (with no-profile))"
82}
83
84variant newuoa description {Build with internal newuoa library for optimal control} {
85    configure.args-append --enable-newuoa
86}
87
88variant threads description {Build with OpenMP and threaded libraries} {
89    configure.args-append --enable-openmp
90}
91
92variant netcdf description {Build with support for NetCDF output} {
93    configure.args-delete   --with-netcdf-prefix=no
94    configure.args-append   --with-netcdf-prefix=${prefix}
95    depends_lib-append      port:netcdf-fortran
96    require_active_variants netcdf-fortran {} universal
97    compilers.enforce_fortran netcdf-fortran
98}
99
100variant etsf_io requires netcdf description {Build with support for ETSF_IO output} {
101    configure.args-delete   --with-etsf-io-prefix=no
102    configure.args-append   --with-etsf-io-prefix=${prefix}
103    depends_lib-append      port:etsf_io
104    compilers.enforce_fortran etsf_io
105}
106
107variant sparskit description {Build with support for SPARSKIT propagators} {
108    configure.args-delete   --without-sparskit
109    configure.args-append   --with-sparskit=${prefix}/lib/libskit.a
110    depends_lib-append      port:sparskit
111}
112
113variant gdlib description {Build with support for definition of domain by 2D image} {
114    configure.args-delete   --disable-gdlib
115    depends_lib-append      port:gd2
116}
117
118variant scalapack description {Build with ScaLAPACK for parallel linear algebra} {
119    configure.args-delete   --with-blacs=no
120    configure.args-delete   --with-scalapack=no
121    configure.args-append   --with-blacs=${prefix}/lib/libscalapack.dylib
122    depends_lib-append      port:scalapack
123
124    if {![mpi_variant_isset]} {
125        ui_error "+scalapack requires an MPI variant. Choose +mpich, +mpich_devel, +openmpi, or +openmpi_devel."
126        return -code error "+scalapack requires an MPI variant."
127    }
128   
129    mpi.setup               require
130    # FIXME: this unnecessarily enforces scalapack had same C compiler as we are using.
131    # also, if +scalapack but no MPI is used, an internal error from active_variants
132    # is produced rather than saying you need MPI or just adding it to variants as intended.
133    # Error: active_variants: Error: invalid port depspec ''
134    # Error:   expecting either: port or (bin|lib|path):foo:port
135    mpi.enforce_variant     scalapack
136}
137
138variant pfft description {Build with PFFT} {
139    depends_lib-append      port:pfft
140    configure.args-delete   --with-pfft-prefix=no
141    configure.args-append   --with-pfft-prefix=${prefix} --with-mpifftw-prefix=${prefix}
142
143    if {![mpi_variant_isset]} {
144        ui_error "+pfft requires an MPI variant. Choose +mpich, +mpich_devel, +openmpi, or +openmpi_devel."
145        return -code error "+pfft requires an MPI variant."
146    }
147    mpi.enforce_variant     pfft
148}
149
150variant arpack description {Build with ARPACK for complex-scaling calculations} {
151    depends_lib-append      port:arpack
152    configure.args-delete   --with-arpack=no
153    configure.args-append   --with-arpack=${prefix}/lib/libarpack.dylib
154}
155
156variant parpack requires arpack description {Build with PARPACK for complex-scaling calculations} {
157    configure.args-delete   --with-parpack=no
158    configure.args-append   --with-parpack=${prefix}/lib/libparpack.dylib
159
160    if {![mpi_variant_isset]} {
161        ui_error "+parpack requires an MPI variant. Choose +mpich, +mpich_devel, +openmpi, or +openmpi_devel."
162        return -code error "+parpack requires an MPI variant."
163    }
164    mpi.enforce_variant     parpack
165}
166
167# there is not much value in having a stand-alone metis variant, since it is a built-in library in octopus
168variant parmetis description {Build with ParMETIS for parallel domain decomposition calculation} {
169    depends_lib-append      port:parmetis
170    require_active_variants metis single
171    configure.args-delete   --with-metis-prefix=no
172    configure.args-delete   --with-parmetis-prefix=no
173    configure.args-append   --with-metis-prefix=${prefix} --with-parmetis-prefix=${prefix}
174
175    if {![mpi_variant_isset]} {
176        ui_error "+parmetis requires an MPI variant. Choose +mpich, +mpich_devel, +openmpi, or +openmpi_devel."
177        return -code error "+parmetis requires an MPI variant."
178    }
179    mpi.enforce_variant     parmetis
180}
181
182variant berkeleygw description {Build with BerkeleyGW output support} {
183    depends_lib-append      port:berkeleygw
184    configure.args-delete   --with-berkeleygw-prefix=no
185    configure.args-append   --with-berkeleygw-prefix=${prefix}
186    compilers.enforce_fortran berkeleygw
187    # FIXME: actually, it is ok if berkeleygw does not have MPI and Octopus does
188    mpi.enforce_variant     berkeleygw
189}
190
191variant everything_serial requires arpack etsf_io netcdf sparskit gdlib berkeleygw \
192    description {Build with all available serial optional dependencies} { }
193
194variant everything requires everything_serial parpack scalapack parmetis pfft \
195    description {Build with all available optional dependencies} { }
196
197variant maxdim4 description {Build with support for 4D calculations} {
198    configure.args-append  --with-max-dim=4
199}
200
201livecheck.type      regex
202livecheck.url       ${homepage}/wiki/index.php/Main_Page
203livecheck.regex     ${name} (\[0-9.\]+)
Note: See TracBrowser for help on using the repository browser.