Opened 8 years ago

Closed 8 years ago

#51953 closed update (fixed)

fftw-3: update to 3.3.5

Reported by: seanfarley (Sean Farley) Owned by: seanfarley (Sean Farley)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: dstrubbe (David Strubbe), eborisch (Eric A. Borisch)
Port: fftw-3

Description

Currently, this is blocked by the pfft variant. David, could you take a look?

Change History (10)

comment:1 Changed 8 years ago by dstrubbe (David Strubbe)

Do you mean that the patch doesn't apply properly to the new version?

comment:2 Changed 8 years ago by mf2k (Frank Schima)

Port: fftw-3 added
Type: defectupdate
Version: 2.3.4

comment:3 Changed 8 years ago by seanfarley (Sean Farley)

Yep, that's what I found. Has pfft released an updated patch?

comment:4 Changed 8 years ago by dstrubbe (David Strubbe)

No, they haven't. https://www-user.tu-chemnitz.de/~potts/workgroup/pippig/software.php.en#scripts. It might be that the patches have already been incorporated into this version though, since it says "Within these scripts we apply the following patches that have been submitted to FFTW but are not yet included in FFTW-3.3.4". I tried to see what happens with applying the patches but there are some other patches that do not apply properly. Can you post the modifications you were making to the Portfile for the new version?

comment:5 Changed 8 years ago by seanfarley (Sean Farley)

Sure,

diff --git a/dports/math/fftw-3/Portfile b/dports/math/fftw-3/Portfile
--- a/dports/math/fftw-3/Portfile
+++ b/dports/math/fftw-3/Portfile
@@ -7,8 +7,7 @@
 PortGroup       mpi 1.0

 name            fftw-3
-version         3.3.4
-revision        1
+version         3.3.5
 categories      math
 license         GPL-2+
 platforms       darwin
@@ -40,15 +39,13 @@
     improvements relative to 2.x, but is not backwardly \
     compatible.

-checksums \
-    rmd160  463b5120d42ec2a3bc1385689176c5e0296d0d4a \
-    sha256  8f0cde90929bc05587c3368d2f15cd0530a60b8a9912a8e2979a72dbe5af0982
+checksums           rmd160  d5800f3d56b7b499265633b52a0b9850b17c148e \
+                    sha256  8ecfe1b04732ec3f5b7d279fdb8efcad536d555f9d1e8fabd027037d45ea8bcf

 # Don't link with "-flat_namespace -undefined suppress" on Yosemite and
 # later (#45707).
 patchfiles \
-    yosemite-libtool.patch \
-    leopard-no-memalign.patch
+    yosemite-libtool.patch

 variant pfft_patches description {Apply patches recommended for use as dependency of pfft port} {
     if {![mpi_variant_isset]} {
diff --git a/dports/math/fftw-3/files/leopard-no-memalign.patch b/dports/math/fftw-3/files/leopard-no-memalign.patch
deleted file mode 100644
--- a/dports/math/fftw-3/files/leopard-no-memalign.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- kernel/ifftw.h.orig	2015-01-08 16:12:31.000000000 -0800
-+++ kernel/ifftw.h	2015-01-08 16:14:18.000000000 -0800
-@@ -120,7 +120,7 @@ typedef struct scanner_s scanner;
- /*-----------------------------------------------------------------------*/
- /* alloca: */
- #if HAVE_SIMD
--#  ifdef HAVE_AVX
-+#  if defined(HAVE_AVX) && defined(HAVE_POSIX_MEMALIGN)
- #    define MIN_ALIGNMENT 32  /* best alignment for AVX, conservative for
- 			       * everything else */
- #  else

Mostly, just updated the checksums and removed the unneeded leopard-no-memalign.patch.

comment:6 Changed 8 years ago by dstrubbe (David Strubbe)

To update to 3.3.5 with the pfft patches, just add this to the changes above:

Index: Portfile
===================================================================
--- Portfile    (revision 151414)
+++ Portfile    (working copy)
@@ -56,6 +54,7 @@
     }
 
     # Cut from scripts at https://www-user.tu-chemnitz.de/~potts/workgroup/pippig/software.php.en#fftwinstall,
+    # except that the last hunk of mpi/transpose-pairwise.c has been incorporated into 3.3.5 already.
     #Important: Within these scripts we apply the following patches that have been submitted to FFTW but are not yet included in FFTW-3.3.4:
     #  We add two more global transposition algorithms to the planner.
     #  We patch file mpi/transpose-pairwise.c in order to fix a double free bug.
Index: files/patch-pfft.diff
===================================================================
--- files/patch-pfft.diff       (revision 151414)
+++ files/patch-pfft.diff       (working copy)
@@ -342,13 +342,6 @@
               }
          }
       }
-@@ -350,6 +349,7 @@ nada:
-      X(plan_destroy_internal)(*cld3);
-      X(plan_destroy_internal)(*cld2rest);
-      X(plan_destroy_internal)(*cld2);
-+     *cld2 = *cld2rest = *cld3 = NULL;
-      return 0;
- }
  
 --- mpi/transpose-pairwise-transposed.c        1970-01-01 01:00:00.000000000 +0100
 +++ mpi/transpose-pairwise-transposed.c        2015-09-05 06:00:07.280481042 +0200

comment:7 Changed 8 years ago by eborisch (Eric A. Borisch)

If you want to "fix it while you're in there," the current Portfile doesn't pass the --enable-(sse|avx|avx2) (3.3.5 adds avx2) flags to fftw3's x86 configure.args when not +universal; it appears to be handled correctly in the fftw3-single sub-port.

I was thinking something like this:

if {${name} == ${subport}} {
    platform i386 {
        if {![variant_isset universal]} {
            configure.args-append       --enable-sse2
            if { [avx_compiler_isset] == 1 } {
                configure.args-append   --enable-avx --enable-avx2
            }
        }
    }
}

Or I can open a separate ticket.

comment:8 Changed 8 years ago by eborisch (Eric A. Borisch)

Cc: eborisch@… added

Cc Me!

comment:9 Changed 8 years ago by seanfarley (Sean Farley)

Thanks for the patches! I'll try to look at this later today / tomorrow.

comment:10 Changed 8 years ago by seanfarley (Sean Farley)

Resolution: fixed
Status: newclosed

Should be fixed in r152196.

Note: See TracTickets for help on using tickets.