changeset 130:c655fa61884f

* Solaris build fixes
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 14 Sep 2009 13:01:57 +0000
parents 1a24b134cd79
children 0258a32639e6
files plugins/BarBeatTrack.cpp plugins/ChromagramPlugin.cpp plugins/ConstantQSpectrogram.cpp plugins/DWT.cpp plugins/MFCCPlugin.cpp plugins/SimilarityPlugin.cpp qm-vamp-plugins.pro
diffstat 7 files changed, 26 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/BarBeatTrack.cpp	Fri Jul 03 13:08:12 2009 +0000
+++ b/plugins/BarBeatTrack.cpp	Mon Sep 14 13:01:57 2009 +0000
@@ -20,6 +20,10 @@
 using std::cerr;
 using std::endl;
 
+#ifndef __GNUC__
+#include <alloca.h>
+#endif
+
 float BarBeatTracker::m_stepSecs = 0.01161; // 512 samples at 44100
 
 class BarBeatTrackerData
@@ -272,7 +276,11 @@
     // We only support a single input channel
 
     const int fl = m_d->dfConfig.frameLength;
+#ifndef __GNUC__
+    double *dfinput = (double *)alloca(fl * sizeof(double));
+#else
     double dfinput[fl];
+#endif
     for (int i = 0; i < fl; ++i) dfinput[i] = inputBuffers[0][i];
 
     double output = m_d->df->process(dfinput);
--- a/plugins/ChromagramPlugin.cpp	Fri Jul 03 13:08:12 2009 +0000
+++ b/plugins/ChromagramPlugin.cpp	Mon Sep 14 13:01:57 2009 +0000
@@ -373,7 +373,7 @@
             cerr << value << " ";
         }
 */
-        if (isnan(value)) value = 0.0;
+        if (ISNAN(value)) value = 0.0;
         m_binsums[i] += value;
 	feature.values.push_back(value);
     }
--- a/plugins/ConstantQSpectrogram.cpp	Fri Jul 03 13:08:12 2009 +0000
+++ b/plugins/ConstantQSpectrogram.cpp	Mon Sep 14 13:01:57 2009 +0000
@@ -364,8 +364,8 @@
         double re = cqre[i];
         double im = cqim[i];
 //        std::cout << re << "," << im << ":";
-        if (isnan(re)) re = 0.0;
-        if (isnan(im)) im = 0.0;
+        if (ISNAN(re)) re = 0.0;
+        if (ISNAN(im)) im = 0.0;
         double value = sqrt(re * re + im * im);
 //        std::cout << value << " ";
 	feature.values.push_back(value);
--- a/plugins/DWT.cpp	Fri Jul 03 13:08:12 2009 +0000
+++ b/plugins/DWT.cpp	Mon Sep 14 13:01:57 2009 +0000
@@ -325,7 +325,7 @@
         feature.hasTimestamp = false;
 		
         for (int j = 0; j < s; j++) {
-            outloc = floor(m / (1 << j));									// This one pushes a single result bin 
+            outloc = m / (1 << j);									// This one pushes a single result bin 
             // onto the top of a feature column
             feature.values.push_back(wCoefficients[j][outloc]);				// each coefficient on higher scales need 
         }																	// to be copied multiple times to feature columns
@@ -430,7 +430,7 @@
             feature.hasTimestamp = false;
 		
             for (int j = 0; j < s; j++) {
-                outloc = floor(m / (1 << j));									// This one pushes a single result bin 
+                outloc = m / (1 << j);									// This one pushes a single result bin 
                 // onto the top of a feature column
                 feature.values.push_back(wCoefficients[j][outloc]);				// each coefficient on higher scales need 
             }																	// to be copied multiple times to feature columns
--- a/plugins/MFCCPlugin.cpp	Fri Jul 03 13:08:12 2009 +0000
+++ b/plugins/MFCCPlugin.cpp	Mon Sep 14 13:01:57 2009 +0000
@@ -10,16 +10,13 @@
 #include "MFCCPlugin.h"
 
 #include <dsp/mfcc/MFCC.h>
-
-#include <cmath>
+#include <maths/MathUtilities.h>
 
 using std::string;
 using std::vector;
 using std::cerr;
 using std::endl;
 
-using std::isnan;
-
 MFCCPlugin::MFCCPlugin(float inputSampleRate) :
     Vamp::Plugin(inputSampleRate),
     m_config(lrintf(inputSampleRate)),
@@ -274,7 +271,7 @@
     feature.hasTimestamp = false;
     for (size_t i = 0; i < m_bins; ++i) {
         double value = output[i];
-        if (isnan(value)) value = 0.0;
+        if (ISNAN(value)) value = 0.0;
         m_binsums[i] += value;
 	feature.values.push_back(value);
     }
--- a/plugins/SimilarityPlugin.cpp	Fri Jul 03 13:08:12 2009 +0000
+++ b/plugins/SimilarityPlugin.cpp	Mon Sep 14 13:01:57 2009 +0000
@@ -681,7 +681,7 @@
             count = 0;
             for (int k = 0; k < sz; ++k) {
                 double val = m_values[i][k][j];
-                if (isnan(val) || isinf(val)) continue;
+                if (ISNAN(val) || ISINF(val)) continue;
                 mean[j] += val;
                 ++count;
             }
@@ -691,7 +691,7 @@
             for (int k = 0; k < sz; ++k) {
                 double val = ((m_values[i][k][j] - mean[j]) *
                               (m_values[i][k][j] - mean[j]));
-                if (isnan(val) || isinf(val)) continue;
+                if (ISNAN(val) || ISINF(val)) continue;
                 variance[j] += val;
                 ++count;
             }
--- a/qm-vamp-plugins.pro	Fri Jul 03 13:08:12 2009 +0000
+++ b/qm-vamp-plugins.pro	Mon Sep 14 13:01:57 2009 +0000
@@ -36,6 +36,15 @@
     LIBS += -shared -Wl,-Bstatic -lqm-dsp -lvamp-sdk -llapack -lcblas -latlas -lf77blas -lg2cstubs -Wl,-Bdynamic -Wl,--version-script=vamp-plugin.map
 }
 
+solaris* {
+    QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -fast
+    INCLUDEPATH += /usr/local/include ../qm-dsp
+    INCLUDEPATH += /opt/ATLAS3.9.14/include
+    LIBPATH += ../qm-dsp /opt/ATLAS3.9.14/lib
+    DEFINES += USE_PTHREADS
+    LIBS += -Bstatic -lqm-dsp -lvamp-sdk -llapack -lcblas -latlas -Bdynamic -lpthread -Wl,--version-script=vamp-plugin.map -lCstd -lCrun
+}
+
 OBJECTS_DIR = tmp_obj
 MOC_DIR = tmp_moc