# -*- 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$ PortSystem 1.0 PortGroup github 1.0 PortGroup muniversal 1.0 github.setup xianyi OpenBLAS 0.2.8 v revision 2 categories math science license BSD maintainers nicos openmaintainer description OpenBLAS is an optimized BLAS library based on GotoBLAS2 long_description ${description} platforms darwin # Prevent precompiled binaries to let compilation optimise the library # for the user processor archive_sites patchfiles patch-libnoarch.diff \ patch-lapacke.h.diff checksums rmd160 5f08d211f20a46c77eda4ff212201e684a2baf14 \ sha256 048986f4e0a8d480c5e6d439915738f3298f2629d6a399a1ddb16e1629b07901 variant gcc45 conflicts gcc46 gcc47 gcc48 gcc49 clang \ description "Use Gcc45 as compiler" { configure.compiler macports-gcc-4.5 } variant gcc46 conflicts gcc45 gcc47 gcc48 gcc49 clang \ description "Use Gcc46 as compiler" { configure.compiler macports-gcc-4.6 } variant gcc47 conflicts gcc45 gcc46 gcc48 gcc49 clang \ description "Use Gcc47 as compiler" { configure.compiler macports-gcc-4.7 } variant gcc48 conflicts gcc45 gcc46 gcc47 gcc49 clang \ description "Use Gcc48 as compiler" { configure.compiler macports-gcc-4.8 } variant gcc49 conflicts gcc45 gcc46 gcc47 gcc48 clang \ description "Use Gcc49 as compiler" { configure.compiler macports-gcc-4.9 } variant clang conflicts gcc45 gcc46 gcc47 gcc48 gcc49 \ description "Use Clang as compiler" { if {[vercmp $xcodeversion 5.0] >= 0} { configure.compiler clang } else { # Xcode's clang < 5.0 does not support avx configure.compiler macports-clang-3.3 } #Also need a compiler for fortran code: forcing to dragonegg to #ensure AVX-capable fortran compiler depends_build-append port:dragonegg-3.3-gcc-4.8 configure.fc ${prefix}/bin/dragonegg-3.3-gfortran-mp-4.8 } if {![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc47] && \ ![variant_isset gcc48] && ![variant_isset gcc49] && ![variant_isset clang]} { if { ![catch {sysctl hw.optional.avx1_0} has_avx] && $has_avx == 1 } { #Use clang if the processor has avx instructions default_variants +clang } else { #Else, use gcc48 as default default_variants +gcc48 } } variant lapack description "Add Lapack/CLapack support to the library" { } use_configure no pre-build { if {[variant_isset universal]} { foreach arch ${universal_archs_to_use} { set makeINC [open ${worksrcpath}-${arch}/Makefile.rule "w"] puts $makeINC "VERSION = ${version}" puts $makeINC "LIBNAMESUFFIX = " puts $makeINC "CC = ${configure.cc}" puts $makeINC "FC = ${configure.fc}" if {${arch} eq "x86_64" || ${arch} eq "ppc64"} { puts $makeINC "BINARY = 64" } else { puts $makeINC "BINARY = 32" } puts $makeINC "COMMON_OPT = -O3 -march=native" puts $makeINC "COMMON_PROF = -pg" if {![variant_isset lapack]} { puts $makeINC "NO_LAPACK = 1" } if {![variant_isset clang]} { puts $makeINC "NO_AVX = 1" } close $makeINC } } else { set makeINC [open ${worksrcpath}/Makefile.rule "w"] #Present version of openblas does not detect Haswell correctly. #Revert to Sandy Bridge if { ![catch {sysctl hw.cpufamily} cputype] && $cputype == 280134364 } { puts $makeINC "TARGET=SANDYBRIDGE" } puts $makeINC "VERSION = ${version}" puts $makeINC "LIBNAMESUFFIX = " puts $makeINC "CC = ${configure.cc}" puts $makeINC "FC = ${configure.fc}" if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} { puts $makeINC "BINARY = 64" } else { puts $makeINC "BINARY = 32" } if {![variant_isset clang]} { puts $makeINC "COMMON_OPT = -O3 -march=native" } else { #Ensure to use the AVX-capable assembler puts $makeINC "COMMON_OPT = -O3 -march=native \ -specs=${prefix}/libexec/dragonegg/llvm33gcc48-integrated-as.specs" } puts $makeINC "COMMON_PROF = -pg" if {![variant_isset lapack]} { puts $makeINC "NO_LAPACK = 1" } if {![variant_isset clang]} { puts $makeINC "NO_AVX = 1" } close $makeINC } } #Using system ones as default is set to bin/gcc-ar which does not exist, #and using gcc-mp ones end up in an error about a missing plugin #(see ticket #38551 for example) build.args "AR=/usr/bin/ar RANLIB=/usr/bin/ranlib" destroot.args "PREFIX=${destroot}${prefix}" post-destroot { #Avoid conflict with Atlas move ${destroot}${prefix}/include/cblas.h \ ${destroot}${prefix}/include/cblas_openblas.h #Correct library name system "install_name_tool -id \ ${prefix}/lib/libopenblas-r${version}.dylib \ ${destroot}${prefix}/lib/libopenblas-r${version}.dylib" }