source: trunk/dports/math/petsc/Portfile @ 144293

Last change on this file since 144293 was 144293, checked in by sean@…, 4 years ago

petsc: add variant for sprng; fixes #47330

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.5 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 144293 2016-01-06 01:13:38Z sean@macports.org $
3
4PortSystem          1.0
5PortGroup           bitbucket 1.0
6PortGroup           mpi 1.0
7
8bitbucket.setup     petsc petsc 3.6.3 v
9categories          math science
10maintainers         sean
11license             BSD
12description         Portable, Extensible Toolkit for Scientific Computation
13long_description    PETSc, pronounced PET-see (the S is silent), is a suite \
14                    of data structures and routines for the scalable (parallel) solution \
15                    of scientific applications modeled by partial differential equations. \
16                    It employs the MPI standard for all message-passing communication.
17
18platforms           darwin
19universal_variant   no
20
21checksums           rmd160  474b5c0cfb17657cdeb8a1b68590efee509b99c5 \
22                    sha256  007f24c7ec8ef4656248253b17e8c5bde5831f888c3a18059a7c7b044ee9e203
23
24mpi.setup
25
26use_parallel_build  no
27
28depends_build-append \
29                    port:sowing \
30                    port:c2html
31
32post-extract {
33    # superlu 4.1 works with 3.6.1, can remove this after next update
34    reinplace "s,4\.1,4.2,g" ${worksrcpath}/config/BuildSystem/config/packages/SuperLU_DIST.py
35    reinplace "s,5\.0,5.1,g" ${worksrcpath}/config/BuildSystem/config/packages/SuperLU.py
36}
37
38pre-configure {
39    configure.args-append \
40        CC="${configure.cc}" \
41        CXX="${configure.cxx}" \
42        FC="${configure.fc}" \
43        F77="${configure.fc}" \
44        F90="${configure.fc}" \
45        COPTFLAGS="${configure.optflags}" \
46        CXXOPTFLAGS="${configure.optflags}" \
47        FOPTFLAGS="${configure.optflags}" \
48        LDFLAGS="${configure.ldflags}" \
49        CPPFLAGS="${configure.cppflags}" \
50        CFLAGS="${configure.cflags} ${configure.cc_archflags}" \
51        CXXFLAGS="${configure.cxxflags}" \
52        FFLAGS="${configure.fcflags}" \
53        FCFLAGS="${configure.fcflags}" \
54        F90FLAGS="${configure.fcflags}" \
55        PETSC_ARCH="arch-macports"
56
57    if {[mpi_variant_isset]} {
58        configure.args-delete --with-mpi=0 \
59                              --with-fc=0
60        configure.args-append --with-mpiexec=${mpi.exec}
61    } elseif {[fortran_variant_isset]} {
62        configure.args-delete --with-fc=0
63    }
64
65}
66
67subport petsc-devel {
68    bitbucket.setup     petsc petsc 8fe480cde362
69    bitbucket.livecheck master
70    version             3.6.99
71    revision            12
72    name                petsc-devel
73
74    checksums           rmd160  3e552a9a9d22e23977323403ad63bc28f2ec9858 \
75                        sha256  4133d72c538892e21da00f9f97369fee4612ca69220e03f8492075ba28b04fe3
76}
77
78notes               "Add the following line to your .bash_profile if you plan to use\
79                    the PETSC makefile rules in $prefix/lib/petsc/conf: \n\
80                    \texport PETSC_DIR=${prefix}/lib/${name}"
81
82configure.args      --prefix=${prefix}/lib/${name} \
83                    --with-valgrind=0 \
84                    --with-mpi=0 \
85                    --with-fc=0 \
86                    --with-shared-libraries \
87                    --with-debugging=0 \
88                    --with-c2html-dir=${prefix} \
89                    --without-x
90
91post-destroot {
92    set dev ""
93    if {[string first "-devel" $subport] > 0} {
94        set dev "-devel"
95    }
96
97    move ${destroot}${prefix}/lib/${name}/lib/pkgconfig/PETSc.pc ${destroot}${prefix}/lib/pkgconfig/PETSc${dev}.pc
98}
99
100variant accelerate description {Use Accelerate framework for LAPACK} conflicts atlas {
101    configure.args-append --with-blas-lapack-lib=/System/Library/Frameworks/Accelerate.framework/Versions/Current/Accelerate
102}
103
104variant atlas description {Use Atlas for LAPACK} conflicts accelerate {
105    configure.args-append --with-blas-lapack-lib=${prefix}/lib/libtatlas.dylib
106}
107
108variant complex description {Build with support for complex numbers} conflicts sundials hwloc {
109    configure.args-append --with-scalar-type=complex
110    configure.args-append --with-clanguage=C++
111}
112
113variant hwloc description {Build with hwloc} conflicts complex {
114    depends_build-append  port:hwloc
115    configure.args-append --with-hwloc-dir=${prefix}
116}
117
118variant suitesparse description {Build with CHOLDMOD and UMFPACK} {
119    depends_lib-append    port:SuiteSparse
120    configure.args-append --with-suitesparse-dir=${prefix}
121}
122
123variant sundials description {Build with CVODE interface for TS} {
124    depends_lib-append    port:sundials
125    configure.args-append --with-sundials-dir=${prefix}
126    mpi.enforce_variant   sundials
127}
128
129if {[string first "-devel" $subport] > 0} {
130variant superlu description {Build with SuperLU interface for a serial direct solver} {
131    depends_lib-append    port:superlu
132    configure.args-append --with-superlu-dir=${prefix}
133}
134}
135
136variant mumps description {Build with MUMPS interface for a parallel direct solver} requires parmetis {
137    depends_lib-append    port:mumps
138    configure.args-append --with-scalapack-dir=${prefix} \
139                          --with-mumps-dir=${prefix}
140    mpi.enforce_variant   mumps
141}
142
143variant superlu_dist description {Build with SuperLU_DIST interface for a parallel direct solver} requires parmetis {
144    depends_lib-append    port:superlu_dist
145    configure.args-append --with-superlu_dist-dir=${prefix}
146    mpi.enforce_variant   superlu_dist
147}
148
149variant ml description {Build with ML interface for a sparse parallel solver} {
150    depends_lib-append    port:ml
151    configure.args-append --with-ml-dir=${prefix}
152    mpi.enforce_variant   ml
153}
154
155variant hypre description {Build with HYPRE interface for a sparse parallel solver} {
156    depends_lib-append    port:hypre
157    configure.args-append --with-hypre-dir=${prefix}
158    mpi.enforce_variant   hypre
159}
160
161variant parmetis description {Build with ParMetis interface for parallel graph partitioning} {
162    depends_lib-append    port:metis \
163                          port:parmetis
164    configure.args-append --with-metis-dir=${prefix} \
165                          --with-parmetis-dir=${prefix}
166    mpi.enforce_variant   parmetis
167}
168
169variant hdf5 description {Build with HDF5 interface for parallel file io} {
170    depends_lib-append    port:hdf5
171    configure.args-append --with-hdf5-dir=${prefix}
172
173    mpi.enforce_variant   hdf5
174}
175
176variant netcdf description {Build with NetCDF interface for parallel file io} requires hdf5 {
177    depends_lib-append    port:netcdf
178    configure.args-append --with-netcdf-dir=${prefix}
179    mpi.enforce_variant   netcdf
180}
181
182variant fftw description {Build with FFTW interface (requires MPI)} {
183    depends_lib-append    port:fftw-3
184    configure.args-append --with-fftw-dir=${prefix}
185    mpi.enforce_variant   fftw-3
186}
187
188variant yaml description {Build with YAML interface for option reading} {
189    depends_lib-append    port:libyaml
190    configure.args-append --with-yaml-dir=${prefix}
191}
192
193variant valgrind description {Build with valgrind support} {
194    depends_lib-append    port:valgrind
195    configure.args-delete --with-valgrind=0
196    configure.args-append --with-valgrind-dir=${prefix}
197}
198
199variant sprng description {Build with SPRNG interface for a sparse random number generator} {
200    depends_lib-append    port:sprng
201    configure.args-append --with-sprng-dir=${prefix}
202    mpi.enforce_variant   sprng
203}
204
205variant debug description {Build with debug support} {
206    configure.args-delete --with-debugging=0
207    configure.args-append --with-debugging=1
208}
209
210if {![mpi_variant_isset]} {
211    default_variants +mpich
212}
213
214if {![variant_isset atlas]} {
215    default_variants +accelerate
216}
217
218if {![variant_isset complex]} {
219    default_variants +hwloc
220}
221
222destroot.destdir    DESTDIR=${destroot}${prefix}/lib/${name}
Note: See TracBrowser for help on using the repository browser.