Hello everybody,
while working on the DSE hackathon Neural Mashup track in T292306 there was a problem with conda stacked envs and the python package magenta. If you create a regular conda stacked env (following https://wikitech.wikimedia.org/wiki/Analytics/Systems/Anaconda) and try to pip install magenta, this is the error that you get:
[..] src/rtmidi/RtMidi.cpp:1540:10: fatal error: alsa/asoundlib.h: No such file or directory #include <alsa/asoundlib.h> ^~~~~~~~~~~~~~~~~~
The magenta upstream docs suggest to apt-get install build-essential libasound2-dev libjack-dev, but it doesn't work with our current conda setup. Tried also the following but same error:
conda install -c conda-forge jack alsa-lib
The CPPFLAGS set for me are:
CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /usr/lib/anaconda-wmf/include DEBUG_CPPFLAGS=-D_DEBUG -D_FORTIFY_SOURCE=2 -Og -isystem /usr/lib/anaconda-wmf/include
The -isystem IIUC should force the c++ compiler to look for header files into /usr/lib/anaconda-wmf/include, so neither system headers (installed via apt) nor conda-installed ones are picked up (the latter gets deployed afaics into /home/$(whoami)/.conda/envs/YOUR-STACKED-ENV-NAME/include). The following hack works though:
export CPPFLAGS="-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /usr/lib/anaconda-wmf/include -isystem /home/$(whoami)/.conda/envs/YOUR-STACKED-ENV-NAME/include" (replace YOUR-STACKED-ENV-NAME)
This is surely a corner case since magenta requires python-rtmidi that in turn requires asoundlib.h to compile some c++ files, but I am wondering if we could do something about it in anaconda-wmf. If there is a simpler way apologies for this long task :)