Mercurial > hg > vampy
comparison vampy-main.cpp @ 63:577b251cad2f
applied patch to fix bug related to numpy version string parsing
author | gyorgyf |
---|---|
date | Sat, 05 Oct 2013 13:36:27 +0100 |
parents | b2c4c752c3bc |
children | 5664fe298af2 |
comparison
equal
deleted
inserted
replaced
62:74703a562ce3 | 63:577b251cad2f |
---|---|
37 #include "vamp-sdk/PluginAdapter.h" | 37 #include "vamp-sdk/PluginAdapter.h" |
38 #include "PyPlugScanner.h" | 38 #include "PyPlugScanner.h" |
39 #include "PyPlugin.h" | 39 #include "PyPlugin.h" |
40 #include "PyExtensionModule.h" | 40 #include "PyExtensionModule.h" |
41 #include "PyExtensionManager.h" | 41 #include "PyExtensionManager.h" |
42 | 42 #include <sstream> |
43 | 43 |
44 #ifdef _WIN32 | 44 #ifdef _WIN32 |
45 #define pathsep ('\\') | 45 #define pathsep ('\\') |
46 #include <windows.h> | 46 #include <windows.h> |
47 #include <tchar.h> | 47 #include <tchar.h> |
113 */ | 113 */ |
114 | 114 |
115 #ifdef HAVE_NUMPY | 115 #ifdef HAVE_NUMPY |
116 | 116 |
117 string ver; | 117 string ver; |
118 std::istringstream verStream; | |
118 float numpyVersion; | 119 float numpyVersion; |
119 | 120 |
120 /// attmept to test numpy version before importing the array API | 121 /// attmept to test numpy version before importing the array API |
121 cerr << "Numpy build information: ABI level: " << NPY_VERSION | 122 cerr << "Numpy build information: ABI level: " << NPY_VERSION |
122 << " Numpy version: " << NUMPY_SHORTVERSION << endl; | 123 << " Numpy version: " << NUMPY_SHORTVERSION << endl; |
144 goto numpyFailure; | 145 goto numpyFailure; |
145 } | 146 } |
146 | 147 |
147 ver = PyString_AsString(pyVer); | 148 ver = PyString_AsString(pyVer); |
148 ver = ver.substr(0,ver.rfind(".")); | 149 ver = ver.substr(0,ver.rfind(".")); |
149 if(EOF == sscanf(ver.c_str(), "%f", &numpyVersion)) | 150 /* |
150 { | 151 Applied patch from here: http://vamp-plugins.org/forum/index.php/topic,162.msg387.html#msg387 to replace this: |
151 cerr << "Could not parse Numpy version information." << endl; | 152 if(EOF == sscanf(ver.c_str(), "%f", &numpyVersion)) |
152 goto numpyFailure; | 153 { |
153 } | 154 cerr << "Could not parse Numpy version information." << endl; |
155 goto numpyFailure; | |
156 }*/ | |
157 // parse version string to float | |
158 verStream.str(ver); | |
159 verStream >> numpyVersion; | |
154 | 160 |
155 cerr << "Numpy runtime version: " << numpyVersion << endl; | 161 cerr << "Numpy runtime version: " << numpyVersion << endl; |
156 if (numpyVersion < (float) NUMPY_SHORTVERSION) { | 162 if (numpyVersion < (float) NUMPY_SHORTVERSION) { |
157 cerr << "Incompatible Numpy version found: " << numpyVersion << endl; | 163 cerr << "Incompatible Numpy version found: " << numpyVersion << endl; |
158 goto numpyFailure; | 164 goto numpyFailure; |