[nfft] 01/06: New upstream version 3.3.2~rc3

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Oct 12 13:27:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag debian/3.3.2_rc3-1
in repository nfft.

commit 3ca1a0e0e8a3a180492a39fabf8aed486bff3442
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Tue Oct 11 08:09:47 2016 +0100

    New upstream version 3.3.2~rc3
---
 ChangeLog                      |  12 ++-
 applications/fastsum/fastsum.m |  17 ++++-
 configure.ac                   |   7 +-
 m4/ax_prog_matlab.m4           | 170 ++++++++++++++++++++++++++++++++++++++++-
 matlab/imex.h                  |   2 +
 tests/Makefile.am              |   2 +-
 tests/check.c                  |   2 +
 tests/version.c                |  40 ++++++++++
 tests/version.h                |  21 +++++
 9 files changed, 263 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 964df30..edaf744 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 This file contains the version history for NFFT 3.x.x. 
 
+Changes in version 3.3.2:
+
+    Bugfixes
+    - #20 `make check` crashes on windows.
+    - #24 Testsuite failures on selected architectures with 3.3.1.
+    
+    Enhancements
+    - #25 Add support for GNU Octave via MEX interface.
+    - #27 Enable query of versioning information.
+
 Changes in version 3.3.1:
 
     Bugfixes
@@ -11,7 +21,7 @@ Changes in version 3.3.1:
     - #17 MATLAB r2015b/r2016a don't ship symlink libmfftw3.so to libmfftw3.so.3.
     - #18 Define format string for ptrdiff_t in platform-dependent macro.
 
-    Improvements
+    Enhancements
     - #3 Allow to select scope of unit tests via configure.
     - #1 Extend Travis CI configuration.
 
diff --git a/applications/fastsum/fastsum.m b/applications/fastsum/fastsum.m
index a18c992..a531853 100644
--- a/applications/fastsum/fastsum.m
+++ b/applications/fastsum/fastsum.m
@@ -27,11 +27,26 @@ function [f,f_direct]=fastsum(x,alpha,y,kernel,c,m,n,p,eps_I,eps_B)
 %   size(x) = [N,d]
 %   size(alpha) = [N,1] (complex)
 %   size(y)=[M,d]
-%   kernel = 'multiquadric', e.g.
+%   kernel = 'multiquadric', etc. (see options below)
 %   c kernel parameter
 %   m cut-off parameter for NFFT
 %   n expansion degree
 %   p smoothness
+% 
+%   Kernel functions:
+%   'gaussian'                K(x) = EXP(-x^2/c^2) 
+%   'multiquadric'            K(x) = SQRT(x^2+c^2)
+%   'inverse_multiquadric'    K(x) = 1/SQRT(x^2+c^2)
+%   'logarithm'               K(x) = LOG |x|
+%   'thinplate_spline'        K(x) = x^2 LOG |x|
+%   'one_over_square'         K(x) = 1/x^2
+%   'one_over_modulus'        K(x) = 1/|x|
+%   'one_over_x'              K(x) = 1/x
+%   'inverse_multiquadric3'   K(x) = 1/SQRT(x^2+c^2)^3
+%   'sinc_kernel'             K(x) = SIN(cx)/x
+%   'cosc'                    K(x) = COS(cx)/x
+%   'kcot'                    K(x) = cot(cx)
+%   'one_over_cube'           K(x) = 1/x^3
 %
 % Markus Fenn, 2006.
 
diff --git a/configure.ac b/configure.ac
index fe979f3..7ac848f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@
 
 m4_define([nfft_version_major], [3])
 m4_define([nfft_version_minor], [3])
-m4_define([nfft_version_patch], [1])
+m4_define([nfft_version_patch], [2])
 m4_define([nfft_version_type], [alpha])
 m4_append([NFFT_VERSION], m4_expand([nfft_version_major.nfft_version_minor.nfft_version_patch]))
 m4_append([NFFT_VERSION], m4_expand([nfft_version_type]))
@@ -331,11 +331,6 @@ if test "x$matlab_threads" = "xyes" -a "x$enable_threads" != "xyes"; then
   AC_MSG_ERROR([The NFFT Matlab interface with thread support requires the threaded NFFT to be built. Please re-run configure with \"--enable-openmp\".])
 fi
 
-AM_CONDITIONAL(HAVE_MATLAB, test "x$ax_prog_matlab" = "xyes" )
-AC_SUBST(matlab_CPPFLAGS)
-AC_SUBST(matlab_LIBS)
-AC_SUBST(matlab_LDFLAGS)
-AC_SUBST(matlab_mexext)
 
 ################################################################################
 # compiler options
diff --git a/m4/ax_prog_matlab.m4 b/m4/ax_prog_matlab.m4
index 34a32e3..1e95505 100644
--- a/m4/ax_prog_matlab.m4
+++ b/m4/ax_prog_matlab.m4
@@ -27,6 +27,12 @@ AC_DEFUN([AX_PROG_MATLAB],
   AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([AX_LIB_FFTW3])
 
+  # option to enable mex file compilation for GNU Octave
+  AC_ARG_WITH(octave,
+    [AC_HELP_STRING([--with-octave=DIR],
+      [the directory where GNU Octave is installed])],
+    octave_dir=${withval},octave_dir="no")
+
   # option to enable mex file compilation
   AC_ARG_WITH(matlab,
     [AC_HELP_STRING([--with-matlab=DIR],
@@ -58,6 +64,10 @@ AC_DEFUN([AX_PROG_MATLAB],
       [matlab_threads="$enableval"],
       [matlab_threads="$enable_threads"])
 
+  if test "x${matlab_dir}" != "xno" -a "x${octave_dir}" != "xno"; then
+    AC_MSG_ERROR([The arguments --with-matlab and --with-octave can not be used simultaneously.])
+  fi
+
   AC_MSG_CHECKING([whether to check for Matlab])
 
   if test "x${matlab_dir}" = "xno"; then
@@ -320,7 +330,165 @@ AC_DEFUN([AX_PROG_MATLAB],
     LIBS="$saved_LIBS"
     LDFLAGS="$saved_LDFLAGS"
   fi
-  AM_CONDITIONAL(HAVE_MATLAB, test "x$ax_prog_matlab" = "xyes" )
+
+
+  AC_MSG_CHECKING([whether to check for GNU Octave])
+
+  if test "x${octave_dir}" = "xno"; then
+    AC_MSG_RESULT([no])
+    ax_prog_octave="no"
+  else
+    AC_MSG_RESULT([yes])
+    ax_prog_octave="yes"
+
+    if test "x${octave_dir}" = "xyes"; then
+      octave_dir=""
+    fi
+
+    # Modified code from RcppOctave
+    AC_MSG_CHECKING([Octave custom binary path specification])
+    if test [ -n "$octave_dir" ] ; then # passed as an option
+      AC_MSG_RESULT([$octave_dir [[from configure option --with-octave]]])
+      if test [ -n "${OCTAVE_PATH}" ] ; then
+	AC_MSG_NOTICE([overriding environment variable \$OCTAVE_PATH])
+      fi
+      OCTAVE_PATH="$octave_dir"
+    elif test [ -n "${OCTAVE_PATH}" ] ; then
+      AC_MSG_RESULT([${OCTAVE_PATH} [[from environment variable OCTAVE_PATH]]])
+    else
+      AC_MSG_RESULT([none])
+    fi
+
+    # build lookup path for octave-config
+    AS_IF([test -n "${OCTAVE_PATH}"], [
+	if test [ -f "$OCTAVE_PATH" ] ; then # path is a file: use parent directory
+	  OCTAVE_PATH=`AS_DIRNAME(["$OCTAVE_PATH"])`
+	fi
+	OCTAVE_LOOKUP_PATH="${OCTAVE_PATH}${PATH_SEPARATOR}${OCTAVE_PATH}/bin"
+	],[	
+	OCTAVE_LOOKUP_PATH="$PATH"
+	AC_MSG_NOTICE([using Octave binary path from \$PATH])
+	]
+    )
+
+    AC_PATH_PROG([OCTAVE_CONFIG], [octave-config], [], [${OCTAVE_LOOKUP_PATH}])
+    AC_PATH_PROG([OCTAVE_MKOCTFILE], [mkoctfile], [], [${OCTAVE_LOOKUP_PATH}])
+
+    AC_ARG_WITH(octave-libdir, [AC_HELP_STRING([--with-octave-libdir=DIR],
+    [compile with Octave library directory DIR])], octave_lib_dir=$withval, 
+      octave_lib_dir="yes")
+
+    AC_ARG_WITH(octave-includedir, [AC_HELP_STRING([--with-octave-includedir=DIR],
+    [compile with octave include directory DIR])], octave_include_dir=$withval, 
+      octave_include_dir="yes")
+
+    if test "x${octave_include_dir}" = "xyes"; then
+      if test "${OCTAVE_CONFIG}" != ""; then	
+        AC_MSG_CHECKING([Octave includes directory])
+        octave_include_dir=`${OCTAVE_CONFIG} --print OCTINCLUDEDIR`
+        if test "x${host_os}" = "xmingw32" -o "x${host_os}" = "xmingw64"; then
+          octave_include_dir=`cygpath -u ${octave_include_dir}`
+        fi
+	AC_MSG_RESULT([${octave_include_dir}])
+      else
+        octave_include_dir=""
+      fi
+    fi
+
+    if test "x${octave_lib_dir}" = "xyes"; then 
+      if test "${OCTAVE_CONFIG}" != ""; then	
+        AC_MSG_CHECKING([Octave libraries directory])
+	octave_lib_dir=`${OCTAVE_CONFIG} --print OCTLIBDIR`
+        if test "x${host_os}" = "xmingw32" -o "x${host_os}" = "xmingw64"; then
+	  octave_lib_dir=`cygpath -u ${octave_lib_dir}`
+        fi
+	AC_MSG_RESULT([${octave_lib_dir}])
+      else
+        octave_lib_dir=""
+      fi
+    fi
+
+    if test [ -n "$octave_include_dir" ]; then
+      matlab_CPPFLAGS="-I${octave_include_dir}"
+    else
+      matlab_CPPFLAGS=""
+    fi
+
+    if test [ -n "$octave_lib_dir" ]; then
+      matlab_LDFLAGS="-L${octave_lib_dir}"
+    else
+      matlab_LDFLAGS=""
+    fi
+
+    matlab_fftw3_LDFLAGS="$fftw3_LDFLAGS"
+    matlab_fftw3_LIBS="$fftw3_LIBS"
+    matlab_mexext=".mex"
+
+    saved_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$matlab_CPPFLAGS"
+    AC_CHECK_HEADER([mex.h], [], [AC_MSG_ERROR([Needed mex.h not found.])])
+    CPPFLAGS="$saved_CPPFLAGS"
+
+    saved_LDFLAGS="$LDFLAGS"
+    saved_LIBS="$LIBS"
+
+    if test "${OCTAVE_MKOCTFILE}" != ""; then	
+      AC_MSG_CHECKING([Octave liboctave flag])
+      octave_liboctave=`${OCTAVE_MKOCTFILE} --print LIBOCTAVE`
+      AC_MSG_RESULT([${octave_liboctave}])
+
+      AC_MSG_CHECKING([Octave libinterp flag])
+      octave_liboctinterp=`${OCTAVE_MKOCTFILE} --print LIBOCTINTERP`
+      AC_MSG_RESULT([${octave_liboctinterp}])
+
+      matlab_LIBS=""
+
+      if test [ -n "${octave_liboctave}"]; then
+        LDFLAGS="${saved_LDFLAGS} ${matlab_LDFLAGS}"
+        LIBS="${saved_LIBS} ${octave_liboctave}"
+        AC_MSG_CHECKING([for usable ${octave_liboctave}])
+        AC_LINK_IFELSE([AC_LANG_CALL([], [octave_handle_signal])], [
+          AC_MSG_RESULT([yes])
+          matlab_LIBS="${octave_liboctave}"
+          ],[AC_MSG_ERROR([no])])
+      fi
+
+      if test [ -n "${octave_liboctinterp}"]; then
+        LDFLAGS="${saved_LDFLAGS} ${matlab_LDFLAGS}"
+        LIBS="${saved_LIBS} ${octave_liboctinterp} ${matlab_LIBS}"
+        AC_MSG_CHECKING([for usable ${octave_liboctinterp}])
+        AC_LINK_IFELSE([AC_LANG_CALL([], [mexCallMATLAB])], [
+          AC_MSG_RESULT([yes])
+          matlab_LIBS="${octave_liboctinterp} ${matlab_LIBS}"
+          ],[
+          AC_MSG_ERROR([no])
+          ])
+      elif test [ -n "${octave_liboctave}"]; then
+        LDFLAGS="$saved_LDFLAGS ${matlab_LDFLAGS}"
+        LIBS="${saved_LIBS} ${matlab_LIBS}"
+        AC_MSG_CHECKING([for usable ${octave_liboctave}])
+        AC_LINK_IFELSE([AC_LANG_CALL([], [mexCallMATLAB])], [
+          AC_MSG_RESULT([yes])
+          ],[
+          AC_MSG_ERROR([no])
+          ])
+      fi
+    else
+      matlab_LIBS="-loctinterp -loctave"
+    fi
+
+    LDFLAGS="$saved_LDFLAGS ${matlab_LDFLAGS}"
+    LIBS="${saved_LIBS} ${matlab_LIBS}"
+    AC_MSG_CHECKING([for usable Octave MEX interface])
+    AC_LINK_IFELSE([AC_LANG_CALL([], [mexCallMATLAB])], [AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
+
+    LDFLAGS="$saved_LDFLAGS"
+    LIBS="$saved_LIBS"
+
+  fi
+
+
+  AM_CONDITIONAL(HAVE_MATLAB, test "x$ax_prog_matlab" = "xyes" -o "x$ax_prog_octave" = "xyes" )
   AM_CONDITIONAL(HAVE_MATLAB_THREADS, test "x$matlab_threads" = "xyes")
   AC_SUBST(matlab_CPPFLAGS)
   AC_SUBST(matlab_LIBS)
diff --git a/matlab/imex.h b/matlab/imex.h
index 694dfc5..dabc27f 100644
--- a/matlab/imex.h
+++ b/matlab/imex.h
@@ -27,7 +27,9 @@
 #endif
 
 #include <mex.h>
+#ifndef HAVE_OCTAVE
 #include <matrix.h>
+#endif
 
 #ifdef HAVE_MATLAB_GCC_REQUIRE_UNDEF_STDC_UTF_16
   #define __STDC_UTF_16__
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bb18ae3..fbd0806 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -34,7 +34,7 @@ else
   NFST_SOURCES=
 endif
 
-checkall_SOURCES = check.c bspline.c bspline.h bessel.c bessel.h nfft.c nfft.h $(NFCT_SOURCES) $(NFST_SOURCES)
+checkall_SOURCES = check.c version.c version.h bspline.c bspline.h bessel.c bessel.h nfft.c nfft.h $(NFCT_SOURCES) $(NFST_SOURCES)
 checkall_LDADD = $(top_builddir)/libnfft3 at PREC_SUFFIX@.la -lm -lcunit -lncurses
 
 if HAVE_THREADS
diff --git a/tests/check.c b/tests/check.c
index d77d933..2e06db7 100644
--- a/tests/check.c
+++ b/tests/check.c
@@ -22,6 +22,7 @@
 #include <CUnit/Automated.h>
 
 #include "infft.h"
+#include "version.h"
 #include "bspline.h"
 #include "bessel.h"
 #include "nfft.h"
@@ -134,6 +135,7 @@ int main(void)
   util = CU_add_suite("util", 0, 0);
   CU_add_test(util, "bspline", X(check_bspline));
   CU_add_test(util, "bessel_i0", X(check_bessel_i0));
+  CU_add_test(util, "version", X(check_version));
   CU_automated_run_tests();
   //CU_basic_run_tests();
   {
diff --git a/tests/version.c b/tests/version.c
new file mode 100644
index 0000000..0ec1179
--- /dev/null
+++ b/tests/version.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2002, 2016 Jens Keiner, Stefan Kunis, Daniel Potts
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* Standard headers. */
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <CUnit/CUnit.h>
+
+#include "nfft3.h"
+#include "infft.h"
+#include "version.h"
+
+void X(check_version)(void)
+{
+    unsigned major, minor, patch;
+    char v1[20], v2[20];
+
+    Y(get_version)(&major, &minor, &patch);
+
+    snprintf(v1, sizeof(v1), "%u.%u.%u", major, minor, patch);
+    snprintf(v2, sizeof(v2), "%u.%u.%u", NFFT_VERSION_MAJOR, NFFT_VERSION_MINOR, NFFT_VERSION_PATCH);
+
+    CU_ASSERT(strncmp(v1, v2, sizeof(v1)) == 0);
+}
diff --git a/tests/version.h b/tests/version.h
new file mode 100644
index 0000000..018a638
--- /dev/null
+++ b/tests/version.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2002, 2016 Jens Keiner, Stefan Kunis, Daniel Potts
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "infft.h"
+
+void X(check_version)(void);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/nfft.git



More information about the debian-science-commits mailing list