source: trunk/dports/math/dolfin/Portfile @ 150520

Last change on this file since 150520 was 150520, checked in by sean@…, 17 months ago

dolfin: update to 2016.1.0

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