Skip to content

fftw3: hangs on raspberry pi3 #5512

@soundart

Description

@soundart

Maintainer: @Wedmer
Environment: (arm, brcm2708_bcm2710, lede 79f57e4)

Description:

FFTW3 hangs due to using CLOCK_SGI_CYCLE, which was removed from linux.
see FFTW/fftw3#122 and FFTW/fftw3#123

diff --git a/kernel/cycle.h b/kernel/cycle.h
index fe3dd50d..777d1cda 100644
--- a/kernel/cycle.h
+++ b/kernel/cycle.h
@@ -437,14 +437,24 @@ INLINE_ELAPSED(__inline)
 #define HAVE_TICK_COUNTER
 #endif
 /*----------------------------------------------------------------*/
-/* SGI/Irix */
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE) && !defined(HAVE_TICK_COUNTER) && !defined(__ANDROID__)
+/* SGI/Irix/Linux but not android */
+#if !defined(__ANDROID__) && !defined(HAVE_TICK_COUNTER)
+#if defined(HAVE_CLOCK_GETTIME)
+#if defined(CLOCK_MONOTONIC)
+#define METHOD CLOCK_MONOTONIC
+#elif defined(CLOCK_REALTIME)
+#define METHOD CLOCK_REALTIME
+#elif defined(CLOCK_SGI_CYCLE)
+#define METHOD CLOCK_SGI_CYCLE
+#endif
+#endif
+
 typedef struct timespec ticks;

 static inline ticks getticks(void)
 {
      struct timespec t;
-     clock_gettime(CLOCK_SGI_CYCLE, &t);
+     clock_gettime(METHOD, &t);
      return t;
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions