I cross compile iOS practices:
1.
brew, install, yasm, cmake, WGet, packaging/build_3rdparty_static_debian.sh
2.
Building, lightweight, Essentia, with, reduced, dependencies:./waf, configure, --lightweight=, --fft=ACCELERATE
3.iOS:
./waf, configure, --cross-compile-ios, --lightweight=, --fft=ACCELERATE, --build-static
Is that correct? I have libessentia.a. in the /essentia-master/build/src directory, but how does this libessentia.a static package work in iOS's Xcode project?
I answered this in your other message.
Excuse me. You gave me this project. I saw it on someone else's problem yesterday, but after the download of this project, there was no file in the iOS directory;
Cross compilation of iOS official documents involving less, but there is no system compiler tutorial, do you have any blog or document you want to study, I hope you can let me learn, thank you
I follow the document on the iOS cross compiler command, libessentia.a file in the /build/src directory, the libessentia.a package is generally with a static.H file, is my error allocation process, not playing.H files, or what reason, I hope you can help me to answer, thank you
[PS: I'm not too good the English, if there is no clear expression, please forgive]
Sorry I can't really understand your problem and I am not an iOS developer so I can't really help any more.
You will need to search Google for information on using C++ libraries with iOS.
For example here's a tutorial I found:
https://www.sitepoint.com/using-c-and-c-in-an-ios-app-with-objective-c/
Good luck!
So I think I have hit the same issue as him. I've got the essentia complied with the flags outlined in the guide. But where are the header files that we need to use this library? When using a static library in Xcode, there are some header files which we can use to interface with the library from objective-c. I saw somewhere else on that these are located in /user/local/include/essentia
however I do not see the essentia
directory here. Is there an additional flag needed to generate these?
Well remember to set the prefix flag --prefix= to wherever you want.
After you compile don't forget to run ./waf install. This will install into the location and will install headers into
and the library into:
@carthach thanks so much for the prompt response. I found the headers!
I'm really close, my problem now is that I can't get Xcode to see the c++ stl. argh!
^ my issue there was that I needed to include essential from a .mm file so that Xcode would recognize it as objective-c++
Might need to include libstdc++ as well, I'm not sure. I'm not an iOS programmer I'm afraid! I just compiled it for use with JUCE which allows you to program directly for iOS using C++.
Xcode already knows about libstdc++, it just needs to interpret the file you are using as objective-c++ to know it needs to use it.
So I just tried to sort of copy the example from here: https://github.com/MTG/essentia/blob/master/src/examples/onset_detector.cpp
but I got this error message: libc++abi.dylib: terminating with uncaught exception of type essentia::EssentiaException: Identifier 'MonoLoader' not found in registry...
Are the examples working with an older version of essential or something? Or might I be doing something horribly wrong?
The MonoLoader algorithm is missing if you compiled essentia without ffmpeg
dependency. See the output of wad configure or check build/config.log for
more details.
On Aug 6, 2017 11:27, "willrevl" notifications@github.com wrote:
So I just tried to sort of copy the example from here:
https://github.com/MTG/essentia/blob/master/src/
examples/onset_detector.cppbut I got this error message: libc++abi.dylib: terminating with uncaught
exception of type essentia::EssentiaException: Identifier 'MonoLoader' not
found in registry...Are the examples working with an older version of essential or something?
Or might I be doing something horribly wrong?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/MTG/essentia/issues/620#issuecomment-320495791, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAZARAX4f2LViJjDkDxw5YAEYAX67E4aks5sVYcegaJpZM4ON0ga
.
Yes, seems this is the default for using on iOS, is there an alternative to the MonoLoader algorithm for getting audio data in?
I suppose just read it with audio units then convert to a vector
Another question, my project already depends on ffmpeg, is it possible to do the iOS compile, but include the ffmpeg dependency?
You can specify dependencies to include using the --lightweight flag. For
example, --lightweight=libav will include ffmpeg (build script will search
for it using pkg-config)
On Aug 6, 2017 12:02, "willrevl" notifications@github.com wrote:
Another question, my project already depends on ffmpeg, is it possible to
do the iOS compile, but include the ffmpeg dependency?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/MTG/essentia/issues/620#issuecomment-320497264, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAZARI74b9fxCvdDMxWJK1OzZBNInEh4ks5sVY8qgaJpZM4ON0ga
.
OK, so i've tried building with this flag. However now I am getting this:
./waf configure --cross-compile-ios --lightweight=libav --fft=ACCELERATE --build-static
...
- FFmpeg / libav detected!
- libsamplerate seems to be missing.
The following algorithms will be ignored: ['Resample', 'MonoLoader', 'EqloudLoader', 'EasyLoader']
When I check for libsamplerate:
[Revl] essentia$ brew install libsamplerate
Warning: libsamplerate 0.1.9 is already installed
So I added libsamplerate and the build appeared to include the 'MonoLoader' algorithm. However, now i'm getting:
Undefined symbols for architecture arm64:
"_src_reset", referenced from:
essentia::streaming::Resample::reset() in libessentia.a(resample.cpp.1.o)
"_src_simple", referenced from:
essentia::standard::Resample::compute() in libessentia.a(resample.cpp.1.o)
"_src_process", referenced from:
essentia::streaming::Resample::process() in libessentia.a(resample.cpp.1.o)
"_src_delete", referenced from:
essentia::streaming::Resample::~Resample() in libessentia.a(resample.cpp.1.o)
essentia::streaming::Resample::configure() in libessentia.a(resample.cpp.1.o)
"_src_new", referenced from:
essentia::streaming::Resample::configure() in libessentia.a(resample.cpp.1.o)
"_src_strerror", referenced from:
essentia::standard::Resample::compute() in libessentia.a(resample.cpp.1.o)
essentia::streaming::Resample::process() in libessentia.a(resample.cpp.1.o)
essentia::streaming::Resample::reset() in libessentia.a(resample.cpp.1.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm assuming I need to compile libsamplerate, but I am stuck at getting this compiled for arm64
for the next guy, finally got this working steps where:
./waf configure --cross-compile-ios —lightweight=libav,libsamplerate --fft=ACCELERATE --build-static
This will allow the MonoLoader algorithm and so examples can be copied more easily:
Nice work Will!
I hope I am posting this in the right place, but it looks like this thread is relevant to what I am struggling with. I am currently working on an iOS app in Swift and I have been trying to understand how I can cross compile into iOS and integrate the library into my Swift project. I am new to Essentia, iOS, Swift, and haven't worked with C++ in years, so please excuse me if I seem a little slow on the uptake here.
I successfully ran the ./waf configure --cross-compile-ios --lightweight= --fft=ACCELERATE --build-static
command. It produced a folder called "build" with the following contents:
Inside the src folder I find the following:
It's my understanding that libessentia.a is the compiled C++ library which includes all the object files in the other folders. After reading this article it seems that I would need to include this file in the Build Phases section of my project's configuration file. It also seems that I would need the header (.h) files for Essentia. Now, I ran the ./waf install
command, and I found some header files under /usr/local/include/essentia, however it doesn't look like they are all there to me: I only see matching header files for the contents of the essentia folder, but none for the other three folders under the src folder.
In any case, I added them to my project and linked the library file in the configuration, but I get a build error that says:
ld: library not found for -lessentia
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The method in the article also seems really labor intensive, as it involves creating a wrapper for every method/function you want to use.
I'm really stumped with this. Any help or advice would be greatly appreciated!
Hi @willrevl and @nbranzburg I am the next guys and I am very thankful for your insights on this one, looks like you saved me a lot of time.
Still up to date and working.
Have a great day, gentlemen.
Most helpful comment
The MonoLoader algorithm is missing if you compiled essentia without ffmpeg
dependency. See the output of wad configure or check build/config.log for
more details.
On Aug 6, 2017 11:27, "willrevl" notifications@github.com wrote: