[117635] trunk/dports/math
nicos at macports.org
nicos at macports.org
Thu Mar 6 04:28:50 PST 2014
Revision: 117635
https://trac.macports.org/changeset/117635
Author: nicos at macports.org
Date: 2014-03-06 04:28:50 -0800 (Thu, 06 Mar 2014)
Log Message:
-----------
OpenBLAS-devel: new port
Added Paths:
-----------
trunk/dports/math/OpenBLAS-devel/
trunk/dports/math/OpenBLAS-devel/Portfile
trunk/dports/math/OpenBLAS-devel/files/
trunk/dports/math/OpenBLAS-devel/files/patch-libnoarch.diff
trunk/dports/math/OpenBLAS-devel/files/patch-linkLib.diff
Added: trunk/dports/math/OpenBLAS-devel/Portfile
===================================================================
--- trunk/dports/math/OpenBLAS-devel/Portfile (rev 0)
+++ trunk/dports/math/OpenBLAS-devel/Portfile 2014-03-06 12:28:50 UTC (rev 117635)
@@ -0,0 +1,172 @@
+# -*- 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 1140c489c902
+
+name ${github.project}-devel
+conflicts OpenBLAS
+categories math science
+license BSD
+maintainers nicos openmaintainer
+description OpenBLAS is an optimized BLAS library based on GotoBLAS2
+long_description ${description}
+platforms darwin
+
+fetch.type git
+livecheck.url ${github.homepage}/commits/develop.atom
+
+# Prevent precompiled binaries to let compilation optimise the library
+# for the user processor
+archive_sites
+
+patchfiles patch-libnoarch.diff \
+ patch-linkLib.diff
+
+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"
+ }
+ 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
+ }
+ } else {
+ set makeINC [open ${worksrcpath}/Makefile.rule "w"]
+ 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=${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"
+ if {[variant_isset lapack]} {
+ #Install lapacke headers too
+ xinstall -m 755 ${worksrcpath}/lapack-netlib/lapacke/include/lapacke_config.h \
+ ${destroot}/${prefix}/include/lapacke_config.h
+ xinstall -m 755 ${worksrcpath}/lapack-netlib/lapacke/include/lapacke_mangling.h \
+ ${destroot}/${prefix}/include/lapacke_mangling.h
+ xinstall -m 755 ${worksrcpath}/lapack-netlib/lapacke/include/lapacke_utils.h \
+ ${destroot}/${prefix}/include/lapacke_utils.h
+ xinstall -m 755 ${worksrcpath}/lapack-netlib/lapacke/include/lapacke.h \
+ ${destroot}/${prefix}/include/lapacke.h
+ }
+}
Property changes on: trunk/dports/math/OpenBLAS-devel/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/dports/math/OpenBLAS-devel/files/patch-libnoarch.diff
===================================================================
--- trunk/dports/math/OpenBLAS-devel/files/patch-libnoarch.diff (rev 0)
+++ trunk/dports/math/OpenBLAS-devel/files/patch-libnoarch.diff 2014-03-06 12:28:50 UTC (rev 117635)
@@ -0,0 +1,18 @@
+--- Makefile.system.orig 2013-09-22 15:27:35.000000000 +0900
++++ Makefile.system 2013-09-22 15:42:51.000000000 +0900
+@@ -860,11 +860,11 @@
+
+ ifneq ($(DYNAMIC_ARCH), 1)
+ ifndef SMP
+-LIBNAME = $(LIBPREFIX)_$(LIBCORE)$(REVISION).$(LIBSUFFIX)
+-LIBNAME_P = $(LIBPREFIX)_$(LIBCORE)$(REVISION)_p.$(LIBSUFFIX)
++LIBNAME = $(LIBPREFIX)$(REVISION).$(LIBSUFFIX)
++LIBNAME_P = $(LIBPREFIX)$(REVISION)_p.$(LIBSUFFIX)
+ else
+-LIBNAME = $(LIBPREFIX)_$(LIBCORE)p$(REVISION).$(LIBSUFFIX)
+-LIBNAME_P = $(LIBPREFIX)_$(LIBCORE)p$(REVISION)_p.$(LIBSUFFIX)
++LIBNAME = $(LIBPREFIX)$(REVISION).$(LIBSUFFIX)
++LIBNAME_P = $(LIBPREFIX)$(REVISION)_p.$(LIBSUFFIX)
+ endif
+ else
+ ifndef SMP
Added: trunk/dports/math/OpenBLAS-devel/files/patch-linkLib.diff
===================================================================
--- trunk/dports/math/OpenBLAS-devel/files/patch-linkLib.diff (rev 0)
+++ trunk/dports/math/OpenBLAS-devel/files/patch-linkLib.diff 2014-03-06 12:28:50 UTC (rev 117635)
@@ -0,0 +1,11 @@
+--- Makefile.install.orig 2013-12-16 21:31:17.000000000 +0900
++++ Makefile.install 2013-12-19 22:08:57.000000000 +0900
+@@ -75,7 +75,7 @@
+ ifeq ($(OSNAME), Darwin)
+ @-cp $(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
+ @-install_name_tool -id $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME)
+- @-ln -fs $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).dylib
++ @-ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).dylib
+ endif
+ ifeq ($(OSNAME), WINNT)
+ @-cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140306/f238881c/attachment.html>
More information about the macports-changes
mailing list