# -*- 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 # $Id: Portfile 144149 2016-01-03 07:17:55Z mcalhoun@macports.org $ PortSystem 1.0 PortGroup muniversal 1.0 PortGroup compilers 1.0 compilers.choose fc compilers.setup require_fortran -dragonegg name qrupdate version 1.1.2 revision 4 # upstream follows a weird folder naming policy, we need last two digits of version separated by a dot set branch [join [lrange [split ${version} .] 1 2] .] categories math license GPL-3+ maintainers nomaintainer description library for fast updates of QR and Cholesky decompositions long_description a Fortran library for fast updates of QR and Cholesky decompositions homepage http://sourceforge.net/projects/${name}/ platforms darwin master_sites sourceforge:project/qrupdate/qrupdate/${branch} checksums rmd160 9d23b2d13278c335f6208ebb6775df4b4049785c \ sha256 e2a1c711dc8ebc418e21195833814cb2f84b878b90a2774365f0166402308e08 use_configure no build.target lib solib build.args PREFIX=${prefix} destroot.args PREFIX=${prefix} test.args PREFIX=${prefix} patchfiles patch-Makefile.diff post-patch { # Mac install program does not support -D flag. reinplace "s|install -D|install|" ${worksrcpath}/src/Makefile # Running ranlib on static libraries make universal builds a little more complicated. reinplace "s|ar -cr |libtool -o |" ${worksrcpath}/src/Makefile } # Fortran compilers can not cross-compile if {${os.arch} eq "i386"} { set universal_archs_supported "i386 x86_64" } else { set universal_archs_supported "ppc ppc64" } post-configure { if { ! [variant_isset universal] } { if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} { reinplace "s|^FFLAGS=|FFLAGS=-m64 |" ${worksrcpath}/Makeconf } else { reinplace "s|^FFLAGS=|FFLAGS=-m32 |" ${worksrcpath}/Makeconf } } else { foreach arch ${universal_archs_to_use} { if {${arch} eq "x86_64" || ${arch} eq "ppc64"} { reinplace "s|^FFLAGS=|FFLAGS=-m64 |" ${worksrcpath}-${arch}/Makeconf } else { reinplace "s|^FFLAGS=|FFLAGS=-m32 |" ${worksrcpath}-${arch}/Makeconf } } } } variant atlas conflicts accelerate openblas description {build with atlas instead of Accelerate framework} { depends_lib-append port:atlas build.args-append BLAS=-ltatlas LAPACK=-llapack destroot.args-append BLAS=-ltatlas LAPACK=-llapack test.args-append BLAS=-ltatlas LAPACK=-llapack } variant accelerate conflicts atlas openblas description {build with Accelerate framework} { depends_lib-append port:vecLibFort build.args-append BLAS=-lvecLibFort LAPACK=-lvecLibFort destroot.args-append BLAS=-lvecLibFort LAPACK=-lvecLibFort test.args-append BLAS=-lvecLibFort LAPACK=-lvecLibFort } variant openblas conflicts accelerate atlas description {build with Accelerate framework} { PortGroup active_variants 1.1 depends_lib-append path:lib/libopenblas.dylib:OpenBLAS # LAPACK required require_active_variants path:lib/libopenblas.dylib:OpenBLAS lapack build.args-append BLAS=-lopenblas LAPACK=-lopenblas destroot.args-append BLAS=-lopenblas LAPACK=-lopenblas test.args-append BLAS=-lopenblas LAPACK=-lopenblas } if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } { default_variants-append +accelerate } if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } { ui_error "\n\nYou must select either the +accelerate, +atlas, or +openblas variant.\n" return -code error "Invalid variant selection" } if {[variant_isset g95]} { post-patch { reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/Makefile reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/src/Makefile } } else { post-patch { reinplace "s|gfortran|${configure.fc}|" ${worksrcpath}/Makeconf } } test.run yes