-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building with libc++ on OSX #9
Comments
Well, this is trickier than it seems... Normally, you should just uncomment those lines: https://github.com/MTG/essentia/blob/master/wscript#L65 However, if you do that, then this file doesn't compile anymore: https://github.com/MTG/essentia/blob/master/src/base/roguevector.h And the problem lies in the fact that the The correct and clean solution would be to replace all uses of |
I completely understand. I wish I had the necessary skills to contribute a solution to this issue. In the meantime, I suppose one workable solution for my prototype would be to compile my extractor as a command line utility, execute the utility from my "host" application, write the algorithm results to a file, and then read/parse the file contents to my host libc++ application. If anyone else has any ideas, input would be greatly appreciated. |
Compiling the extractor as a command-line utility seems the best choice:
|
I just came across the same issue when trying to build Essentia on mobile iOS. Then I put everything in XCode5 and build. Now the error is exactly the problem depicted here: Without having the libc++ flags active I have: /Users/loreto/Projects/iOS/AUDIO/EssentiaTouch/EssentiaTouch/Classes/essentia/roguevector.h:127:40: No member named '_M_impl' in 'essentia::RogueVector' My question here is Is possibile to use instead Apple "veclib.h" from Accelerate.Framework here ? I mean /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h |
the problem here is that the RogueVector class relies on an implementation detail of the std::vector class from the gnu libstdc++ that gcc links to. Clang however links against libc++ which has a different implementation and doesn't allow the RogueVector to be implemented on top of it, because all its member variables are private (they are protected in libstdc++). If you could compile using libstdc++ instead of libc++ that should make it work. Otherwise, the better (but more time consuming) solution would be to implement a custom vector class that would allow the RogueVector to be implemented, and change all the buffers in the streaming mode to use that vector class (instead of std::vector currently) |
I agree that the best solution would it be to implement the custom vector class. So far I'm compiling against libstdc++ and it works fine on LLVM5.0 / armv7. That was operating in standard mode, due to too much native IO limitation with the streaming mode on armv7 devices. Hope to see a RogueVector specific implementation and a huge refactoring then! |
The latest version of master now builds against libc++ instead of libstdc++ on mac os. It's a big fat hack but it works, so that's what it is :-) The correct fix is still to move most of Essentia to a specific essentia::Vector (and essentia::Matrix to replace tnt::Array2D), but that will be for a later version. In the meantime, it should now compile everywhere using the native compiler and C++ standard lib (should also work on iphone, although I haven't tested it) |
Hey there,
I've been having a great time working with this excellent library. I'm currently trying to incorporate it into a C++ project I need to build with libc++. Can someone point me in the right direction for compiling the libessentia binary against libc++ (and not libstdc++)?
I've compiled/installed all the dependencies for Essentia via Homebrew as instructed in the documentation. Would I need to recompile the dependencies with clang++/libc++ as well?
Sorry for what might be a basic question - this is my first time getting this involved with the compile/link process.
Thanks so much,
S
The text was updated successfully, but these errors were encountered: