[132224] trunk/dports/math/octave

michaelld at macports.org michaelld at macports.org
Mon Jan 26 13:44:13 PST 2015


Revision: 132224
          https://trac.macports.org/changeset/132224
Author:   michaelld at macports.org
Date:     2015-01-26 13:44:13 -0800 (Mon, 26 Jan 2015)
Log Message:
-----------
octave:  when neither +accelerate nor +atlas is selected, default to the correct one for the selected Fortran compiler.

Modified Paths:
--------------
    trunk/dports/math/octave/Portfile

Added Paths:
-----------
    trunk/dports/math/octave/files/patch-clang-libcxx.diff

Modified: trunk/dports/math/octave/Portfile
===================================================================
--- trunk/dports/math/octave/Portfile	2015-01-26 21:32:09 UTC (rev 132223)
+++ trunk/dports/math/octave/Portfile	2015-01-26 21:44:13 UTC (rev 132224)
@@ -143,7 +143,15 @@
     conflicts atlas {}
 
 if {![variant_isset accelerate] && ![variant_isset atlas]} {
-    default_variants +atlas
+
+    # when neither +accelerate nor +atlas is selected, default to the
+    # correct one for the selected Fortran compiler.
+    if {![variant_isset g95]} {
+        default_variants +atlas
+    } else {
+        default_variants +accelerate
+    }
+
 }
 
 # make sure that either +accelerate or +atlas is selected

Added: trunk/dports/math/octave/files/patch-clang-libcxx.diff
===================================================================
--- trunk/dports/math/octave/files/patch-clang-libcxx.diff	                        (rev 0)
+++ trunk/dports/math/octave/files/patch-clang-libcxx.diff	2015-01-26 21:44:13 UTC (rev 132224)
@@ -0,0 +1,105 @@
+# HG changeset patch
+# User Kefu Chai <tchaikov at gmail.com>
+# Date 1413043255 -28800
+#      Sun Oct 12 00:00:55 2014 +0800
+# Node ID 1433cd4f7b7bda0b0e0a04f990b55ffc3cbaf701
+# Parent  91a6f06c505220d269de3a0dab8cc898d03d91a0
+fix the build error on clang 3.5 and libc++ (bug #43298)
+
+* liboctave/operators/mx-inlines.cc:
+use the workaround if libc++ with this issue is detected.
+
+* liboctave/operators/libcxx-fix.cc:
+add a workaround for http://llvm.org/bugs/show_bug.cgi?id=21083, so that only
+the arithmetic types are accepted for the function template "libcxx_fix::pow()".
+
+diff -r 91a6f06c5052 -r 1433cd4f7b7b liboctave/operators/libcxx-fix.h
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ liboctave/operators/libcxx-fix.h	Sun Oct 12 00:00:55 2014 +0800
+@@ -0,0 +1,69 @@
++#ifndef _LIBCPP_VERSION
++#error "for libc++ only"
++#endif
++
++namespace libcxx_fix {
++
++using std::is_integral;
++using std::is_same;
++using std::enable_if;
++
++template <class _Tp, class _Tn = void>
++struct numeric_type
++{
++    typedef void type;
++    static const bool value = false;
++};
++
++template <class _Tp>
++struct numeric_type<_Tp, typename enable_if<is_integral<_Tp>::value ||
++                                            is_same<_Tp, double>::value>::type>
++{
++    typedef double type;
++    static const bool value = true;
++};
++
++template <class _Tp>
++struct numeric_type<_Tp, typename enable_if<is_same<_Tp, long double>::value ||
++                                            is_same<_Tp, float>::value>::type>
++{
++    typedef _Tp type;
++    static const bool value = true;
++};
++
++template <>
++struct numeric_type<void, void>
++{
++    static const bool value = true;
++};
++
++template <class _A1, class _A2,
++          bool = numeric_type<_A1>::value &&
++                 numeric_type<_A2>::value>
++class promote
++{};
++
++template <class _A1, class _A2>
++class promote<_A1, _A2, true>
++{
++private:
++    typedef typename numeric_type<_A1>::type __type1;
++    typedef typename numeric_type<_A2>::type __type2;
++public:
++    typedef decltype(__type1() + __type2()) type;
++};
++
++template <class _A1, class _A2>
++inline _LIBCPP_INLINE_VISIBILITY
++typename promote<_A1, _A2>::type
++pow(_A1 __x, _A2 __y) _NOEXCEPT
++{
++    typedef typename promote<_A1, _A2>::type __result_type;
++#if _LIBCPP_STD_VER > 11
++    static_assert((!(is_same<_A1, __result_type>::value &&
++                     is_same<_A2, __result_type>::value)), "");
++#endif
++    return ::pow(static_cast<__result_type>(__x), static_cast<__result_type>(__y));
++}
++
++}
+diff -r 91a6f06c5052 -r 1433cd4f7b7b liboctave/operators/mx-inlines.cc
+--- liboctave/operators/mx-inlines.cc	Thu Oct 09 20:38:04 2014 -0700
++++ liboctave/operators/mx-inlines.cc	Sun Oct 12 00:00:55 2014 +0800
+@@ -306,7 +306,13 @@
+ 
+ // Let the compiler decide which pow to use, whichever best matches the
+ // arguments provided.
++#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 1101)
++// Workaround http://llvm.org/bugs/show_bug.cgi?id=21083
++#include "libcxx-fix.h"
++using libcxx_fix::pow;
++#else
+ using std::pow;
++#endif
+ DEFMXMAPPER2X (mx_inline_pow, pow)
+ 
+ // Arbitrary function appliers. The function is a template parameter to enable
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150126/75470dbc/attachment.html>


More information about the macports-changes mailing list