I need to upgrade my current iphone app to comply with XCode 4.2. Since then,
XCode impose the linked libraries to be multi-architectured .
The VocalKit package delivered me libpocketsphinx.a and libsphinxbase.a which
were multi-architectured. But I still didn't find the libsphinxad.a that comes
with the SphinxBase compilation. I just do need this as I don't want to
rewrite my program with another package such as openears.
I tried to recompile the sphinxbase package with the build_for_iphone.sh
script but it is not possible to get it for armv7.
So, I'm stuck...
Is there anyone out there able to help me ?
Thanks in advance,
Harold
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In fact my primary interest is to get the libsphinxad.a file compatible with
meaning that if someone already compiled the sphinxbase to make it working
with XCode 3.2, this library should have been generated again... And my
problem is solved.
Regarding my own trial to compile the sphinxbase 0.7, I used a file called
build_for_iphone.sh that used to be delivered with 0.6 package. However this
script was appropriate only for armv6. And in the end, I couldn't get the
armv7 library.
To make it run:
1) I clean
2) I launch a script from within the XCode organizer
./autogen.sh
./build_for_iphone.sh
That work to create an armv6 compatible library but not a one. Changing the
parameter of the build_for_iphone.sh from armv6 to armv7 doesn't work either.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You might maybe read more about IPhone build process and multiarchitecture
binary in google.
You need to build two versions - for armv6 and for armv7. To build for armv6
you need to use build_for_iphone.sh script. To build for armv7 you need to
change armv6 to only armv7 in the script and run build from clean source
(don't forget to run make clean). Then you need to combine both libraries
using lipo tool provided with SDK:
Hi,
I need to upgrade my current iphone app to comply with XCode 4.2. Since then,
XCode impose the linked libraries to be multi-architectured .
The VocalKit package delivered me libpocketsphinx.a and libsphinxbase.a which
were multi-architectured. But I still didn't find the libsphinxad.a that comes
with the SphinxBase compilation. I just do need this as I don't want to
rewrite my program with another package such as openears.
I tried to recompile the sphinxbase package with the build_for_iphone.sh
script but it is not possible to get it for armv7.
So, I'm stuck...
Is there anyone out there able to help me ?
Thanks in advance,
Harold
Hello
If you have some specific problems with compilation you need to describe them
better in order to let us help you.
Hi thanks a lot for your reply.
In fact my primary interest is to get the libsphinxad.a file compatible with
meaning that if someone already compiled the sphinxbase to make it working
with XCode 3.2, this library should have been generated again... And my
problem is solved.
Regarding my own trial to compile the sphinxbase 0.7, I used a file called
build_for_iphone.sh that used to be delivered with 0.6 package. However this
script was appropriate only for armv6. And in the end, I couldn't get the
armv7 library.
Here is the build for iphone.sh:
Disallow undefined variables
set -u
default_gcc_version=4.2
default_iphoneos_version=4.3
default_macos_version=10.6.8
GCC_VERSION="${GCC_VERSION:-$default_gcc_version}"
export IPHONEOS_DEPLOYMENT_TARGET="${IPHONEOS_DEPLOYMENT_TARGET:-$default_ipho
neos_version}"
export
MACOSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET:-$default_macos_version}"
usage ()
{
cat >&2 << EOF
Usage: ${0##*/} target
-h Print help message
-p Installation prefix (default: \$HOME/Developer/Platforms/...)
-t Use 16-bit Thumb instruction set (instead of 32-bit ARM)
The target must be "device" or "simulator". Any additional arguments
are passed to configure.
The following environment variables affect the build process:
GCC_VERSION (default: $default_gcc_version)
IPHONEOS_DEPLOYMENT_TARGET (default: $default_iphoneos_version)
MACOSX_DEPLOYMENT_TARGET (default: $default_macos_version)
EOF
}
while getopts ":hp:t" opt; do
case $opt in
h ) usage ; exit 0 ;;
p ) prefix="$OPTARG" ;;
t ) thumb_opt=thumb ;;
\? ) usage ; exit 2 ;;
esac
done
shift $(( $OPTIND - 1 ))
if (( $# < 1 )); then
usage
exit 2
fi
target=$1
shift
case $target in
device )
arch=armv6 armv7
platform=iPhoneOS
extra_cflags="-m${thumb_opt:-no-thumb} -mthumb-interwork"
;;
simulator )
arch=i386
platform=iPhoneSimulator
extra_cflags="-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IPHONEOS_DEPLOYMENT_TARGET%
%.*}0000"
;;
usage
exit 2
esac
platform_dir="/Developer/Platforms/${platform}.platform/Developer"
platform_bin_dir="${platform_dir}/usr/bin"
platform_sdk_dir="${platform_dir}/SDKs/${platform}${IPHONEOS_DEPLOYMENT_TARGET
}.sdk"
prefix="${prefix:-${HOME}${platform_sdk_dir}}"
export CC="${platform_bin_dir}/gcc-${GCC_VERSION}"
export CFLAGS="-arch ${arch} -pipe -Os -gdwarf-2 -isysroot ${platform_sdk_dir}
${extra_cflags}"
export LDFLAGS="-arch ${arch} -isysroot ${platform_sdk_dir}"
export CXX="${platform_bin_dir}/g++-${GCC_VERSION}"
export CXXFLAGS="${CFLAGS}"
export CPP="/Developer/usr/bin/cpp-${GCC_VERSION}"
export CXXCPP="${CPP}"
./configure \
--prefix="${prefix}" \
--host="${arch}-apple-darwin" \
--disable-shared \
--enable-static \
"$@" || exit
make install || exit
cat >&2 << EOF
Build succeeded! Files were installed in
$prefix
EOF
To make it run:
1) I clean
2) I launch a script from within the XCode organizer
./autogen.sh
./build_for_iphone.sh
That work to create an armv6 compatible library but not a one. Changing the
parameter of the build_for_iphone.sh from armv6 to armv7 doesn't work either.
In the script one should read:
arch=armv6 to make it run
arch=armv6 armv7 does not work !
And also:
./autogen.sh
./build_for_iphone.sh device
(Sorry but the editor is too short to proofread correctly before submitting
...)
You might maybe read more about IPhone build process and multiarchitecture
binary in google.
You need to build two versions - for armv6 and for armv7. To build for armv6
you need to use build_for_iphone.sh script. To build for armv7 you need to
change armv6 to only armv7 in the script and run build from clean source
(don't forget to run make clean). Then you need to combine both libraries
using lipo tool provided with SDK:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPag
es/man1/lipo.1.html
Well, I thought I had tried with armv7 as parameters without success (I'm sure
I did it !). I did it again today and it worked ... I'm so ashamed !
In the end I decided to release a version for armv7 only, even though it
should be targeted from 4.3 iOS.
Everything worked as expected. I'm glad :o)
Thank you so much for your help.