source: trunk/dports/math/dolfin/Portfile

Last change on this file was 152190, checked in by sean@…, 11 months ago

dolfin: rev bump due to sundials

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.4 KB
Line 
1# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 152190 2016-08-31 20:58:59Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           bitbucket 1.0
6PortGroup           cmake 1.0
7PortGroup           mpi 1.0
8
9bitbucket.setup     fenics-project dolfin 2016.1.0 dolfin-
10revision            1
11categories          math
12license             LGPL-3+
13platforms           darwin
14universal_variant   no
15maintainers         sean openmaintainer
16description         DOLFIN is a part of FEniCS
17long_description    DOLFIN is a library that functions as the main user interface of FEniCS
18
19checksums           rmd160  4a8f9c21a947b204338c9cf17f2cbe642f64190e \
20                    sha256  0db95c8f193fd56d741cb90682e0a6a21e366c4f48d33e1eb501d2f98aa1a05b
21
22mpi.setup           require
23
24configure.args-append \
25                    -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.7 \
26                    -DPYTHON_INCLUDE_DIR:PATH=${frameworks_dir}/Python.framework/Headers \
27                    -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.7.dylib \
28                    -DDOLFIN_INSTALL_PYTHON_MODULE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages \
29                    -DDOLFIN_INSTALL_PYTHON_PURE_MODULE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages \
30                    -DDOLFIN_ENABLE_CGAL:BOOL=OFF \
31                    -DDOLFIN_ENABLE_DOCS:BOOL=OFF \
32                    -DDOLFIN_ENABLE_HDF5:BOOL=OFF \
33                    -DDOLFIN_ENABLE_MPI:BOOL=ON \
34                    -DDOLFIN_ENABLE_PARMETIS:BOOL=OFF \
35                    -DDOLFIN_ENABLE_PETSC:BOOL=OFF \
36                    -DDOLFIN_ENABLE_PETSC4PY:BOOL=OFF \
37                    -DDOLFIN_ENABLE_SCOTCH:BOOL=OFF \
38                    -DDOLFIN_ENABLE_SLEPC:BOOL=OFF \
39                    -DDOLFIN_ENABLE_SLEPC4PY:BOOL=OFF \
40                    -DDOLFIN_ENABLE_SPHINX:BOOL=OFF \
41                    -DDOLFIN_ENABLE_TRILINOS:BOOL=OFF \
42                    -DDOLFIN_ENABLE_CHOLMOD:BOOL=OFF \
43                    -DDOLFIN_ENABLE_UMFPACK:BOOL=OFF \
44                    -DDOLFIN_ENABLE_PASTIX:BOOL=OFF
45
46depends_build-append \
47                    port:pkgconfig
48
49depends_lib-append  port:python27 \
50                    port:py27-ply \
51                    port:armadillo \
52                    port:py27-ffc \
53                    port:vtk \
54                    port:eigen3
55
56configure.post_args ..
57configure.dir       ${worksrcpath}/build
58build.dir           ${worksrcpath}/build
59
60post-patch {
61    file mkdir ${worksrcpath}/build
62    # delete the message telling users to source a bash file, which is unneeded
63    # for the macports version
64    delete ${worksrcpath}/cmake/post-install/
65    reinplace "s,add_subdirectory(cmake/post-install),," ${worksrcpath}/CMakeLists.txt
66
67    # we also need to find and replace all instances of '/usr/bin/env python'
68    system -W ${worksrcpath} "find . -type f -exec /usr/bin/perl -pi -e 's,/usr/bin/env python,${prefix}/bin/python2.7,' {} +"
69}
70
71# dolfin's configure seems to be too good at find default compilers so we
72# explicitly set them here
73pre-configure {
74    mpi.enforce_variant   boost
75    configure.args-append \
76                    -DCMAKE_C_COMPILER=${configure.cc} \
77                    -DCMAKE_CXX_COMPILER=${configure.cxx} \
78                    -DCMAKE_Fortran_COMPILER=${configure.fc} \
79                    -DMPI_C_COMPILER=${mpi.cc} \
80                    -DMPI_CXX_COMPILER=${mpi.cxx} \
81                    -DMPI_Fortran_COMPILER=${mpi.fc} \
82                    -DMPIEXEC=${mpi.exec}
83}
84
85variant cgal description {Build with CGAL interface} {
86    depends_lib-append    port:cgal
87    configure.args-delete -DDOLFIN_ENABLE_CGAL:BOOL=OFF
88    configure.args-append -DDOLFIN_ENABLE_CGAL:BOOL=ON
89}
90
91variant docs description {Build documentation} {
92    depends_lib-append    port:py27-sphinx
93    configure.args-delete -DDOLFIN_ENABLE_DOCS:BOOL=OFF \
94                          -DDOLFIN_ENABLE_SPHINX:BOOL=OFF
95    configure.args-append -DDOLFIN_ENABLE_DOCS:BOOL=ON \
96                          -DDOLFIN_ENABLE_SPHINX:BOOL=ON \
97                          -DSPHINX_EXECUTABLE:FILEPATH=${prefix}/bin/sphinx-build-2.7
98}
99
100variant hdf5 description {Build with HDF5 interface} {
101    depends_lib-append    port:hdf5
102    configure.args-delete -DDOLFIN_ENABLE_HDF5:BOOL=OFF
103    configure.args-append -DDOLFIN_ENABLE_HDF5:BOOL=ON
104    mpi.enforce_variant   hdf5
105}
106
107variant parmetis description {Build with parmetisinterface} {
108    depends_lib-append    port:parmetis
109    configure.args-delete -DDOLFIN_ENABLE_PARMETIS:BOOL=OFF
110    configure.args-append -DDOLFIN_ENABLE_PARMETIS:BOOL=ON
111    mpi.enforce_variant   parmetis
112}
113
114variant scotch description {Build with SCOTCH interface} {
115    depends_lib-append    port:scotch
116    configure.args-delete -DDOLFIN_ENABLE_SCOTCH:BOOL=OFF
117    configure.args-append -DDOLFIN_ENABLE_SCOTCH:BOOL=ON
118    mpi.enforce_variant   scotch
119}
120
121variant suitesparse description {Build with SuiteSparse interface} {
122    depends_lib-append    port:SuiteSparse
123    configure.args-delete -DDOLFIN_ENABLE_CHOLMOD:BOOL=OFF \
124                          -DDOLFIN_ENABLE_UMFPACK:BOOL=OFF
125    configure.args-append -DDOLFIN_ENABLE_CHOLMOD:BOOL=ON \
126                          -DDOLFIN_ENABLE_UMFPACK:BOOL=ON
127}
128
129variant petsc description {Build with PETSc interface} {
130    # dolfin assumes too much about petsc on the mac so we patch the cmake
131    # files to remove this special logic
132    depends_lib-append    port:petsc
133    configure.args-delete -DDOLFIN_ENABLE_PETSC:BOOL=OFF
134    configure.args-append -DDOLFIN_ENABLE_PETSC:BOOL=ON
135    configure.env-append  PETSC_DIR=${prefix}/lib/petsc PETSC_ARCH=
136    mpi.enforce_variant   petsc
137}
138
139variant petsc4py description {Build with PETSc4py interface} requires petsc {
140    depends_lib-append    port:py27-petsc4py
141    configure.args-delete -DDOLFIN_ENABLE_PETSC4PY:BOOL=OFF
142    configure.args-append -DDOLFIN_ENABLE_PETSC4PY:BOOL=ON
143}
144
145variant slepc description {Build with SLEPc interface} requires petsc {
146    depends_lib-append    port:slepc
147    configure.args-delete -DDOLFIN_ENABLE_SLEPC:BOOL=OFF
148    configure.args-append -DDOLFIN_ENABLE_SLEPC:BOOL=ON
149    configure.env-append  SLEPC_DIR=${prefix}/lib/slepc
150}
151
152variant slepc4py description {Build with SLEPc4py interface} requires slepc {
153    depends_lib-append    port:py27-slepc4py
154    configure.args-delete -DDOLFIN_ENABLE_SLEPC4PY:BOOL=OFF
155    configure.args-append -DDOLFIN_ENABLE_SLEPC4PY:BOOL=ON
156}
157
158default_variants +suitesparse
Note: See TracBrowser for help on using the repository browser.