From 6e7425c8d63ed4ea1b86c65d782b237d0358a30d Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 10 Feb 2010 18:46:05 +0000 Subject: Ticket #1009: Support for IPP 6.1 on Linux git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3097 74dad513-b988-da41-8d7b-12977e46ad98 --- aconfigure | 120 +++++++++++++++++++++++++++++++++++++++++++--------------- aconfigure.ac | 86 ++++++++++++++++++++++++++++++----------- 2 files changed, 154 insertions(+), 52 deletions(-) diff --git a/aconfigure b/aconfigure index 0f582b2d..a28cd0b4 100755 --- a/aconfigure +++ b/aconfigure @@ -703,7 +703,9 @@ enable_speex_codec enable_ilbc_codec enable_libsamplerate enable_ipp -enable_ipp_samples +with_ipp +with_ipp_samples +with_ipp_arch enable_ssl ' ac_precious_vars='build_alias @@ -1356,8 +1358,6 @@ Optional Features: package and samples location using IPPROOT and IPPSAMPLES env var or with --with-ipp and --with-ipp-samples options - --with-ipp=DIR Specify the Intel IPP location - --with-ipp-samples=DIR Specify the Intel IPP samples location --disable-ssl Exclude SSL support the build (default: autodetect) @@ -1379,6 +1379,10 @@ Optional Packages: set, make sure that PortAudio is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths) + --with-ipp=DIR Specify the Intel IPP location + --with-ipp-samples=DIR Specify the Intel IPP samples location + --with-ipp-arch=ARCH Specify the Intel IPP ARCH suffix, e.g. "64" or + "em64t" Some influential environment variables: CC C compiler command @@ -5637,24 +5641,36 @@ else fi -# Check whether --enable-ipp was given. -if test "${enable_ipp+set}" = set; then : - enableval=$enable_ipp; + +# Check whether --with-ipp was given. +if test "${with_ipp+set}" = set; then : + withval=$with_ipp; else with_ipp=no fi -# Check whether --enable-ipp-samples was given. -if test "${enable_ipp_samples+set}" = set; then : - enableval=$enable_ipp_samples; + +# Check whether --with-ipp-samples was given. +if test "${with_ipp_samples+set}" = set; then : + withval=$with_ipp_samples; else with_ipp_samples=no fi + +# Check whether --with-ipp-arch was given. +if test "${with_ipp_arch+set}" = set; then : + withval=$with_ipp_arch; +else + with_ipp_arch=no + +fi + + if test "x$enable_ipp" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP location" >&5 $as_echo_n "checking Intel IPP location... " >&6; } @@ -5674,6 +5690,16 @@ $as_echo "autodetected in $IPPROOT" >&6; } $as_echo "$IPPROOT" >&6; } fi + if test "x$with_ipp_arch" != "xno"; then + IPP_SUFFIX="em64t" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: IPP arch suffix is set to $IPP_SUFFIX" >&5 +$as_echo "IPP arch suffix is set to $IPP_SUFFIX" >&6; } + else + IPP_SUFFIX="" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: IPP arch suffix is set to empty" >&5 +$as_echo "IPP arch suffix is set to empty" >&6; } + fi + if test x$IPPROOT = x; then as_fn_error "the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option" "$LINENO" 5 elif test ! -d $IPPROOT; then @@ -5683,7 +5709,7 @@ $as_echo "$IPPROOT" >&6; } else # IPP directory looks okay. # Remove trailing backslash - IPPROOT=`echo $IPPROOT/ | sed 's/\/$//'` + IPPROOT=`echo $IPPROOT | sed 's/\/$//'` SAVED_CFLAGS="$CFLAGS" SAVED_LDFLAGS="$LDFLAGS" @@ -5691,7 +5717,7 @@ $as_echo "$IPPROOT" >&6; } IPP_CFLAGS="-I$IPPROOT/include" IPP_LDFLAGS="-L$IPPROOT/sharedlib" - IPP_LIBS="-lippsc -lipps -lippsr -lippcore -lguide" + IPP_LIBS="-lippsc${IPP_SUFFIX} -lipps${IPP_SUFFIX} -lippsr${IPP_SUFFIX} -lippcore${IPP_SUFFIX} -lguide" #IPP_LDFLAGS="-L$IPPROOT/sharedlib" #IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore" @@ -5720,8 +5746,9 @@ $as_echo "ok" >&6; } else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "failed -See \`config.log' for more details." "$LINENO" 5; } +{ as_fn_set_status run with --help for more info +as_fn_error "Error: unable to recognize your IPP installation. Make sure the paths and ARCH suffix are set correctly +See \`config.log' for more details." "$LINENO" 5; }; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5759,33 +5786,62 @@ $as_echo "$IPPSAMPLES" >&6; } # Remove trailing backslash IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'` - # Guess the libusc.a build location + # Guess the libusc.a/libspeech.a build location { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC build location" >&5 $as_echo_n "checking Intel IPP USC build location... " >&6; } - IPPSAMPLESLIB=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1` - if test ! -d $IPPSAMPLESLIB; then + if test -d $IPPSAMPLES/speech-codecs/bin; then + IPPVER=5 + IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1` + elif test -d $IPPSAMPLES/speech-codecs/_bin; then + IPPVER=6 + IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib | head -1` + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "unable to find $IPPSAMPLES/speech-codecs/bin/*gcc*/lib or $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib directory. Have you built the samples? +See \`config.log' for more details." "$LINENO" 5; } + fi + + # Test the directory + if test ! -d $IPPSAMP_DIR; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "the $IPPSAMPLES/speech-codecs/bin/*gcc*/lib directory not found. Have you built the samples? +as_fn_error "There's something wrong with this script, directory $IPPSAMP_DIR does not exist See \`config.log' for more details." "$LINENO" 5; } + exit 1; fi - if test ! -f $IPPSAMPLESLIB/libusc.a; then + + if test "x$IPPVER" = "x5"; then + IPPSAMP_LIBS="libusc.a" + IPPSAMP_LDLIBS="-lusc" + elif test "x$IPPVER" = "x6"; then + IPPSAMP_LIBS="libspeech.a" + IPPSAMP_LDLIBS="-lspeech" + else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "libusc.a doesn't exist in $IPPSAMPLESLIB +as_fn_error "bug in this script: unsupported IPP version See \`config.log' for more details." "$LINENO" 5; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPSAMPLESLIB" >&5 -$as_echo "$IPPSAMPLESLIB" >&6; } + + if test ! -f $IPPSAMP_DIR/$IPPSAMP_LIBS; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR +See \`config.log' for more details." "$LINENO" 5; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPSAMP_DIR" >&5 +$as_echo "$IPPSAMP_DIR" >&6; } SAVED_CFLAGS="$CFLAGS" SAVED_LDFLAGS="$LDFLAGS" SAVED_LIBS="$LIBS" - IPPSAMPLESINC="-I$IPPSAMPLES/speech-codecs/core/usc/include" - CFLAGS="$CFLAGS $IPPSAMPLESINC" - LDFLAGS="$LDFLAGS -L$IPPSAMPLESLIB" - LIBS="-lusc $LIBS" + IPPSAMP_INC="-I$IPPSAMPLES/speech-codecs/core/usc/include" + CFLAGS="$CFLAGS $IPPSAMP_INC" + LDFLAGS="$LDFLAGS -L$IPPSAMP_DIR" + LIBS="$IPPSAMP_LDLIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC usability" >&5 $as_echo_n "checking Intel IPP USC usability... " >&6; } @@ -5814,14 +5870,18 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$SAVED_CFLAGS" - LDFLAGS="\$(IPP_LDFLAGS) $SAVED_LDFLAGS" - LIBS="\$(IPP_LIBS) $SAVED_LIBS" + LDFLAGS="$IPP_LDFLAGS $SAVED_LDFLAGS" + LIBS="$IPP_LIBS $SAVED_LIBS" - IPP_CFLAGS="$IPP_CFLAGS $IPPSAMPLESINC" - IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMPLESLIB" - IPP_LIBS="-lusc $IPP_LIBS" + IPP_CFLAGS="$IPP_CFLAGS $IPPSAMP_INC" + IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMP_DIR" + IPP_LIBS="$IPPSAMP_LDLIBS $IPP_LIBS" fi + CFLAGS="$CFLAGS $IPP_CFLAGS" + LDFLAGS="$LDFLAGS $IPP_LDFLAGS" + LIBS="$LIBS $IPP_LIBS" + ac_build_mak_vars="$ac_build_mak_vars\n\ export IPP_CFLAGS=$IPP_CFLAGS\n\ export IPP_LDFLAGS=$IPP_LDFLAGS\n\ diff --git a/aconfigure.ac b/aconfigure.ac index dcc77004..412aea3f 100644 --- a/aconfigure.ac +++ b/aconfigure.ac @@ -667,20 +667,27 @@ AC_ARG_ENABLE(ipp, [enable_ipp=no] ) -AC_ARG_ENABLE(ipp, +AC_ARG_WITH(ipp, AC_HELP_STRING([--with-ipp=DIR], [Specify the Intel IPP location]), [], [with_ipp=no] ) -AC_ARG_ENABLE(ipp-samples, +AC_ARG_WITH(ipp-samples, AC_HELP_STRING([--with-ipp-samples=DIR], [Specify the Intel IPP samples location]), [], [with_ipp_samples=no] ) +AC_ARG_WITH(ipp-arch, + AC_HELP_STRING([--with-ipp-arch=ARCH], + [Specify the Intel IPP ARCH suffix, e.g. "64" or "em64t. Default is blank for IA32"]), + [], + [with_ipp_arch=no] + ) + if test "x$enable_ipp" != "xno"; then dnl # dnl # Verifying Intel IPP path @@ -699,6 +706,14 @@ if test "x$enable_ipp" != "xno"; then AC_MSG_RESULT([$IPPROOT]) fi + if test "x$with_ipp_arch" != "xno"; then + IPP_SUFFIX="em64t" + AC_MSG_RESULT([IPP arch suffix is set to $IPP_SUFFIX]) + else + IPP_SUFFIX="" + AC_MSG_RESULT([IPP arch suffix is set to empty]) + fi + if test x$IPPROOT = x; then AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option]) elif test ! -d $IPPROOT; then @@ -708,7 +723,7 @@ if test "x$enable_ipp" != "xno"; then else # IPP directory looks okay. # Remove trailing backslash - IPPROOT=`echo $IPPROOT/ | sed 's/\/$//'` + IPPROOT=`echo $IPPROOT | sed 's/\/$//'` SAVED_CFLAGS="$CFLAGS" SAVED_LDFLAGS="$LDFLAGS" @@ -716,7 +731,7 @@ if test "x$enable_ipp" != "xno"; then IPP_CFLAGS="-I$IPPROOT/include" IPP_LDFLAGS="-L$IPPROOT/sharedlib" - IPP_LIBS="-lippsc -lipps -lippsr -lippcore -lguide" + IPP_LIBS="-lippsc${IPP_SUFFIX} -lipps${IPP_SUFFIX} -lippsr${IPP_SUFFIX} -lippcore${IPP_SUFFIX} -lguide" #IPP_LDFLAGS="-L$IPPROOT/sharedlib" #IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore" @@ -730,7 +745,7 @@ if test "x$enable_ipp" != "xno"; then ]], [ippStaticInit();])], [AC_MSG_RESULT(ok)], - [AC_MSG_FAILURE(failed)]) + [AC_MSG_FAILURE(Error: unable to recognize your IPP installation. Make sure the paths and ARCH suffix are set correctly, run with --help for more info)]) CFLAGS="$SAVED_CFLAGS" LDFLAGS="$SAVED_LDFLAGS" @@ -763,26 +778,49 @@ if test "x$enable_ipp" != "xno"; then else # Remove trailing backslash IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'` - - # Guess the libusc.a build location + + # Guess the libusc.a/libspeech.a build location AC_MSG_CHECKING([Intel IPP USC build location]) - IPPSAMPLESLIB=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1` - if test ! -d $IPPSAMPLESLIB; then - AC_MSG_FAILURE([the $IPPSAMPLES/speech-codecs/bin/*gcc*/lib directory not found. Have you built the samples?]) + if test -d $IPPSAMPLES/speech-codecs/bin; then + IPPVER=5 + IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1` + elif test -d $IPPSAMPLES/speech-codecs/_bin; then + IPPVER=6 + IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib | head -1` + else + AC_MSG_FAILURE([unable to find $IPPSAMPLES/speech-codecs/bin/*gcc*/lib or $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib directory. Have you built the samples?]) + fi + + # Test the directory + if test ! -d $IPPSAMP_DIR; then + AC_MSG_FAILURE([There's something wrong with this script, directory $IPPSAMP_DIR does not exist]) + exit 1; fi - if test ! -f $IPPSAMPLESLIB/libusc.a; then - AC_MSG_FAILURE([libusc.a doesn't exist in $IPPSAMPLESLIB]) + + if test "x$IPPVER" = "x5"; then + IPPSAMP_LIBS="libusc.a" + IPPSAMP_LDLIBS="-lusc" + elif test "x$IPPVER" = "x6"; then + IPPSAMP_LIBS="libspeech.a" + IPPSAMP_LDLIBS="-lspeech" + else + AC_MSG_FAILURE([bug in this script: unsupported IPP version]) fi - AC_MSG_RESULT([$IPPSAMPLESLIB]) + + if test ! -f $IPPSAMP_DIR/$IPPSAMP_LIBS; then + AC_MSG_FAILURE([$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR]) + fi + + AC_MSG_RESULT([$IPPSAMP_DIR]) SAVED_CFLAGS="$CFLAGS" SAVED_LDFLAGS="$LDFLAGS" SAVED_LIBS="$LIBS" - IPPSAMPLESINC="-I$IPPSAMPLES/speech-codecs/core/usc/include" - CFLAGS="$CFLAGS $IPPSAMPLESINC" - LDFLAGS="$LDFLAGS -L$IPPSAMPLESLIB" - LIBS="-lusc $LIBS" + IPPSAMP_INC="-I$IPPSAMPLES/speech-codecs/core/usc/include" + CFLAGS="$CFLAGS $IPPSAMP_INC" + LDFLAGS="$LDFLAGS -L$IPPSAMP_DIR" + LIBS="$IPPSAMP_LDLIBS $LIBS" AC_MSG_CHECKING([Intel IPP USC usability]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include @@ -792,14 +830,18 @@ if test "x$enable_ipp" != "xno"; then [AC_MSG_FAILURE(failed)]) CFLAGS="$SAVED_CFLAGS" - LDFLAGS="\$(IPP_LDFLAGS) $SAVED_LDFLAGS" - LIBS="\$(IPP_LIBS) $SAVED_LIBS" + LDFLAGS="$IPP_LDFLAGS $SAVED_LDFLAGS" + LIBS="$IPP_LIBS $SAVED_LIBS" - IPP_CFLAGS="$IPP_CFLAGS $IPPSAMPLESINC" - IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMPLESLIB" - IPP_LIBS="-lusc $IPP_LIBS" + IPP_CFLAGS="$IPP_CFLAGS $IPPSAMP_INC" + IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMP_DIR" + IPP_LIBS="$IPPSAMP_LDLIBS $IPP_LIBS" fi + CFLAGS="$CFLAGS $IPP_CFLAGS" + LDFLAGS="$LDFLAGS $IPP_LDFLAGS" + LIBS="$LIBS $IPP_LIBS" + ac_build_mak_vars="$ac_build_mak_vars\n\ export IPP_CFLAGS=$IPP_CFLAGS\n\ export IPP_LDFLAGS=$IPP_LDFLAGS\n\ -- cgit v1.2.3