Ticket #15614: Portfile

File Portfile, 3.5 KB (added by ajb78@…, 16 years ago)

portfile for atlas + lapack

Line 
1# $Id$
2
3PortSystem         1.0
4
5categories-append  math
6name               atlas
7version            3.8.2
8
9# additional versions
10set lapackversion  3.1.1
11set lapackname     lapack
12set atlasdist      ${name}${version}.tar.bz2
13set lapackdist     ${lapackname}-${lapackversion}.tgz
14
15maintainers        nomaintainer
16platforms          darwin
17
18description        Portable optimal linear algebra software
19long_description   The current version provides a complete BLAS and LAPACK API.\
20                   For many operations, ATLAS achieves performance on par with\
21                   machine-specific tuned libraries.
22
23homepage           http://math-atlas.sourceforge.net/
24
25master_sites       sourceforge:math-atlas/${name}${version}.tar.bz2:atlas\
26                   http://www.netlib.org/lapack:lapack
27
28distfiles          ${atlasdist}:atlas \
29                   ${lapackdist}:lapack
30
31checksums          ${atlasdist} \
32                   md5 dd888f5d066c1fafeaaf2ae6b37e0b85 \
33                   sha1 2d1f2f789f57c9e7e8957f275b67c33176a36e0c \
34                   rmd160 8160ccb3af7cd7365ba87c77d636fb68b24c62ae \
35                   ${lapackdist} \
36                   md5 00b21551a899bcfbaa7b8443e1faeef9 \
37                   sha1 be1a3d53d761935703a7be88c3dd1164daa79554 \
38                   rmd160 ba864e7a2b759ba1337ea9a452e12a7ab5494cdc
39
40extract {
41    # extract atlas and move to a consistent working directory name
42    system "cd ${workpath} && bunzip2 -dc ${distpath}/${atlasdist} | \
43         gnutar --no-same-owner -xf -"
44    system "mv ${workpath}/ATLAS ${workpath}/${name}-${version}"
45
46    # extract lapack
47    system "cd ${workpath} && gunzip -dc ${distpath}/${lapackdist} | \
48         gnutar --no-same-owner -xf -"
49}
50
51# Set fortran compiler flags
52set myf77     ${prefix}/bin/gfortran-mp-4.3
53set myfflags  "-fomit-frame-pointer -O3"
54
55pre-configure {
56    # compile lapack
57    system "cd ${workpath}/${lapackname}-${lapackversion} && \
58            cp INSTALL/make.inc.gfortran make.inc"
59    reinplace "s|gfortran|${myf77}|" \
60           ${workpath}/${lapackname}-${lapackversion}/make.inc
61    reinplace "s|OPTS     = -O2|OPTS = ${myfflags}|" \
62           ${workpath}/${lapackname}-${lapackversion}/make.inc
63    reinplace "s|PLAT = _LINUX|PLAT = _darwin|" \
64           ${workpath}/${lapackname}-${lapackversion}/make.inc
65    system "cd ${workpath}/${lapackname}-${lapackversion} && make lib"
66
67    # create a build directory for atlas
68    file mkdir ${workpath}/${name}-${version}/build
69}
70
71# we are configuring from the build directory
72configure.dir   ${workpath}/${name}-${version}/build
73configure.cmd   ../configure
74
75# change the default compilers to those of gcc43 and make into shared library
76configure.args  --with-netlib-lapack=${workpath}/${lapackname}-${lapackversion}/lapack_darwin.a \
77                -C xc ${prefix}/bin/gcc-mp-4.3 \
78                -C gc ${prefix}/bin/gcc-mp-4.3 \
79                -C if ${myf77}\
80                -F if '${myfflags}'\
81                -C ic ${prefix}/bin/gcc-mp-4.3 \
82                -C dm ${prefix}/bin/gcc-mp-4.3 \
83                -C sm ${prefix}/bin/gcc-mp-4.3 \
84                -C dk ${prefix}/bin/gcc-mp-4.3 \
85                -C sk ${prefix}/bin/gcc-mp-4.3
86
87post-configure {
88    # recursively remove directories
89    reinplace "s|rm -f|rm -rf|g" ${workpath}/${name}-${version}/build/Makefile
90}
91
92use_parallel_build  yes
93build.target build
94build.dir    ${workpath}/${name}-${version}/build
95
96destroot.dir ${build.dir}
97destroot.destdir DESTDIR=${destroot}${prefix}
98depends_lib-append port:gcc43