< Back to IRCAM Forum

EASDIF and Python

Hello,

Following a suggestion made on this forum, I’m finally getting into librosa and into Python more broadly. Looking around for packages dealing with SDIF, I came across EASDIF, developped by IRCAM researchers. My question is twofold, is it still available for current versions of macOS (I’m on Mojave, 10.14) and Python 3? If so, what would be the necessary steps to have it installed and running on my system?

Any input on this, and SDIF in Python generally, would be greatly appreciated.

All the best,
António

Hi Antonio,

As I mentioned already in my first reply you find some useful tools precompiled for Anaconda python here

https://anaconda.org/roebel

most interestingly for you may be the EASDIF package ready to be installed into Anaoncda for Linux and MacOS. There is also
quite good support for reading more or less all uncompressed sound files into python with the pysndfile package build around the libsndfile library.

In case you are working on windows or are not using Anaconda you could compile from sources, but this road may be a bit bumpy because I
don’t use windows myself, and so all information I provide is tested only for linux and macos

For easdif you have the sources here

https://sourceforge.net/p/sdif/code/HEAD/tree/

The description for compiling is here, (this includes windows instuctions that worked at some point in time)

https://sourceforge.net/p/sdif/code/HEAD/tree/trunk/Easdif/README

and for compiling python interfaces ere

https://sourceforge.net/p/sdif/code/HEAD/tree/trunk/Easdif/swig/README

svn checkout svn://svn.code.sf.net/p/sdif/code/trunk/Easdif EASDIF_SDIF

There are special targets for creating and installing the python modules, it comes down to this sequence of commands:

svn checkout svn://svn.code.sf.net/p/sdif/code/trunk/Easdif EASDIF_SDIF
mkdir -p build_easdif
cd build_easdif
cmake …/EASDIF_SDIF -DPYTHON:PATH=python3 -DEASDIF_DO_PYTHON:bool=on
make pythonswig
make install_python_easdif_module_globally

alternatively in case you are not allowed to install gloablly oyu can use the target that installs for the current user

make install_python_easdif_module_locally

Concerning pysndfile you can also find it on pypi

but this will work again only on macos and linux, and in case you would like to compile for windows you can look into the sources here

https://forge-2.ircam.fr/roebel/pysndfile

or here

https://github.com/roebel/pysndfile

Good luck,
Axel

Hi Antonio,

As I mentioned already in my first reply you find some useful tools precompiled for Anaconda python here,

https://anaconda.org/roebel

All these are python3, and I don’t see why this should not work for Mojave.

Most interestingly for you may be the EASDIF package ready to be installed into Anaconda for Linux and MacOS. There is also
quite good support for reading more or less all uncompressed sound files into python with the pysndfile package build around the libsndfile library.

In case you are not using Anaconda (or ou use windows) you could compile from sources

For easdif you have the sources here

https://sourceforge.net/p/sdif/code/HEAD/tree/

The description for compiling is here, (this includes windows instuctions that worked at some point in time)

https://sourceforge.net/p/sdif/code/HEAD/tree/trunk/Easdif/README

and for compiling python interfaces ere

https://sourceforge.net/p/sdif/code/HEAD/tree/trunk/Easdif/swig/README

svn checkout svn://svn.code.sf.net/p/sdif/code/trunk/Easdif EASDIF_SDIF

There are special targets for creating and installing the python modules, it comes down to this sequence of commands:

svn checkout svn://svn.code.sf.net/p/sdif/code/trunk/Easdif EASDIF_SDIF
mkdir -p build_easdif
cd build_easdif
cmake …/EASDIF_SDIF -DPYTHON:PATH=python3 -DEASDIF_DO_PYTHON:bool=on
make pythonswig
make install_python_easdif_module_globally

alternatively in case you are not allowed to install gloablly oyu can use the target that installs for the current user

make install_python_easdif_module_locally

Concerning pysndfile you can also find it on pypi

this will work again only on macos and linux, and in case you would like to compile for windows you can look into the sources here

https://forge-2.ircam.fr/roebel/pysndfile

or here

https://github.com/roebel/pysndfile

Best,
Axel

Hi Antonio,

As I mentioned already in my first reply you find some useful tools precompiled for Anaconda python here,

https://anaconda.org/roebel

All these are python3, and I don’t see why this should not work for Mojave.

Most interestingly for you may be the EASDIF package ready to be installed into Anaconda for Linux and MacOS. There is also
quite good support for reading more or less all uncompressed sound files into python with the pysndfile package build around the libsndfile library.

In case you are not using Anaconda (or ou use windows) you could compile from sources

For easdif you have the sources here

https://sourceforge.net/p/sdif/code/HEAD/tree/

The description for compiling is here, (this includes windows instructions that worked at some point in time)

https://sourceforge.net/p/sdif/code/HEAD/tree/trunk/Easdif/README

and for compiling python interfaces ere

https://sourceforge.net/p/sdif/code/HEAD/tree/trunk/Easdif/swig/README

svn checkout svn://svn.code.sf.net/p/sdif/code/trunk/Easdif EASDIF_SDIF

There are special targets for creating and installing the python modules, it comes down to this sequence of commands:

svn checkout svn://svn.code.sf.net/p/sdif/code/trunk/Easdif EASDIF_SDIF
mkdir -p build_easdif
cd build_easdif
cmake …/EASDIF_SDIF -DPYTHON:PATH=python3 -DEASDIF_DO_PYTHON:bool=on
make pythonswig
make install_python_easdif_module_globally

alternatively in case you are not allowed to install gloablly oyu can use the target that installs for the current user

make install_python_easdif_module_locally

Concerning pysndfile you can also find it on pypi

this will work again only on macos and linux, and in case you would like to compile for windows you can look into the sources here

https://forge-2.ircam.fr/roebel/pysndfile

or here

https://github.com/roebel/pysndfile

Best,
Axel

Hi Antonio,

As I mentioned already in my first reply you find some useful tools precompiled for Anaconda python here,

https://anaconda.org/roebel

All these are python3, and I don’t see why this should not work for Mojave.

Most interestingly for you may be the EASDIF package ready to be installed into Anaconda for Linux and MacOS. There is also
quite good support for reading more or less all uncompressed sound files into python with the pysndfile package build around the libsndfile library.

In case you are not using Anaconda (or ou use windows) you could compile from sources

For easdif you have the sources here

 https://sourceforge.net/p/sdif/code/HEAD/tree/  

The description for compiling is here, (this includes windows instructions that worked at some point in time)

https://sourceforge.net/p/sdif/code/HEAD/tree/trunk/Easdif/README

and for compiling python interfaces ere

 https://sourceforge.net/p/sdif/code/HEAD/tree/trunk/Easdif/swig/README  

svn checkout svn://svn.code.sf.net/p/sdif/code/trunk/Easdif EASDIF_SDIF

There are special targets for creating and installing the python modules, it comes down to this sequence of commands:

svn checkout svn://svn.code.sf.net/p/sdif/code/trunk/Easdif EASDIF_SDIF
mkdir -p build_easdif
cd build_easdif
cmake …/EASDIF_SDIF -DPYTHON:PATH=python3 -DEASDIF_DO_PYTHON:bool=on
make pythonswig
make install_python_easdif_module_globally

alternatively in case you are not allowed to install gloablly oyu can use the target that installs for the current user

make install_python_easdif_module_locally

Concerning pysndfile you can also find it on pypi

this will work again only on macos and linux, and in case you would like to compile for windows you can look into the sources here

https://forge-2.ircam.fr/roebel/pysndfile

or here

https://github.com/roebel/pysndfile

Best,
Axel

Hi Antonio,

As I mentioned already in my first reply you find some useful tools precompiled for Anaconda python here,

https://anaconda.org/roebel

All these are python3, and I don’t see why this should not work for Mojave.

Most interestingly for you may be the EASDIF package ready to be installed into Anaconda for Linux and MacOS. There is also
quite good support for reading more or less all uncompressed sound files into python with the pysndfile package build around the libsndfile library.

Best,
Axel

Hi Antonio,

As I mentioned already in my first reply you find some useful tools precompiled for Anaconda python
on the Anaconda roebel channel.

All these are python3, and I don’t see why this should not work for Mojave.

Most interestingly for you may be the EASDIF package ready to be installed into Anaconda for Linux and MacOS. There is also
quite good support for reading more or less all uncompressed sound files into python with the pysndfile package
build around the libsndfile library.

In case you are not using Anaconda (or you use windows) you could compile from sources
For easdif you have the sources here

The description for compiling is here,
(this includes windows instructions that worked at some point in time)
and for compiling python interfaces here

There are special targets for creating and installing the python modules, it comes down to this sequence of commands:

  
svn checkout  svn://svn.code.sf.net/p/sdif/code/trunk/Easdif EASDIF_SDIF  
mkdir -p build_easdif  
cd build_easdif  
cmake ../EASDIF_SDIF -DPYTHON:PATH=python3 -DEASDIF_DO_PYTHON:bool=on  
make pythonswig  
make install_python_easdif_module_globally  
# alternatively in case you are not allowed to install globally you can use the target that installs for the current user  
make install_python_easdif_module_locally  

Concerning pysndfile you can also find it on pypi here

this will work again only on macos and linux, and in case you would like to compile for windows you can look into the sources here
or here

Best,
Axel

Hi Antonio,

I tried to to reply to this question for now about 10 times, it just does not pass. May be too many links in the reply ? I try here to add all the content as a txt
attachment.

Best
Axel

reply.txt (1.89 KB)

Thank you so much for this, Axel. Everything is working smoothly.

For macOS Mojave users, if you’re not going for the conda version (please read Axel’s detailed instructions above), you should be aware that Xcode 10 won’t do, you should be sure you have Xcode 9 installed in your system (the command-line tools should suffise). You can get older versions of Xcode here: https://developer.apple.com/

Hi Antonio,

fine that it worked for you, and interesting that we have a problem with Xcode 10. Unfortunately, I am not yet on High Sierra or let alone
Mojave, but that will come.

In case you can easily reproduce the error it might be interesting for us if you open an issue on SDIF Sourceforge, or if you prefere github you could also create an issue in a manually maintained (and probably a little bit outdated) copy of the EASDIF repos on github here

https://github.com/roebel/EASDIF_SDIF

Best
Axel

Hello Axel,

I’m neither on Github or SourceForge, so I’ll leave the error I got here. The issue is that “stdlibc++” is no longer supported by Xcode 10. Here’s the error I got:

iMac:easdif antonioflorenca$ make pythonswig
Scanning dependencies of target Easdif_static_pic
[ 0%] Building CXX object easdif/CMakeFiles/Easdif_static_pic.dir/sdifentity.cpp.o
warning: include path for stdlibc++ headers not found; pass ‘-std=libc++’ on the command
line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
/Users/antonioflorenca/EASDIF_SDIF/easdif/sdifentity.cpp:271:10: fatal error: ‘iostream’
file not found
#include
^~~~~~~~~~
1 warning and 1 error generated.
make[3]: *** [easdif/CMakeFiles/Easdif_static_pic.dir/sdifentity.cpp.o] Error 1
make[2]: *** [easdif/CMakeFiles/Easdif_static_pic.dir/all] Error 2
make[1]: *** [swig/python/CMakeFiles/pythonswig.dir/rule] Error 2
make: *** [pythonswig] Error 2

Hope this helps.

All the best,
António

António, I think the issue with libstdc++ can be solved by adding -DUSE_LLVM_STD:BOOL=ON to the cmake command line, so that it should read:
cmake …/EASDIF_SDIF -DPYTHON:PATH=python3 -DEASDIF_DO_PYTHON:bool=on -DUSE_LLVM_STD:BOOL=ON
I don’t have access to Mojave either (and hence to Xcode 10), so there might be other errors, but if you report these maybe we can fix them (there were some before related to the default version of the C++ standard)

Hello Frédéric,

I’ve attached a rtf file with the Terminal run of Axel’s instructions for the installation without conda, before I installed Xcode 9.4 (I had only Xcode 10 on my system).

As I said, replying to Axel, I’m neither in SourceForge or GitHub, but if you wish and think it will help, I can test things on my system and post here the Terminal output as rtf files.

All the best,
António

EASDIF-install-1st-trial…-FAIL.rtf (32.4 KB)

António,
That -DUSE_LLVM_STD:BOOL=ON cmake option tell the configuration to pass -std=libc++ on the compiler command line, as indicated by the error message.
You found a workaround so you don’t need to do this, but I posted that reply anyway for future reference, and also in case you run into trouble with libstdc++.dylib on Mojave or the next version of MacOS.
We’ll eventually have access to Mojave and Xcode 10, and be able to address these issues properly.

No big deal, Frédéric. Properly is definitely the best way to do it.

All the best,
António