Author Topic: Vampy numpy problem on Ubuntu  (Read 5945 times)

grh

  • Newbie
  • *
  • Posts: 9
    • View Profile
Vampy numpy problem on Ubuntu
« on: October 02, 2010, 09:40:03 »
Hallo!

First thanks for Vampy - it looks really nice and I am looking forward to try some algorithms and visualise it with SonicVisualiser ;).
However, I have a problem with the numpy interface (vf_ARRAY) on Ubuntu 10.04, Python 2.6.5 and numpy 1.3.0.

I installed the latest binaries of SonicVisualiser, Vampy - but all Vampy plugins which use the vf_ARRAY interface are not working, the others work.
At startup of the SonicVisualiser I get the following output:
Code: [Select]
    Numpy build information: ABI level: 16777225 Numpy version: 1.1
    Numpy runtime version: 1
    Incompatible Numpy version found: 1
    Please make sure you have Numpy 1.1 or greater installed.
    Vampy: Numpy support disabled.

OK, so I compiled everything myself (Vamp SDK and Vampy, using the latest source from your webpage), still the same output.
Then I set the compiler flag NUMPY_SHORTVERSION=1.3, but again:
Code: [Select]
    Numpy build information: ABI level: 16777225 Numpy version: 1.3
    Numpy runtime version: 1
    Incompatible Numpy version found: 1
    Please make sure you have Numpy 1.3 or greater installed.
    Vampy: Numpy support disabled.

Do you have any clues what I could try to get this working ?

Thanks for any hints,
LG
Georg

grh

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Vampy numpy problem on Ubuntu
« Reply #1 on: October 03, 2010, 13:17:10 »
OK, I found the bug: it is in vampy-main.cpp.
You parse the Numpy version string with sscanf and this seems to have some problems: I always get "1" instead of "1.3" as a result.

One possible fix is to use C++ istringstream to parse the data:
Code: [Select]
--- 41,43 ----
  #include "PyExtensionManager.h"
! #include <sstream>
 
***************
*** 116,119 ****
 
!     string ver;
!     std::istringstream verStream;
      float numpyVersion;
***************
*** 148,155 ****
  ver = ver.substr(0,ver.rfind("."));
- if(EOF == sscanf(ver.c_str(), "%f", &numpyVersion))
- {
- cerr << "Could not parse Numpy version information." << endl;
- goto numpyFailure;
- }
 
  cerr << "Numpy runtime version: " << numpyVersion << endl;
--- 149,154 ----
  ver = ver.substr(0,ver.rfind("."));
 
+     // parse version string to float
+     verStream.str(ver);
+     verStream >> numpyVersion;
       cerr << "Numpy runtime version: " << numpyVersion << endl;

Now everything works like expected - maybe you can include this fix (or a similar method) in a future version !

fazekasgy

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Vampy numpy problem on Ubuntu
« Reply #2 on: October 12, 2010, 14:11:31 »
Hi Georg,
Thanks for the bug report and the fix!
It will be included in the next release.

George

grh

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Vampy numpy problem on Ubuntu
« Reply #3 on: October 12, 2010, 14:50:29 »
Hallo George!

Thanks for the answer !

One more question: is this the right place to report such problems ?
Or should I better write such things on the mailing list ?

LG
Georg