thread-safe fftw (needs fftw-3.3.5)
authorRobin Gareus <robin@gareus.org>
Sat, 17 Oct 2015 17:23:39 +0000 (19:23 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 17 Oct 2015 17:23:39 +0000 (19:23 +0200)
see https://github.com/FFTW/fftw3/issues/16

gtk2_ardour/main.cc
gtk2_ardour/wscript

index ce7dc4b5d14bd247aac1c47c0f626363150b66f6..e8bfe43aa1f5c6d9060a57f3643bd0428eb01326 100644 (file)
 #include <sigc++/bind.h>
 #include <gtkmm/settings.h>
 
+#ifdef HAVE_FFTW35F
+#include <fftw3.h>
+#endif
+
 #include "pbd/error.h"
 #include "pbd/file_utils.h"
 #include "pbd/textreceiver.h"
@@ -283,6 +287,10 @@ int main (int argc, char *argv[])
                Glib::thread_init();
        }
 
+#ifdef HAVE_FFTW35F
+       ftwf_make_planner_thread_safe ();
+#endif
+
 #ifdef ENABLE_NLS
        gtk_set_locale ();
 #endif
index 7b138f7ae2615252fba505a1f9e2053213d8b069..e0b809608aaf3a96ad044a67da69d44f220c881e 100644 (file)
@@ -291,6 +291,8 @@ def configure(conf):
 
     autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
                       mandatory=True)
+    autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW35F',
+                      atleast_version='3.3.5', mandatory=False)
     autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
                       atleast_version='1.2.1')
     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
@@ -483,6 +485,9 @@ def build(bld):
         obj.source += [ 'lv2_plugin_ui.cc' ]
         obj.use += [ 'SUIL' ]
 
+    if bld.is_defined('HAVE_FFTW35F'):
+        obj.linkflags = ' -lfftw3_threads'
+
     if bld.is_defined('NEED_INTL'):
         obj.linkflags = ' -lintl'