MTG / homebrew-essentia

Homebrew build scripts for Essentia
34 stars 13 forks source link

Essentia install error on mac OS #9

Closed GitLau closed 6 years ago

GitLau commented 6 years ago

I installed essentia earlier today using homebrew and it worked like a charm. Then I decided I needed to remove anaconda and do a clean install of homebrew to start setting up my environments with a clean slate.

When I try to install essentia now, I get the following error:

Last 15 lines from /Users/Christoffer/Library/Logs/Homebrew/essentia/02.waf: ../src/algorithms/standard/constantq.cpp:104:58: error: implicit conversion from '_Complex double' to 'double' is not permitted in C++ vector<complex > hammingWindow(_FFTLength, 0.0 + 0.0j);


../src/algorithms/standard/constantq.cpp:105:63: error: implicit conversion from '_Complex double' to 'float' is not permitted in C++
  vector<complex<Real> > transfHammingWindowR(_FFTLength, 0.0 + 0.0j);
                                                          ~~~~^~~~~~
../src/algorithms/standard/constantq.cpp:120:42: error: implicit conversion from '_Complex double' to 'double' is not permitted in C++
    hammingWindow.assign(_FFTLength, 0.0 + 0.0j);
                                     ~~~~^~~~~~
4 errors generated.
Waf: Leaving directory `/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build'
Build failed
 -> task in 'essentia' failed (exit status 1): 
    {task 4500648784: cxx constantq.cpp -> constantq.cpp.1.o}
['clang++', '-pipe', '-Wall', '-msse', '-msse2', '-mfpmath=sse', '-O2', '-fPIC', '-w', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-fPIC', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build/src', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/src', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build/src/essentia', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/src/essentia', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build/src/essentia/scheduler', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/src/essentia/scheduler', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build/src/essentia/streaming', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/src/essentia/streaming', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build/src/essentia/streaming/algorithms', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/src/essentia/streaming/algorithms', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build/src/essentia/utils', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/src/essentia/utils', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build/src/3rdparty', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/src/3rdparty', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build/src/3rdparty/spline', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/src/3rdparty/spline', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/build/src/3rdparty/vamp-plugin-sdk-2.4', '-I/private/tmp/essentia-20180629-3371-1mpn39t/essentia-2.1_beta3/src/3rdparty/vamp-plugin-sdk-2.4', '-I/usr/local/Cellar/fftw/3.3.8/include', '-I/usr/local/Cellar/ffmpeg/4.0.1/include', '-I/usr/local/Cellar/libsamplerate/0.1.9/include', '-I/usr/local/Cellar/taglib/1.11.1/include/taglib', '-I/usr/local/Cellar/libyaml/0.2.1/include', '-DGTEST_HAS_TR1_TUPLE=0', '-DHAVE_AVCODEC=1', '-DHAVE_AVFORMAT=1', '-DHAVE_AVUTIL=1', '-DHAVE_AVRESAMPLE=1', '-DHAVE_SAMPLERATE=1', '-DHAVE_TAGLIB=1', '-DHAVE_YAML=1', '-DHAVE_FFTW=1', '-D__STDC_CONSTANT_MACROS', '-DPYTHONDIR="/usr/local/Cellar/essentia/2.1_beta3/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/Cellar/essentia/2.1_beta3/lib/python2.7/site-packages"', '-DHAVE_PYTHON_H=1', '../src/algorithms/standard/constantq.cpp', '-c', '-o', 'src/algorithms/standard/constantq.cpp.1.o']

To be honest I have no idea what's going wrong here.
I only have the native mac Python installed as I just removed all other Python versions.

I also tried to install using brew install --HEAD (as suggested as a solution to issue #8), but to no avail

MacBook Pro Late 2013
High Sierra 10.13.4
tobiasschlatter commented 5 years ago

How did you resolve this? I run into the same problem.

GitLau commented 5 years ago

Hey Tobias, I ended up getting help to install essentia without using homebrew. It's a pretty good workaround unless you need/want homebrew for other reasons.

justinsalamon commented 5 years ago

I had a similar issue trying to build beta3. Note that this issue might have been fixed in the latest version of the master branch.

For beta3 the build is failing on constantq.cpp, here's a quick (hacky) fix:

It appears the compiler is complaining about a cast from _Complex double to double. Note that the complex value in all the lines the compiler is complaining about is 0.0 + 0.0j which is just 0. So you can replace 0.0 + 0.0j with just 0.0 in these lines, and then the compilation completes successfully (at least for me).

Note that for these lines this change shouldn't change the semantics of the code because it's just a complex 0 value that's immediately cast to a double 0, but be careful about making this change to lines where the value is not 0 or where it's not immediately cast to a double, since that could change the behavior of the code in undesired ways.