Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Mar 2012 02:21:46 +0900
From:      KATO Tsuguru <tkato432@yahoo.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/166042: Update port: math/fftw
Message-ID:  <20120314022146.651d38a6.tkato432@yahoo.com>
Resent-Message-ID: <201203131810.q2DIAABq054855@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         166042
>Category:       ports
>Synopsis:       Update port: math/fftw
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 13 18:10:09 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     KATO Tsuguru
>Release:        FreeBSD 7.4-RELEASE-p5 i386
>Organization:
>Environment:
>Description:
- Fix build on i386
- Add LICENSE
- Add MAKE_JOBS_SAFE

New file:
files/patch-configure.in
files/patch-tests__test_main.c

Remove file:
files/patch-configure

>How-To-Repeat:
>Fix:

diff -urN /usr/ports/math/fftw/Makefile math/fftw/Makefile
--- /usr/ports/math/fftw/Makefile	2011-08-11 01:39:45.000000000 +0900
+++ math/fftw/Makefile	2012-03-12 23:09:33.000000000 +0900
@@ -18,17 +18,20 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT?=	Fast C routines to compute the Discrete Fourier Transform
 
+LICENSE=	GPLv2
+
 # current flavors: default, float
 FFTW_FLAVOR?=	default
 FFTW_SUFIX=
 
-USE_AUTOTOOLS=	libtool
 USE_FORTRAN=	yes
 USE_GMAKE=	yes
-GNU_CONFIGURE=	yes
+USE_AUTOTOOLS=	autoconf:env libtool
 CONFIGURE_ENV=	MAKEINFO="makeinfo --no-split"
 CONFIGURE_ARGS=	--enable-shared
 USE_LDCONFIG=	yes
+MAKE_JOBS_SAFE=	yes
+
 PLIST_SUB=	FFTW_SUFX="${FFTW_SUFX}"
 
 .include <bsd.port.pre.mk>
@@ -47,7 +50,7 @@
 CONFIGURE_ARGS+=	--enable-i386-hacks
 .endif
 
-.if ${ARCH} == "i386" || ${ARCH} == "sparc64"
+.if ${ARCH} == "sparc64"
 BROKEN=		does not build
 .endif
 
@@ -57,6 +60,9 @@
 	@${REINPLACE_CMD} -e '/^SUBDIRS/s|doc||' ${WRKSRC}/Makefile.in
 .endif
 
+pre-configure:
+	@(cd ${WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTORECONF})
+
 post-install:
 .if ${FFTW_FLAVOR}=="default"
 .if !defined(NOPORTDOCS)
diff -urN /usr/ports/math/fftw/files/patch-configure math/fftw/files/patch-configure
--- /usr/ports/math/fftw/files/patch-configure	2003-07-28 00:30:23.000000000 +0900
+++ math/fftw/files/patch-configure	1970-01-01 09:00:00.000000000 +0900
@@ -1,10 +0,0 @@
---- configure.orig	Mon Mar 24 16:09:56 2003
-+++ configure	Fri Jul 25 10:52:07 2003
-@@ -8217,6 +8217,7 @@
- 
- # This can be used to rebuild libtool when needed
- LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-+$ac_aux_dir/ltconfig $LIBTOOL_DEPS
- 
- # Always use our own libtool.
- LIBTOOL='$(SHELL) $(top_builddir)/libtool'
diff -urN /usr/ports/math/fftw/files/patch-configure.in math/fftw/files/patch-configure.in
--- /usr/ports/math/fftw/files/patch-configure.in	1970-01-01 09:00:00.000000000 +0900
+++ math/fftw/files/patch-configure.in	2012-03-12 23:46:44.000000000 +0900
@@ -0,0 +1,175 @@
+--- configure.in.orig	2003-03-24 16:01:13.000000000 +0900
++++ configure.in	2012-03-12 23:00:58.000000000 +0900
+@@ -23,11 +23,13 @@
+ AC_ARG_WITH(gcc, [  --with-gcc              use gcc instead of the native compiler cc], ok=$withval, ok=no)
+ if test "$ok" = "yes"; then
+ 	CC=gcc
++else
++	CC=$withval
+ fi
+ 
+ AC_ARG_ENABLE(float, [  --enable-float          compile fftw for single precision], enable_float=$enableval, enable_float=no)
+ if test "$enable_float" = "yes"; then
+-	AC_DEFINE(FFTW_ENABLE_FLOAT)
++	AC_DEFINE([FFTW_ENABLE_FLOAT],[],[desc])
+ fi
+ 
+ FFTW_PREFIX=""
+@@ -56,27 +58,27 @@
+ 
+ AC_ARG_ENABLE(i386-hacks, [  --enable-i386-hacks     enable gcc/x86 specific performance hacks], ok=$enableval, ok=no)
+ if test "$ok" = "yes"; then
+-	AC_DEFINE(FFTW_ENABLE_I386_HACKS)
++	AC_DEFINE([FFTW_ENABLE_I386_HACKS],[],[desc])
+ fi
+ 
+ AC_ARG_ENABLE(pentium-timer, [  --enable-pentium-timer  enable high resolution Pentium timer], ok=$enableval, ok=no)
+ if test "$ok" = "yes"; then
+-	AC_DEFINE(FFTW_ENABLE_PENTIUM_TIMER)
++	AC_DEFINE([FFTW_ENABLE_PENTIUM_TIMER],[],[desc])
+ fi
+ 
+ AC_ARG_ENABLE(debug, [  --enable-debug          compile fftw with extra runtime checks for debugging], ok=$enableval, ok=no)
+ if test "$ok" = "yes"; then
+-	AC_DEFINE(FFTW_DEBUG)
++	AC_DEFINE([FFTW_DEBUG],[],[desc])
+ fi
+ 
+ AC_ARG_ENABLE(debug-alignment, [  --enable-debug-alignment          enable runtime checks for alignment on x86], ok=$enableval, ok=no)
+ if test "$ok" = "yes"; then
+-	AC_DEFINE(FFTW_DEBUG_ALIGNMENT)
++	AC_DEFINE([FFTW_DEBUG_ALIGNMENT],[],[desc])
+ fi
+ 
+ AC_ARG_ENABLE(vec-recurse, [  --enable-vec-recurse    enable experimental performance hack], ok=$enableval, ok=no)
+ if test "$ok" = "yes"; then
+-	AC_DEFINE(FFTW_ENABLE_VECTOR_RECURSE)
++	AC_DEFINE([FFTW_ENABLE_VECTOR_RECURSE],[],[desc])
+ fi
+ 
+ dnl -----------------------------------------------------------------------
+@@ -95,6 +97,7 @@
+ AM_PROG_LIBTOOL
+ AC_CHECK_PROG(PERL, perl, perl, echo perl)
+ AC_SUBST(PERL)
++AC_SUBST(CC)
+ 
+ dnl -----------------------------------------------------------------------
+ 
+@@ -115,7 +118,7 @@
+ dnl -----------------------------------------------------------------------
+ 
+ AC_SUBST(SHARED_VERSION_INFO)
+-AC_DEFINE_UNQUOTED(FFTW_VERSION, "$VERSION")
++AC_DEFINE_UNQUOTED([FFTW_VERSION], "$VERSION",[Version])
+ 
+ # Get the version number that will be appended to shared libraries:
+ SHARED_VERSION=`echo $SHARED_VERSION_INFO | awk -F':' '{ print $1 "." $3 "." $2 }'`
+@@ -123,7 +126,7 @@
+ 
+ ACX_PROG_CC_MAXOPT
+ 
+-ACX_GCC_ALIGNS_STACK(AC_DEFINE(FFTW_GCC_ALIGNS_STACK), [
++ACX_GCC_ALIGNS_STACK(AC_DEFINE([FFTW_GCC_ALIGNS_STACK],[],[desc]), [
+ 	if test "$enable_i386_hacks" = yes; then
+ 	if test "${acx_gcc_stack_align_bug-no}" = yes; then
+ 		# we are using a gcc with a stack alignment bug, and we should
+@@ -183,7 +186,7 @@
+ AC_TRY_LINK([#include <math.h>
+ ], if (!isnan(3.14159)) isnan(2.7183);, ok=yes, ok=no)
+ if test "$ok" = "yes"; then
+-	AC_DEFINE(HAVE_ISNAN)
++	AC_DEFINE([HAVE_ISNAN],[],[desc])
+ fi
+ AC_MSG_RESULT(${ok})
+ 
+@@ -196,7 +199,7 @@
+ #endif
+ ], [hrtime_t foobar;], ok=yes, ok=no)
+ if test "$ok" = "yes"; then
+-	AC_DEFINE(HAVE_HRTIME_T)
++	AC_DEFINE([HAVE_HRTIME_T],[],[desc])
+ fi
+ AC_MSG_RESULT(${ok})
+ 
+@@ -205,7 +208,7 @@
+ 
+ AC_ARG_ENABLE(unsafe-mulmod, [  --enable-unsafe-mulmod  risk overflow for large prime sizes], enable_unsafe_mulmod=$enableval, enable_unsafe_mulmod=no)
+ if test "$enable_unsafe_mulmod" = "yes"; then
+-        AC_DEFINE(FFTW_ENABLE_UNSAFE_MULMOD)
++        AC_DEFINE([FFTW_ENABLE_UNSAFE_MULMOD],[],[desc])
+ fi
+ 
+ 
+@@ -243,7 +246,7 @@
+ 		if test -z "$THREADLIBS"; then
+ 			AC_MSG_ERROR([don't know how to enable OpenMP])
+ 		fi
+-		AC_DEFINE(FFTW_USING_OPENMP_THREADS)
++		AC_DEFINE([FFTW_USING_OPENMP_THREADS],[],[desc])
+ 	fi
+ 	if test "$with_sgimp"x != nox; then
+ 		AC_MSG_CHECKING(how to enable SGI MP)
+@@ -261,7 +264,7 @@
+ 		if test -z "$THREADLIBS"; then 
+ 			AC_MSG_ERROR([don't know how to enable SGI MP])
+ 		fi
+-		AC_DEFINE(FFTW_USING_SGIMP_THREADS)
++		AC_DEFINE([FFTW_USING_SGIMP_THREADS],[],[desc])
+ 	fi
+ 
+ 	# POSIX threads, the default choice:
+@@ -270,38 +273,38 @@
+ 		ACX_PTHREAD([THREADLIBS="$PTHREAD_LIBS "
+ 	                     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ 	                     CC="$PTHREAD_CC"
+-	                     AC_DEFINE(FFTW_USING_POSIX_THREADS)])
++	                     AC_DEFINE([FFTW_USING_POSIX_THREADS],[],[desc])])
+ 	fi
+ 	# Solaris threads:
+ 	if test -z "$THREADLIBS"; then
+ 		AC_CHECK_LIB(thread, thr_create,
+ 		             [THREADLIBS="-lthread"
+-                	      AC_DEFINE(FFTW_USING_SOLARIS_THREADS)])
++                	      AC_DEFINE([FFTW_USING_SOLARIS_THREADS],[],[desc])])
+ 	fi
+ 	# Mach C threads:
+ 	if test -z "$THREADLIBS"; then
+ 		AC_CHECK_FUNC(cthread_fork,
+ 		             [THREADLIBS=" "
+-                	      AC_DEFINE(FFTW_USING_MACH_THREADS)])
++                	      AC_DEFINE([FFTW_USING_MACH_THREADS],[],[desc])])
+ 		AC_CHECK_HEADERS(mach/cthreads.h cthreads.h cthread.h)
+ 	fi
+ 	if test -z "$THREADLIBS"; then
+ 		AC_CHECK_LIB(cthread, cthread_fork,
+ 		             [THREADLIBS="-lcthread"
+-                	      AC_DEFINE(FFTW_USING_MACH_THREADS)])
++                	      AC_DEFINE([FFTW_USING_MACH_THREADS],[],[desc])])
+ 		AC_CHECK_HEADERS(mach/cthreads.h cthreads.h cthread.h)
+ 	fi
+ 	if test -z "$THREADLIBS"; then
+ 		AC_CHECK_LIB(cthreads, cthread_fork,
+ 		             [THREADLIBS="-lcthreads"
+-                	      AC_DEFINE(FFTW_USING_MACH_THREADS)])
++                	      AC_DEFINE([FFTW_USING_MACH_THREADS],[],[desc])])
+ 		AC_CHECK_HEADERS(mach/cthreads.h cthreads.h cthread.h)
+ 	fi
+ 	# BeOS threads:
+ 	if test -z "$THREADLIBS"; then
+ 		AC_CHECK_FUNC(spawn_thread,
+ 		             [THREADLIBS=" "
+-                	      AC_DEFINE(FFTW_USING_BEOS_THREADS)])
++                	      AC_DEFINE([FFTW_USING_BEOS_THREADS],[],[desc])])
+ 	fi
+ 	if test -z "$THREADLIBS"; then
+ 		AC_MSG_ERROR(couldn't find threads library for --enable-threads)
+@@ -334,7 +337,7 @@
+ 	CC="$MPICC"
+ 	ok=yes
+ 	AC_TRY_LINK([#include <mpi.h>
+-	], [MPI_Comm_f2c(0);], [AC_DEFINE(HAVE_MPI_COMM_F2C)], [ok=no])
++	], [MPI_Comm_f2c(0);], [AC_DEFINE([HAVE_MPI_COMM_F2C],[],[desc])], [ok=no])
+ 	AC_MSG_RESULT($ok)
+ 	CC="$save_CC"
+ else
diff -urN /usr/ports/math/fftw/files/patch-tests__test_main.c math/fftw/files/patch-tests__test_main.c
--- /usr/ports/math/fftw/files/patch-tests__test_main.c	1970-01-01 09:00:00.000000000 +0900
+++ math/fftw/files/patch-tests__test_main.c	2012-03-12 22:48:17.000000000 +0900
@@ -0,0 +1,21 @@
+--- tests/test_main.c.orig	2003-03-17 08:43:46.000000000 +0900
++++ tests/test_main.c	2012-03-12 22:47:45.000000000 +0900
+@@ -548,7 +548,7 @@
+ void test_timer(void)
+ {
+      double times[32], acc, min_time = 10000.00;
+-     unsigned long iters, iter;
++     unsigned long iters = 0, iter;
+      fftw_time begin, end, start;
+      double t, tmax, tmin;
+      int last = 0, i, repeat;
+@@ -559,7 +559,8 @@
+      start = fftw_get_time();
+ 
+      for (i = 0; i < 32; i++) {
+-	  iters = 1 << i;
++	  //iters = 1 << i; /* workaround gcc-4.1 bug */
++	  if (i) iters <<= 1; else iters = 1;
+ 	  tmin = 1.0E10;
+ 	  tmax = -1.0E10;
+ 
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120314022146.651d38a6.tkato432>