Is it possible to use "fetch webrtc" to get an older webrtc revision (maybe with some flag/option ) and then compile it for arm64?
I tried pulling an older revision with gclient sync --force -r 6881, but got an error while compiling.
I know its kind of an old revision but, still, if possible I would like to compile that specific one for arm64.
This is what i did:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH":`pwd`/depot_tools
gclient config http://webrtc.googlecode.com/svn/trunk
echo "target_os = ['ios']" >> .gclient
export GYP_DEFINES="OS=ios"
gclient sync --force -r 6881
This is pulling the correct trunk (running 'svn checkout http://webrtc.googlecode.com/svn/trunk#6881...)
export GYP_CROSSCOMPILE=1
export GYP_DEFINES=“build_with_libjingle=1 clang=1 component=static_library dcheck_always_on=1 fastbuild=0 OS=ios target_arch=arm64 target_subarch=arm64”
export GYP_GENERATOR_FLAGS=“output_dir=out_ios64"
export GYP_GENERATORS=“ninja"
cd trunk
gclient runhooks
ninja -C out_ios64/Release-iphoneos AppRTCDemo
i got this error:
Admins-Mac-mini:trunk admin$ ninja -C out_ios64/Release-iphoneos AppRTCDemo
ninja: Entering directory `out_ios64/Release-iphoneos'
[206/1912] CXX obj/third_party/libyuv/source/libyuv.scale_argb.o
FAILED: c++ -MMD -MF obj/third_party/libyuv/source/libyuv.scale_argb.o.d -DV8_DEPRECATION_WARNINGS -DBLINK_SCALE_FILTERS_AT_RECORD_TIME -DDISABLE_NACL -DCHROMIUM_BUILD -DCR_CLANG_REVISION=214024 -DUSE_LIBJPEG_TURBO=1 -DENABLE_CONFIGURATION_POLICY -DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDCHECK_ALWAYS_ON=1 -DENABLE_EGLIMAGE=1 -DCLD_VERSION=1 -DENABLE_SPELLCHECK=1 -DDISABLE_FTP_SUPPORT=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DNS_BLOCK_ASSERTIONS=1 -Igen -I../../third_party/libyuv/include -I../../third_party/libyuv -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -Os -gdwarf-2 -fvisibility=hidden -Wnewline-eof -miphoneos-version-min=6.0 -arch arm64 -Wendif-labels -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wno-unknown-warning-option -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -std=gnu++0x -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -fno-threadsafe-statics -fno-slp-vectorize -fcolor-diagnostics -c ../../third_party/libyuv/source/scale_argb.cc -o obj/third_party/libyuv/source/libyuv.scale_argb.o
../../third_party/libyuv/source/scale_argb.cc:150:26: error: assigning to 'void (*)(const uint8 *, ptrdiff_t, int, uint8 *, int)' from incompatible type 'void (const uint8 *, int, int, uint8 *, int)': type mismatch at 2nd parameter ('ptrdiff_t' (aka 'long') vs 'int')
ScaleARGBRowDownEven = filtering ? ScaleARGBRowDownEvenBox_NEON :
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[206/1912] LINK libvpx_obj_int_extract, POSTBUILDS
ninja: build stopped: subcommand failed.
I think I'm missing some dependencies (maybe because its an old trunk) but not sure.
Also for ios target_arch=armv7 it compiles fine.
Any help would be great,
Thanks
UPDATE:
Pulling a slightly newer revision (r6915) didn't help:
There is still some error with libvpx library
[58/1912] CXX obj/third_party/libyuv/source/libyuv.scale_argb.o
FAILED: c++ -MMD -MF obj/third_party/libyuv/source/libyuv.scale_argb.o.d -DV8_DEPRECATION_WARNINGS -DDISABLE_NACL -DCHROMIUM_BUILD -DCR_CLANG_REVISION=214024 -DUSE_LIBJPEG_TURBO=1 -DENABLE_CONFIGURATION_POLICY -DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDCHECK_ALWAYS_ON=1 -DENABLE_EGLIMAGE=1 -DCLD_VERSION=1 -DENABLE_SPELLCHECK=1 -DDISABLE_FTP_SUPPORT=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DNS_BLOCK_ASSERTIONS=1 -Igen -I../../third_party/libyuv/include -I../../third_party/libyuv -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -Os -gdwarf-2 -fvisibility=hidden -Wnewline-eof -miphoneos-version-min=7.0 -arch arm64 -Wendif-labels -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wno-unknown-warning-option -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -std=gnu++0x -stdlib=libstdc++ -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -fno-threadsafe-statics -fno-slp-vectorize -fcolor-diagnostics -c ../../third_party/libyuv/source/scale_argb.cc -o obj/third_party/libyuv/source/libyuv.scale_argb.o
../../third_party/libyuv/source/scale_argb.cc:150:26: error: assigning to 'void (*)(const uint8 *, ptrdiff_t, int, uint8 *, int)' from incompatible type 'void (const uint8 *, int, int, uint8 *, int)': type mismatch at 2nd parameter ('ptrdiff_t' (aka 'long') vs 'int')
ScaleARGBRowDownEven = filtering ? ScaleARGBRowDownEvenBox_NEON :
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[58/1912] LINK libvpx_obj_int_extract, POSTBUILDS
ninja: build stopped: subcommand failed.
UPDATE 2:
As it turns out (for now) arm64 build is only possible for the following environment:
OS X Version 10.9.5
Xcode Version: 6.1.1
So this morning I tried to pull and build latest release (at that time - r8053) following instructions from http://www.webrtc.org/native-code/ios
and it seemed to build OK except for 2 warnings:
1622/2019] CC obj/chromium/src/net/third_party/nss/ssl/libssl.sslmutex.o
../../chromium/src/net/third_party/nss/ssl/sslmutex.c:522:14: warning: 'sem_init' is deprecated [-Wdeprecated-declarations]
rv = sem_init(&pMutex->u.sem, shared, 1);
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/semaphore.h:55:5: note: 'sem_init' has been explicitly marked deprecated here
int sem_init(sem_t *, int, unsigned int) __deprecated;
^
../../chromium/src/net/third_party/nss/ssl/sslmutex.c:544:7: warning: 'sem_destroy' is deprecated [-Wdeprecated-declarations]
rv = sem_destroy(&pMutex->u.sem);
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/semaphore.h:53:5: note: 'sem_destroy' has been explicitly marked deprecated here
int sem_destroy(sem_t *) __deprecated;
^
2 warnings generated.
[2019/2019] STAMP AppRTCDemo.app
but for old revision, still can't build arm64 libraries (some error regarding libyuv when building)
so my questions are:
is it at all possible to build arm64 libraries for revisions from a few months back such as 6881???
How to fetch older revision with the new fetch method ?
Thank you
Related
I am building with Clang 9.0.0 and linking with the ld.lld linker
clang++.exe -Wall -fexceptions -m64 -O3 -Xclang -flto-visibility-public-std -std=c++2a -flto=thin -c
I:\Cpp\hello_boost\hello_codeblocks_world\hello_codeblocks_world.cpp -o obj\release\hello_codeblocks_world.o
clang++.exe -o bin\release\hello_codeblocks_world.exe obj\release\hello_codeblocks_world.o -m64 -fuse-ld=lld --strip-all
but, unlike when using the usual GCC linker LD, this option (--strip-all or -s) is not recognized
clang++: error: unsupported option '--strip-all' (or similarly with -s)
Can anyone suggest what I should be doing to strip symbols?
(My release-mode hello_world.exe size is 15 kb for GC but 230 kB for Clang :-( and this is likely to have some adverse effects for no benefit).
Is this not an option for ld.lld ?
Thanks
You might want to use:
-Xlinker --strip-all
You can use this to supply system-specific linker options that GCC does not recognize (gcc manual)
https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
I'm attempting to set-up CI for our Xcode cross-compiles. The cross-compiles test both ARMv7 and ARMv8. Things look good except when it comes time to link for ARMv8:
clang++ -DNDEBUG -g2 -O3 -fPIC -pipe -Wall -miphoneos-version-min=7 -arch arm64 \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk \
-stdlib=libc++ -c cryptlib.cpp
clang++ -DNDEBUG -g2 -O3 -fPIC -pipe -Wall -miphoneos-version-min=7 -arch arm64 \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk \
-stdlib=libc++ -c cpu.cpp
...
clang++ -o cryptest.exe -DNDEBUG -g2 -O3 -fPIC -pipe -Wall -miphoneos-version-min=7 -arch arm64 \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk \
-stdlib=libc++ test.o bench1.o bench2.o ... ./libcryptopp.a
Undefined symbols for architecture arm64:
"CryptoPP::CRC32_Update_ARMV8(unsigned char const*, unsigned long, unsigned int&)", referenced from:
CryptoPP::CRC32::Update(unsigned char const*, unsigned long) in libcryptopp.a(crc.o)
"CryptoPP::CRC32C_Update_ARMV8(unsigned char const*, unsigned long, unsigned int&)", referenced from:
CryptoPP::CRC32C::Update(unsigned char const*, unsigned long) in libcryptopp.a(crc.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [cryptest.exe] Error 1
We obviously don't run the output artifact cryptest.exe. We just compile and link to test things.
The code has been testing fine under LLVM Clang.
All ARMv8/Aarch64 machines have CRC-32 and CRC-32C; but the Crypto extensions are optional. The error does not make much sense.
Does Clang lack CRC32 for ARMv8/Aarch64?
Below is the code that's causing the errors.
#if defined(__ARM_FEATURE_CRC32)
void CRC32_Update_ARMV8(const uint8_t *s, size_t n, uint32_t& c)
{
for(; !IsAligned<uint32_t>(s) && n > 0; s++, n--)
c = __crc32b(c, *s);
for(; n > 4; s+=4, n-=4)
c = __crc32w(c, *s);
for(; n > 0; s++, n--)
c = __crc32b(c, *s);
}
#endif
Under Xcode 8.3.3, I came across the compile error at __crc32*(). Then I added the command line switch
-march=armv8-a+crc
as found at this link, then the code compiles well. I tested with iphone7+/iOS10.3.1 and it's working.
Note according to ARM's document ("ARM® Architecture Reference Manual
ARMv8, for ARMv8-A architecture profile" DDI0487B_a_armv8_arm.pdf: page A1-58), crc32 instructions are optional for v8 and mandatory for v8.1. When I ran the same program on iphone6+/iOS9.3.3, it crashed at __crc32*(). I also verified it with inline assembler. To avoid the crash, therefore, some kind of run-time check is necessary. I don't fully understand how, but as a last resort, we could use the model names.
I'm trying to build a static cryptopp library for ios. I'm basing my steps from these sites:
http://cryptopp.com/wiki/IOS_(Command_Line)#Xcode_Project
https://github.com/noloader/cryptopp-5.6.2-ios
https://www.cryptopp.com/
1.) I downloaded the latest cryptopp version 5.6.3
2.) I downloaded noloader's cryptopp-5.6.2-ios becasue it has updated:
setenv-ios.sh - i had to edit this to search for sdk 9.2
GNUmakefile
config.h
build-for-ios.sh
3.) I copied the four files to my cryptopp 5.6.3 directory and replaced GNUmakefile and config.h
4.) I checked out IOS_Command_Line instruction to invoke setenv-ios.sh first.
5.) Then, as noloader said, run build-for-ios.sh.
However, i'm getting this error:
Has anyone successfully built the library using the latest ios SDK and cryptopp version? If so, can you please point me to the right direction. Thanks.
The documentation was not correct under IOS (Command Line) | Build the Library. After setting the environment with setenv-ios.sh, you should use GNUmakefile-cross:
$ make -f GNUmakefile-cross static dynamic cryptest.exe
clang++ -DNDEBUG -g2 -Os -fPIC -pipe -Wall -Wno-delete-non-virtual-dtor -arch armv7 -isysroot
/Applications/Xcode-5_1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-stdlib=libc++ -c cryptlib.cpp
clang++ -DNDEBUG -g2 -Os -fPIC -pipe -Wall -Wno-delete-non-virtual-dtor -arch armv7 -isysroot
/Applications/Xcode-5_1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-stdlib=libc++ -c cpu.cpp
clang++ -DNDEBUG -g2 -Os -fPIC -pipe -Wall -Wno-delete-non-virtual-dtor -arch armv7 -isysroot
/Applications/Xcode-5_1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-stdlib=libc++ -c 3way.cpp
...
I thought we updated the iOS procedures when we updated the Android procedures. I'm not sure what went wrong the documentation updates.
We checked in the scripts for setenv-ios.sh, setenv-android.sh and setenv-embedded.sh in March 2016. GNUmakefile-cross was already in the library. Also see Commit a78b9dfa0840f92f, Added iOS environment and test script and Commit 22d6374ce7151ad0, Added Android and embedded environment and test script.
All you should need to do now is the following:
git clone https://github.com/weidai11/cryptopp.git
cd cryptopp
. ./setenv-ios.sh
make -f GNUmakefile-cross static dynamic cryptest.exe
...
The new/updated files will be available in the ZIP at the next Crypto++ release, which will be either 5.6.4 or 5.7.0.
Here is part of my compilation result:
===============================================================================
You are ready to build VLC and its contribs
make: '.gas' is up to date.
[info] Building contrib for iOS in '/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/iPhoneOS-arm64'
[info] LD FLAGS SELECTED = '-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.1'
/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc
error: invalid deployment target '5.1.0' for architecture 'arm64' (requires
'7.0.0' or later)
1 error generated.
make: Nothing to be done for `fetch'.
error: invalid deployment target '5.1.0' for architecture 'arm64' (requires
'7.0.0' or later)
1 error generated.
sed -i.orig s/-ansi// freetype/builds/unix/configure
cd freetype && GNUMAKE=make CC="xcrun clang" CXX="xcrun clang++" LD="xcrun ld" AR="xcrun ar" CCAS="gas-preprocessor.pl xcrun clang -c" RANLIB="xcrun ranlib" STRIP="xcrun strip" PATH="/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/bin:/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/extras/tools/build/bin:/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/extras/tools/build/bin:/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" CPPFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -arch arm64 -miphoneos-version-min=5.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -I/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/include" CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -arch arm64 -miphoneos-version-min=5.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -I/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/include -g" CXXFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -arch arm64 -miphoneos-version-min=5.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -arch arm64 -miphoneos-version-min=5.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch arm64 -miphoneos-version-min=5.1 -O3 -g -I/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/include -g -I/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/include -g" LDFLAGS="-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.1 -arch arm64 -miphoneos-version-min=5.1 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=5.1 -L/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64/lib" ./configure --without-png --prefix="/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64" --build="arm-apple-darwin11" --host="x86_64-apple-darwin11" --target="x86_64-apple-darwin11" --program-prefix="" --enable-static --disable-shared --disable-dependency-tracking --with-pic
FreeType build system -- automatic system detection
The following settings are used:
platform unix
compiler xcrun clang
configuration directory ./builds/unix
configuration rules ./builds/unix/unix.mk
If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.
Otherwise, simply type `make' again to build the library,
or `make refdoc' to build the API reference (the latter needs python).
cd builds/unix; /bin/sh ./configure '--without-png' '--prefix=/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64' '--build=arm-apple-darwin11' '--host=x86_64-apple-darwin11' '--target=x86_64-apple-darwin11' '--program-prefix=' '--enable-static' '--disable-shared' '--disable-dependency-tracking' '--with-pic'
configure: WARNING: unrecognized options: --disable-dependency-tracking
checking build system type... arm-apple-darwin11
checking host system type... x86_64-apple-darwin11
checking for x86_64-apple-darwin11-gcc... xcrun clang
checking whether the C compiler works... no
configure: error: in `/Users/nikhil.t/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/iPhoneOS-arm64/freetype/builds/unix':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [setup] Error 77
make: *** [.freetype2] Error 2
===================================================================
I am using guideline provided by VLC
I tried to change the xcrun path in build.sh (ImportedSources/vlc/extras/package/ios/build.sh) but it resets to original once I build the script.
Is there another way I could change this, so that c compiler works for me?
I am stuck on this for the last 9 days, please provide some guidance.
Thanks,
Albin.K.J
The first error is:
error: invalid deployment target '5.1.0' for architecture 'arm64' (requires
'7.0.0' or later)
... so I would suggest trying what it suggests: bumping the deployment target up from 5.1.0 to 7.0.0, or remove arm64 support.
May be wrong compiler path.
Check the CC points to the correct path also it is as expected in the script file.
I also have the same issue, setting CC correctly did the trick for me.
The required compilers are missing from your system. You need both a C++ compiler and a C compiler.
You can install the compilers (GCC and G++) using apt-get install gcc g++.
VAMP Plugins by Queen Mary University of London is an amazing collection of BSD licensed software. All these plugins are at the basis of the Sonic Visualizer software
A plug Sdk to build plugins is available as well.
You can build the plugins for OSX / Linux / Win32 targets.
Queen Mart University explain well here the plugin architecture and how to build for different platforms specified above.
A Java version, jVamp is available as well. A Python wrapper also.
But, how to build for the iOS platform ?
So, I tried porting the Makefile to the iOS.
First I changed the file
build/osx/Makefile.osx
in this way:
CFLAGS := -O3 -ftree-vectorize -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch x86_64 -I../vamp-plugin-sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/ -DUSE_PTHREADS
CXXFLAGS := $(CFLAGS)
LDFLAGS := -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch x86_64 -lqm-dsp ../vamp-plugin-sdk/libvamp-sdk.a -framework Accelerate -lpthread -exported_symbols_list=vamp-plugin.list -install_name qm-vamp-plugins.a
PLUGIN_EXT := .a
include build/general/Makefile.inc
Then build
macbookproloreto:qm-vamp-plugins loreto$ make -f build/osx/Makefile.osx
cc -O3 -ftree-vectorize -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch x86_64 -I../vamp-plugin-sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/ -DUSE_PTHREADS -I. -I../qm-dsp -c -o g2cstubs.o g2cstubs.c
c++ -O3 -ftree-vectorize -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch x86_64 -I../vamp-plugin-sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/ -DUSE_PTHREADS -I. -I../qm-dsp -c -o plugins/AdaptiveSpectrogram.o plugins/AdaptiveSpectrogram.cpp
In file included from plugins/AdaptiveSpectrogram.cpp:15:
In file included from plugins/AdaptiveSpectrogram.h:18:
In file included from ../vamp-plugin-sdk/vamp-sdk/Plugin.h:40:
In file included from /usr/bin/../lib/c++/v1/string:430:
In file included from /usr/bin/../lib/c++/v1/iosfwd:90:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/wchar.h:70:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/_types.h:27:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/sys/_types.h:32:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/sys/cdefs.h:655:2: **error: Unsupported
architecture
#error Unsupported architecture
^**
The first issue here is that there is a unsupported architecture.
So the plugins depends on the SDK I had to build that one first:
cd /Users/loreto/Projects/AUDIO/VAMP/vamp-plugin-sdk
make -f build/Makefile.osx
Different errors occurred since I had no OGG/VORBIS library and no LOGG library. So I slightly modified the Makefile.osx removing these dependencies in the HOST_LIB flags. I had to keep libsndfile anyway:
HOST_LIBS = ./libvamp-hostsdk.a -L../10.8/inst/lib -lsndfile -ldl
So I was able to build the static libraries here:
macbookproloreto:vamp-plugin-sdk loreto$ ls -l *.a
-rw-r--r-- 1 loreto staff 709840 17 Ott 23:56 libvamp-hostsdk.a
-rw-r--r-- 1 loreto staff 183720 17 Ott 23:56 libvamp-sdk.a
Of course these static libs are targeted to arch x86_64 so I need to add armv7 arch:
ARCHFLAGS = -mmacosx-version-min=$(MINVERSION) -arch x86_64 -arch armv7
Then make clean and compile again
macbookproloreto:vamp-plugin-sdk loreto$ make -f build/Makefile.osx clean
macbookproloreto:vamp-plugin-sdk loreto$ make -f build/Makefile.osx
c++ -mmacosx-version-min=10.8 -arch x86_64 -arch armv7 -O2 -Wall -I. -I../10.8/inst/include -fPIC -c -o src/vamp-sdk/PluginAdapter.o src/vamp-sdk/PluginAdapter.cpp
In file included from src/vamp-sdk/PluginAdapter.cpp:37:
In file included from ./vamp-sdk/PluginAdapter.h:40:
In file included from /usr/include/c++/4.2.1/map:64:
In file included from /usr/include/c++/4.2.1/bits/stl_tree.h:68:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:65:
In file included from /usr/include/c++/4.2.1/bits/c++config.h:41:
In file included from /usr/include/c++/4.2.1/bits/os_defines.h:61:
In file included from /usr/include/unistd.h:71:
In file included from /usr/include/_types.h:27:
In file included from /usr/include/sys/_types.h:33:
/usr/include/machine/_types.h:34:10: fatal error: 'arm/_types.h' file not found
#include "arm/_types.h"
^
1 error generated.
make: *** [src/vamp-sdk/PluginAdapter.o] Error 1
Type definitions for arm was not found! The problem here is that the right path was
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/arm/_types.h
Ok let's fix this in the Makefile.osx again:
ARCHFLAGS = -mmacosx-version-min=$(MINVERSION) -arch armv7
CFLAGS = $(ARCHFLAGS) -fPIC --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/
CXXFLAGS = $(ARCHFLAGS) -O2 -Wall -I. -fPIC
CPPFLAGS ="-pipe -no-cpp-precomp -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk
then make the static targets:
make -f build/Makefile.osx sdkstatic
Wow it worked! I have a vamp host sdk .a for iOS! (I suppose to have let's say)
macbookproloreto:vamp-plugin-sdk loreto$ ls -l *.a
-rw-r--r-- 1 loreto staff 301176 18 Ott 00:35 libvamp-hostsdk.a
-rw-r--r-- 1 loreto staff 76024 18 Ott 00:35 libvamp-sdk.a
Ok but let's check with otool, since you never know:
macbookproloreto:vamp-plugin-sdk loreto$ otool -hv libvamp-sdk.a
Archive : libvamp-sdk.a
libvamp-sdk.a(PluginAdapter.o):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC ARM V7 0x00 OBJECT 4 1128 SUBSECTIONS_VIA_SYMBOLS
libvamp-sdk.a(RealTime.o):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC ARM V7 0x00 OBJECT 4 1060 SUBSECTIONS_VIA_SYMBOLS
libvamp-sdk.a(FFT.o):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC ARM V7 0x00 OBJECT 4 584 SUBSECTIONS_VIA_SYMBOLS
libvamp-sdk.a(acsymbols.o):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC ARM V7 0x00 OBJECT 3 500 SUBSECTIONS_VIA_SYMBOLS
Ok, that's the armv7 architecture.
Now, back to the plugins sdk again and change the
build/osx/Makefile.osx
as follows:
CFLAGS := -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/ -DUSE_PTHREADS
CXXFLAGS := $(CFLAGS)
include build/general/Makefile.inc
Ok back again and make:
macbookproloreto:dsp loreto$ make -f build/osx/Makefile.osx
Boom! Another problem:
/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/ -DUSE_PTHREADS -I. -c -o dsp/wavelet/Wavelet.o dsp/wavelet/Wavelet.cpp
cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/ -DUSE_PTHREADS -I. -c -o hmm/hmm.o hmm/hmm.c
hmm/hmm.c:21:10: fatal error: 'clapack.h' file not found
#include <clapack.h> /* LAPACK for matrix inversion */
^
1 error generated.
make: *** [hmm/hmm.o] Error 1
macbookproloreto:dsp loreto$ vi build/osx/Makefile.osx
LAPACK not found.
But as for Apple Docs here, Apple introduced LAPACK in the Accelerate.frameworks since iOS4.0!
In fact clapack.h is here:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h
So let's add this somewhere in the ../dsp/build/Makefile.osx
CFLAGS := -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/ -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/ -DUSE_PTHREADS
And now let's make it again, but let me check the arch:
macbookproloreto:dsp loreto$ otool -hv libqm-dsp.a
Archive : libqm-dsp.a
libqm-dsp.a(Pitch.o):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC ARM V7 0x00 OBJECT 4 516 SUBSECTIONS_VIA_SYMBOLS
libqm-dsp.a(Chromagram.o):
Mach header
Sound good! One level back in the plugins folder now and make
In file included from plugins/AdaptiveSpectrogram.cpp:15:
plugins/AdaptiveSpectrogram.h:22:10: fatal error: 'dsp/transforms/FFT.h' file not found
#include <dsp/transforms/FFT.h>
^
1 error generated.
Uhm ok the dsp/ misses the tranforms folder - gosh!
Another error:
clang: error: invalid argument '-install_name qm-vamp-plugins.a' only allowed with '-dynamiclib'
make: *** [qm-vamp-plugins.a] Error 1
Let's fix again the Makefile.osx:
CFLAGS := -O3 -ftree-vectorize -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch armv7 -I../vamp-plugin-sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/ -DUSE_PTHREADS
CXXFLAGS := $(CFLAGS)
LDFLAGS := -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch armv7 -lqm-dsp ../vamp-plugin-sdk/libvamp-sdk.a -framework Accelerate -lpthread
Ok, now the error is architecture undefined symbol errors: to long look at the gist here
like:
"std::cerr", referenced from:
"typeinfo for std::istream", referenced from:
"std::ostream::put(char)""
std::ostream::operator<<(int)",
This reminds me to the boost C++ libraries!
So I need to get boost, compile for iOS then include it in the Makefile and it should work, isn't it ? This could take long...
So do this by now
macbookproloreto:vamp-plugin-sdk loreto$ echo $'\360\237\215\272'
After getting boost as iOS framework distribution from here and adding
-I/Users/loreto/Projects/AUDIO/LIBS/boost-ios/Dist/boost.framework/Headers/
I have the same error...uhm I suppose I'm missing the standard C++ library here!
macbookproloreto:Headers loreto$ locate libc++.dylib | grep iPhoneOS7.0
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/libc++.dylib
bingo!
So
-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/libc++.dylib
Error again (doh) !
Tried with no success
-I/usr/lib/libstdc++.dylib
-lstdc++
Stucked on a very simple linking issue.
Again.
macbookproloreto:vamp-plugin-sdk loreto$ echo $'\360\237\215\272'
The most interesting part of the error is the first static library being compiled:
make -f build/osx/Makefile.osx
c++ -o qm-vamp-plugins.a g2cstubs.o plugins/AdaptiveSpectrogram.o plugins/BarBeatTrack.o plugins/BeatTrack.o plugins/DWT.o plugins/OnsetDetect.o plugins/ChromagramPlugin.o plugins/ConstantQSpectrogram.o plugins/KeyDetect.o plugins/MFCCPlugin.o plugins/SegmenterPlugin.o plugins/SimilarityPlugin.o plugins/TonalChangeDetect.o plugins/Transcription.o libmain.o -L../qm-dsp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -arch armv7 -lqm-dsp ../vamp-plugin-sdk/libvamp-sdk.a -framework Accelerate -lpthread
Undefined symbols for architecture armv7:
"std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const", referenced from:
_VampPlugin::Vamp::RealTime::toString() const in libvamp-sdk.a(RealTime.o)
_VampPlugin::Vamp::RealTime::toText(bool) const in libvamp-sdk.a(RealTime.o)
"std::basic_ios<char, std::char_traits<char> >::widen(char) const", referenced from:
_VampPlugin::Vamp::PluginAdapterBase::Impl::getDescriptor() in libvamp-sdk.a(PluginAdapter.o)
Here we can see that one of the static library compiled does not contain the right architecture.
I have two static libraries here:
lqm-dsp ../vamp-plugin-sdk/libvamp-sdk.a
If I run otool on that I can see that the cpu time is ARM7 for both of them:
macbookproloreto:qm-vamp-plugins loreto$ otool -hv ../vamp-plugin-sdk/libvamp-sdk.a
Archive : ../vamp-plugin-sdk/libvamp-sdk.a
../vamp-plugin-sdk/libvamp-sdk.a(PluginAdapter.o):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC ARM V7 0x00 OBJECT 4 1128 SUBSECTIONS_VIA_SYMBOLS
So what's the matter with Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/libc++.dylib ?
Try commenting in the code the usage of the standard libraries.
It's probably only used for debug.