<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[147610] trunk/dports/science/lal</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/147610">147610</a></dd>
<dt>Author</dt> <dd>ram@macports.org</dd>
<dt>Date</dt> <dd>2016-04-09 14:18:47 -0700 (Sat, 09 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>science/lal: fix build with newer Xcode, fixes #51096</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportssciencelalPortfile">trunk/dports/science/lal/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/dports/science/lal/files/</li>
<li><a href="#trunkdportssciencelalfiles9f725309cc54c73ed03e5bfe2502e89217ee7daediff">trunk/dports/science/lal/files/9f725309cc54c73ed03e5bfe2502e89217ee7dae.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportssciencelalPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/science/lal/Portfile (147609 => 147610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/lal/Portfile        2016-04-09 20:33:34 UTC (rev 147609)
+++ trunk/dports/science/lal/Portfile        2016-04-09 21:18:47 UTC (rev 147610)
</span><span class="lines">@@ -4,6 +4,7 @@
</span><span class="cx"> 
</span><span class="cx"> name          lal
</span><span class="cx"> version       6.15.2
</span><ins>+revision      1
</ins><span class="cx"> categories    science
</span><span class="cx"> platforms     darwin
</span><span class="cx"> maintainers   ram
</span><span class="lines">@@ -20,6 +21,9 @@
</span><span class="cx"> checksums     rmd160 ebe0e18eab2edfdf6b77d8bf4d5b02e1b43d93d3 \
</span><span class="cx">               sha256 769722c047992eba2e5b0bebb182cb9a99584fac91def3009fc9676c4e670700
</span><span class="cx"> 
</span><ins>+patchfiles    9f725309cc54c73ed03e5bfe2502e89217ee7dae.diff
+patch.pre_args -p2
+
</ins><span class="cx"> depends_build-append port:pkgconfig
</span><span class="cx"> 
</span><span class="cx"> depends_lib   port:python27 \
</span></span></pre></div>
<a id="trunkdportssciencelalfiles9f725309cc54c73ed03e5bfe2502e89217ee7daediff"></a>
<div class="addfile"><h4>Added: trunk/dports/science/lal/files/9f725309cc54c73ed03e5bfe2502e89217ee7dae.diff (0 => 147610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/lal/files/9f725309cc54c73ed03e5bfe2502e89217ee7dae.diff                                (rev 0)
+++ trunk/dports/science/lal/files/9f725309cc54c73ed03e5bfe2502e89217ee7dae.diff        2016-04-09 21:18:47 UTC (rev 147610)
</span><span class="lines">@@ -0,0 +1,172 @@
</span><ins>+From 9f725309cc54c73ed03e5bfe2502e89217ee7dae Mon Sep 17 00:00:00 2001
+From: Karl Wette &lt;karl.wette@ligo.org&gt;
+Date: Thu, 24 Mar 2016 01:45:37 +0100
+Subject: VectorMath: rename local replacements for AVX2 intrinsics
+
+- On systems (e.g. Macs, of course) avx2intrin.h is always included
+  by immintrin.h regardless of __AVX2__, i.e. one cannot assume AVX2
+  intrinsics are not defined if __AVX2__ is not defined.
+- Work around by renaming local replacements for AVX2 intrinsics
+  by prefixing with &quot;_mathfun&quot;. When __AVX2__ is defined, these
+  are #defined to the system-supplied AVX2 intrinsics, otherwise
+  they are replaced by local non-AVX2 implementations.
+---
+ lal/src/vectorops/VectorMath_avx_mathfun.h | 49 ++++++++++++++++++------------
+ 1 file changed, 30 insertions(+), 19 deletions(-)
+
+diff --git a/lal/src/vectorops/VectorMath_avx_mathfun.h b/lal/src/vectorops/VectorMath_avx_mathfun.h
+index 0563440..7958ac1 100644
+--- a/lal/src/vectorops/VectorMath_avx_mathfun.h
++++ b/lal/src/vectorops/VectorMath_avx_mathfun.h
+@@ -116,7 +116,18 @@ _PS256_CONST(cephes_log_p8, + 3.3333331174E-1);
+ _PS256_CONST(cephes_log_q1, -2.12194440e-4);
+ _PS256_CONST(cephes_log_q2, 0.693359375);

+-#ifndef __AVX2__
++#ifdef __AVX2__
++
++#define _mathfun_mm256_slli_epi32 _mm256_slli_epi32
++#define _mathfun_mm256_srli_epi32 _mm256_srli_epi32
++
++#define _mathfun_mm256_and_si128 _mm256_and_si128
++#define _mathfun_mm256_andnot_si128 _mm256_andnot_si128
++#define _mathfun_mm256_cmpeq_epi32 _mm256_cmpeq_epi32
++#define _mathfun_mm256_sub_epi32 _mm256_sub_epi32
++#define _mathfun_mm256_add_epi32 _mm256_add_epi32
++
++#else

+ typedef union imm_xmm_union {
+   v8si imm;
+@@ -138,7 +149,7 @@ typedef union imm_xmm_union {


+ #define AVX2_BITOP_USING_SSE2(fn) \
+-static inline v8si _mm256_##fn(v8si x, int a) \
++static inline v8si _mathfun_mm256_##fn(v8si x, int a) \
+ { \
+   /* use SSE2 instruction to perform the bitop AVX2 */ \
+   v4sii x1, x2; \
+@@ -154,7 +165,7 @@ AVX2_BITOP_USING_SSE2(slli_epi32)
+ AVX2_BITOP_USING_SSE2(srli_epi32)

+ #define AVX2_INTOP_USING_SSE2(fn) \
+-static inline v8si _mm256_##fn(v8si x, v8si y) \
++static inline v8si _mathfun_mm256_##fn(v8si x, v8si y) \
+ { \
+   /* use SSE2 instructions to perform the AVX2 integer operation */ \
+   v4sii x1, x2; \
+@@ -190,14 +201,14 @@ v8sf log256_ps(v8sf x) {
+   x = _mm256_max_ps(x, _ps256_min_norm_pos.v);  /* cut off denormalized stuff */

+   // can be done with AVX2
+-  imm0 = _mm256_srli_epi32(_mm256_castps_si256(x), 23);
++  imm0 = _mathfun_mm256_srli_epi32(_mm256_castps_si256(x), 23);

+   /* keep only the fractional part */
+   x = _mm256_and_ps(x, _ps256_inv_mant_mask.v);
+   x = _mm256_or_ps(x, _ps256_0p5.v);

+   // this is again another AVX2 instruction
+-  imm0 = _mm256_sub_epi32(imm0, _pi32_256_0x7f.vi);
++  imm0 = _mathfun_mm256_sub_epi32(imm0, _pi32_256_0x7f.vi);
+   v8sf e = _mm256_cvtepi32_ps(imm0);

+   e = _mm256_add_ps(e, one);
+@@ -315,8 +326,8 @@ v8sf exp256_ps(v8sf x) {
+   /* build 2^n */
+   imm0 = _mm256_cvttps_epi32(fx);
+   // another two AVX2 instructions
+-  imm0 = _mm256_add_epi32(imm0, _pi32_256_0x7f.vi);
+-  imm0 = _mm256_slli_epi32(imm0, 23);
++  imm0 = _mathfun_mm256_add_epi32(imm0, _pi32_256_0x7f.vi);
++  imm0 = _mathfun_mm256_slli_epi32(imm0, 23);
+   v8sf pow2n = _mm256_castsi256_ps(imm0);
+   y = _mm256_mul_ps(y, pow2n);
+   return y;
+@@ -375,13 +386,13 @@ v8sf sin256_ps(v8sf x) { // any x
+   imm2 = _mm256_cvttps_epi32(y);
+   /* j=(j+1) &amp; (~1) (see the cephes sources) */
+   // another two AVX2 instruction
+-  imm2 = _mm256_add_epi32(imm2, _pi32_256_1.vi);
++  imm2 = _mathfun_mm256_add_epi32(imm2, _pi32_256_1.vi);
+   imm2 = _mm256_and_si256(imm2, _pi32_256_inv1.vi);
+   y = _mm256_cvtepi32_ps(imm2);

+   /* get the swap sign flag */
+   imm0 = _mm256_and_si256(imm2, _pi32_256_4.vi);
+-  imm0 = _mm256_slli_epi32(imm0, 29);
++  imm0 = _mathfun_mm256_slli_epi32(imm0, 29);
+   /* get the polynom selection mask
+      there is one polynom for 0 &lt;= x &lt;= Pi/4
+      and another one for Pi/4&lt;x&lt;=Pi/2
+@@ -389,7 +400,7 @@ v8sf sin256_ps(v8sf x) { // any x
+      Both branches will be computed.
+   */
+   imm2 = _mm256_and_si256(imm2, _pi32_256_2.vi);
+-  imm2 = _mm256_cmpeq_epi32(imm2,_pi32_256_0.vi);
++  imm2 = _mathfun_mm256_cmpeq_epi32(imm2,_pi32_256_0.vi);
+ #else
+   /* we use SSE2 routines to perform the integer ops */
+   COPY_IMM_TO_XMM(_mm256_cvttps_epi32(y),imm2_1,imm2_2);
+@@ -492,17 +503,17 @@ v8sf cos256_ps(v8sf x) { // any x
+   /* store the integer part of y in mm0 */
+   imm2 = _mm256_cvttps_epi32(y);
+   /* j=(j+1) &amp; (~1) (see the cephes sources) */
+-  imm2 = _mm256_add_epi32(imm2, _pi32_256_1.vi);
++  imm2 = _mathfun_mm256_add_epi32(imm2, _pi32_256_1.vi);
+   imm2 = _mm256_and_si256(imm2, _pi32_256_inv1.vi);
+   y = _mm256_cvtepi32_ps(imm2);
+-  imm2 = _mm256_sub_epi32(imm2, _pi32_256_2.vi);
++  imm2 = _mathfun_mm256_sub_epi32(imm2, _pi32_256_2.vi);

+   /* get the swap sign flag */
+   imm0 = _mm256_andnot_si256(imm2, _pi32_256_4.vi);
+-  imm0 = _mm256_slli_epi32(imm0, 29);
++  imm0 = _mathfun_mm256_slli_epi32(imm0, 29);
+   /* get the polynom selection mask */
+   imm2 = _mm256_and_si256(imm2, _pi32_256_2.vi);
+-  imm2 = _mm256_cmpeq_epi32(imm2, _pi32_256_0.vi);
++  imm2 = _mathfun_mm256_cmpeq_epi32(imm2, _pi32_256_0.vi);
+ #else

+   /* we use SSE2 routines to perform the integer ops */
+@@ -615,7 +626,7 @@ void sincos256_ps(v8sf x, v8sf *s, v8sf *c) {
+   imm2 = _mm256_cvttps_epi32(y);

+   /* j=(j+1) &amp; (~1) (see the cephes sources) */
+-  imm2 = _mm256_add_epi32(imm2, _pi32_256_1.vi);
++  imm2 = _mathfun_mm256_add_epi32(imm2, _pi32_256_1.vi);
+   imm2 = _mm256_and_si256(imm2, _pi32_256_inv1.vi);

+   y = _mm256_cvtepi32_ps(imm2);
+@@ -623,12 +634,12 @@ void sincos256_ps(v8sf x, v8sf *s, v8sf *c) {

+   /* get the swap sign flag for the sine */
+   imm0 = _mm256_and_si256(imm2, _pi32_256_4.vi);
+-  imm0 = _mm256_slli_epi32(imm0, 29);
++  imm0 = _mathfun_mm256_slli_epi32(imm0, 29);
+   //v8sf swap_sign_bit_sin = _mm256_castsi256_ps(imm0);

+   /* get the polynom selection mask for the sine*/
+   imm2 = _mm256_and_si256(imm2, _pi32_256_2.vi);
+-  imm2 = _mm256_cmpeq_epi32(imm2, _pi32_256_0.vi);
++  imm2 = _mathfun_mm256_cmpeq_epi32(imm2, _pi32_256_0.vi);
+   //v8sf poly_mask = _mm256_castsi256_ps(imm2);
+ #else
+   /* we use SSE2 routines to perform the integer ops */
+@@ -678,9 +689,9 @@ void sincos256_ps(v8sf x, v8sf *s, v8sf *c) {
+   x = _mm256_add_ps(x, xmm3);

+ #ifdef __AVX2__
+-  imm4 = _mm256_sub_epi32(imm4, _pi32_256_2.vi);
++  imm4 = _mathfun_mm256_sub_epi32(imm4, _pi32_256_2.vi);
+   imm4 = _mm256_andnot_si256(imm4, _pi32_256_4.vi);
+-  imm4 = _mm256_slli_epi32(imm4, 29);
++  imm4 = _mathfun_mm256_slli_epi32(imm4, 29);
+ #else
+   imm4_1 = _mm_sub_epi32(imm4_1, _pi32avx_2.v4i);
+   imm4_2 = _mm_sub_epi32(imm4_2, _pi32avx_2.v4i);
+-- 
+cgit v0.11.2
+
</ins></span></pre>
</div>
</div>

</body>
</html>