Ticket #32550: Portfile

File Portfile, 4.0 KB (added by mamoll (Mark Moll), 13 years ago)
Line 
1# $Id: Portfile 84523 2011-09-27 17:25:59Z jmr@macports.org $
2
3PortSystem 1.0
4PortGroup  muniversal 1.0
5
6name          arpack
7version       3.0.2
8categories    math
9license       BSD
10platforms     darwin
11maintainers             mmoll
12description             Package for solving large scale eigenvalue problems
13long_description  \
14    ARPACK is a collection of Fortran77 subroutines designed to solve large \
15    scale eigenvalue problems.
16homepage            http://forge.scilab.org/index.php/p/arpack-ng
17master_sites        ${homepage}/downloads/353
18distfiles           get
19checksums           md5     fc744f506911401cf4573b1071c0424f \
20                    sha1    1092e4da3a28707ee3a143defaa99f8fa26bba9f \
21                    rmd160  26c74ff0a5ecd300eb61a1a0abea5bdbaa6e358d
22worksrcdir          ${name}-ng-${version}
23
24pre-fetch {
25        if {"darwin" == ${os.platform} && ${os.major} < 9} {
26                ui_error "${name} ${version} requires Mac OS X 10.5 or greater"
27                return -code error "incompatible Mac OS X version"
28        }
29}
30
31# Fortran compilers can not cross-compile
32if { ${os.arch}=="i386" } {
33    set universal_archs_supported "i386 x86_64"
34} else {
35    set universal_archs_supported "ppc ppc64"
36}
37
38if { ! [variant_isset universal]} {
39  configure.args-append home=${worksrcpath}
40  if { ${build_arch}=="x86_64" || ${build_arch}=="ppc64" } {
41      configure.args-append FFLAGS='-O2 -m64' LDFLAGS='-L${prefix}/lib'
42  } else {
43      configure.args-append FFLAGS='-O2 -m32' LDFLAGS='-L${prefix}/lib'
44  }
45} else {
46  foreach arch {x86_64 i386 ppc ppc64} {
47      set merger_build_args(${arch}) home=${worksrcpath}-${arch}
48      if { ${arch}=="x86_64" || ${arch}=="ppc64" } {
49          lappend merger_build_args(${arch}) FFLAGS='-O2 -m64'
50      } else {
51          lappend merger_build_args(${arch}) FFLAGS='-O2 -m32'
52      }
53  }
54}
55
56variant gcc42 description {build with gfortran-mp-4.2} conflicts gcc43 gcc44 gcc45 g95 universal {
57        depends_build-append    port:gcc42
58        configure.env-append F77=${prefix}/bin/gfortran-mp-4.2
59}
60
61variant gcc43 description {build with gfortran-mp-4.3} conflicts gcc42 gcc44 gcc45 g95 universal {
62        depends_build-append    port:gcc43
63        configure.env-append F77=${prefix}/bin/gfortran-mp-4.3
64}
65
66variant gcc44 description {build with gfortran-mp-4.4} conflicts gcc42 gcc43 gcc45 g95 {
67        depends_build-append    port:gcc44
68        configure.env-append F77=${prefix}/bin/gfortran-mp-4.4
69}
70
71variant gcc45 description {build with gfortran-mp-4.5} conflicts gcc42 gcc43 gcc44 g95 {
72        depends_build-append    port:gcc45
73        configure.env-append F77=${prefix}/bin/gfortran-mp-4.5
74}
75
76variant g95 description {build with g95} conflicts gcc42 gcc43 gcc44 gcc45 universal {
77        depends_build-append    port:g95
78        configure.env-append F77=${prefix}/bin/g95
79}
80
81if { ![variant_isset gcc42] && ![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset g95] } {
82        default_variants      +gcc44
83}
84
85if { [variant_isset gcc42] } {
86  set gccversion    4.2
87} elseif { [variant_isset gcc43] } {
88  set gccversion    4.3
89} elseif { [variant_isset gcc44] } {
90  set gccversion    4.4
91} else {
92  set gccversion    4.5
93}
94set gccnumber       [join [split ${gccversion} .] ""]
95
96variant mpi description {build PARPACK, the parallel eigenvalue solver library} conflicts universal {
97    pre-fetch {         
98        if {![file exists ${prefix}/bin/openmpif77]} {
99            return -code error "Please install one of the following variants of the openmpi port: gcc42, gcc43, gcc44, gcc45."
100        }
101    }
102    depends_build port:openmpi
103    configure.args-append --enable-mpi
104    configure.env-append MPIF77=${prefix}/bin/openmpif77
105}
106
107variant accelerate conflicts atlas description {build with Accelerate framework} {
108    configure.args-append --with-lapack=/usr/lib/liblapack.dylib
109}
110
111variant atlas description {build with atlas} {
112    depends_lib-append port:atlas
113    configure.args-append --with-lapack=${prefix}/lib/liblapack.dylib
114}
115
116if {![variant_isset atlas]} {
117    default_variants +accelerate
118}
119
120livecheck.type  regex
121livecheck.url   ${master_sites}
122livecheck.regex ${name}_(\[0-9.\]+)