MTG / essentia

C++ library for audio and music analysis, description and synthesis, including Python bindings
http://essentia.upf.edu
GNU Affero General Public License v3.0
2.8k stars 525 forks source link

Fails to compile on clang with old c++ standard #795

Closed alastair closed 5 years ago

alastair commented 5 years ago

Clang defaults to c++98, which seems to be too old for some features that are being used. Specifically, it fails at

../src/algorithms/standard/constantq.cpp:103:58: error: implicit conversion from '_Complex double' to 'double' is not permitted in C++
  vector<complex<double> > hammingWindow(_FFTLength, 0.0 + 0.0i);
                                                     ~~~~^~~~~~

This doesn't fail on g++ 8.2, which defaults to gnu++14.

It'd be good to choose a specific standard and add it to CXXFLAGS

alastair commented 5 years ago

Workaround is to set the c++ standard while compiling:

CXXFLAGS=-std=c++14 ./waf configure
dbogdanov commented 5 years ago

Which version of clang is that? I suppose since clang 6.0 it defaults to c++14.

alastair commented 5 years ago

unclear, apple's clang reports the version of xcode, not clang:

$ clang -v
Apple LLVM version 10.0.0 (clang-1000.10.44.2)
alastair commented 5 years ago

Fixed by #804