Menu

Erorr Compiling sphinxbase on OSX SnowLeopard

Help
RWin
2011-10-04
2012-09-22
  • RWin

    RWin - 2011-10-04

    **I ran into problems compiling sphinxbase on OSX SnowLeopard 10.6.7. Does enyone have a solution or encountered this problem before?

    First there was an error that ppc was not found. I did some research and found
    out that XCODE 4.0 dropped ppc (thanks Apple) so I installed xcode 3.2.6 and
    xcode 4 together

    I now get past the ppc not found error - but now get the following err when I
    run make:**

    /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pym
    acconfig.h:37:1: warning: this is the location of the previous definition
    sphinxbase.c: In function ‘pyx_pf_10sphinxbase_10NGramModel_get_counts’:
    sphinxbase.c:1717: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: In function ‘__pyx_f_10sphinxbase_9NGramIter_set_iter’:
    sphinxbase.c:2848: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: In function ‘__pyx_pf_10sphinxbase_8HuffCode_decode’:
    sphinxbase.c:4776: warning: passing argument 2 of ‘huff_code_decode_str’ from
    incompatible pointer type
    sphinxbase.c:4776: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: In function ‘__pyx_pf_10sphinxbase_8HuffCode_decode_from_file’:
    sphinxbase.c:5227: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: At top level:
    sphinxbase.c:707: warning: ‘__pyx_doc_10sphinxbase_7LogMath___cinit
    ’ defined
    but not used
    sphinxbase.c:805: warning: ‘pyx_doc_10sphinxbase_7LogMath___dealloc
    defined but not used
    sphinxbase.c:1216: warning: ‘pyx_doc_10sphinxbase_10NGramModel___cinit
    defined but not used
    sphinxbase.c:1491: warning: ‘pyx_doc_10sphinxbase_10NGramModel___dealloc
    defined but not used
    sphinxbase.c:3502: warning: ‘pyx_doc_10sphinxbase_8HuffCode___init
    defined but not used
    In file included from ../include/logmath.h:76,
    from sphinxbase.c:135:
    ../include/sphinx_config.h:38:1: warning: "SIZEOF_LONG" redefined
    In file included from /System/Library/Frameworks/Python.framework/Versions/2.6
    /include/python2.6/Python.h:9,
    from sphinxbase.c:4:
    /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pym
    acconfig.h:37:1: warning: this is the location of the previous definition
    sphinxbase.c: In function ‘pyx_pf_10sphinxbase_10NGramModel_get_counts’:
    sphinxbase.c:1717: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: In function ‘__pyx_f_10sphinxbase_9NGramIter_set_iter’:
    sphinxbase.c:2848: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: In function ‘__pyx_pf_10sphinxbase_8HuffCode_decode’:
    sphinxbase.c:4776: warning: passing argument 2 of ‘huff_code_decode_str’ from
    incompatible pointer type
    sphinxbase.c:4776: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: In function ‘__pyx_pf_10sphinxbase_8HuffCode_decode_from_file’:
    sphinxbase.c:5227: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: At top level:
    sphinxbase.c:707: warning: ‘__pyx_doc_10sphinxbase_7LogMath___cinit
    ’ defined
    but not used
    sphinxbase.c:805: warning: ‘pyx_doc_10sphinxbase_7LogMath___dealloc
    defined but not used
    sphinxbase.c:1216: warning: ‘pyx_doc_10sphinxbase_10NGramModel___cinit
    defined but not used
    sphinxbase.c:1491: warning: ‘pyx_doc_10sphinxbase_10NGramModel___dealloc
    defined but not used
    sphinxbase.c:3502: warning: ‘pyx_doc_10sphinxbase_8HuffCode___init
    defined but not used
    sphinxbase.c: In function ‘pyx_pf_10sphinxbase_10NGramModel_get_counts’:
    sphinxbase.c:1717: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: In function ‘__pyx_f_10sphinxbase_9NGramIter_set_iter’:
    sphinxbase.c:2848: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: In function ‘__pyx_pf_10sphinxbase_8HuffCode_decode’:
    sphinxbase.c:4776: warning: passing argument 2 of ‘huff_code_decode_str’ from
    incompatible pointer type
    sphinxbase.c:4776: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: In function ‘__pyx_pf_10sphinxbase_8HuffCode_decode_from_file’:
    sphinxbase.c:5227: warning: assignment discards qualifiers from pointer target
    type
    sphinxbase.c: At top level:
    sphinxbase.c:707: warning: ‘__pyx_doc_10sphinxbase_7LogMath___cinit
    ’ defined
    but not used
    sphinxbase.c:805: warning: ‘pyx_doc_10sphinxbase_7LogMath___dealloc
    defined but not used
    sphinxbase.c:1216: warning: ‘pyx_doc_10sphinxbase_10NGramModel___cinit
    defined but not used
    sphinxbase.c:1491: warning: ‘pyx_doc_10sphinxbase_10NGramModel___dealloc
    defined but not used
    sphinxbase.c:3502: warning: ‘pyx_doc_10sphinxbase_8HuffCode___init
    defined but not used
    creating build/lib.macosx-10.6-universal-2.6
    gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc -arch
    x86_64 build/temp.macosx-10.6-universal-2.6/sphinxbase.o
    -L../src/libsphinxbase/.libs -lsphinxbase -o
    build/lib.macosx-10.6-universal-2.6/sphinxbase.so
    ld: warning: in ../src/libsphinxbase/.libs/libsphinxbase.dylib, file was built
    for unsupported file format which is not the architecture being linked (i386)
    ld: warning: in ../src/libsphinxbase/.libs/libsphinxbase.dylib, file was built
    for unsupported file format which is not the architecture being linked (ppc)
    touch pymod-build-stamp

    I believe that the warnings are OK and the redefinition of SIZEOF_LONG is OK but the error at the end concerns me:

    gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc -arch
    x86_64 build/temp.macosx-10.6-universal-2.6/sphinxbase.o
    -L../src/libsphinxbase/.libs -lsphinxbase -o
    build/lib.macosx-10.6-universal-2.6/sphinxbase.so
    ld: warning: in ../src/libsphinxbase/.libs/libsphinxbase.dylib, file was built
    for unsupported file format which is not the architecture being linked (i386)
    ld: warning: in ../src/libsphinxbase/.libs/libsphinxbase.dylib, file was built
    for unsupported file format which is not the architecture being linked (ppc)

    Then when I try to run make install I get this error:

    Making install in src
    Making install in libsphinxbase
    Making install in util
    make: Nothing to be done for install-exec-am'. make: Nothing to be done forinstall-data-am'.
    Making install in fe
    make: Nothing to be done for install-exec-am'. make: Nothing to be done forinstall-data-am'.
    Making install in feat
    make: Nothing to be done for install-exec-am'. make: Nothing to be done forinstall-data-am'.
    Making install in lm
    make install-am
    make: Nothing to be done for install-exec-am'. make: Nothing to be done forinstall-data-am'.
    test -z "/usr/local/lib" || ../.././install-sh -c -d "/usr/local/lib"
    /bin/sh ../../libtool --mode=install /usr/bin/install -c 'libsphinxbase.la'
    '/usr/local/lib/libsphinxbase.la'
    libtool: install: /usr/bin/install -c .libs/libsphinxbase.1.dylib
    /usr/local/lib/libsphinxbase.1.dylib
    install: /usr/local/lib/libsphinxbase.1.dylib: Permission denied
    make: *** Error 71
    make: *** Error 2
    make: *** Error 1
    make: *** Error 1
    make: *** Error 1

    **I checked and "../src/libsphinxbase/.libs/libsphinxbase.dylib" exists.

    Tried to change permission on the/usr/local/lib/ and the OXS will not allow me
    to change it.

    I have had no problem installing Sphinx on linux (Fedora 13) but OSX is doing
    some freaky things.

    Anyone have a solution to compiling sphinxbase on OSX?

    I did run the build in the following order:
    make distclean
    ./autogen.sh
    ./configure
    make
    make install

    Thanks for any advice**

     
  • Nickolay V. Shmyrev

    I also recommend you to do "make clean" before switching xcode version.

     
  • Joseph S. Wisniewski

    Nikolay is being "gentle" with his recommendation. I recently upgraded to
    Xcode 4.1, and the "make clean" seems to be mandatory, all over the place,
    sphinx to wx to sox (why does all the cool stuff end in "x"?)

    There's also a permission problem. Pocket installs, by default, in
    /usr/local/bin and /usr/local/lib, and you can't do that at normal user
    privileges, so the last step needs to be...

    sudo make install

     
  • RWin

    RWin - 2011-10-20

    OK I uninstalled XCode 4.0
    Installed XCode 3.2.6 to get ppc
    went to install Xcode 4.0 but could not fined it. Apple only offers only xCode
    4.2 which requires OXS 10.7
    I have OSX10.6.7and do not want to upgrade. I have enough problems here. Don't
    want to add more.
    I decided to NOT to install Xcode 4.x and stayed with xCode 3.2.6

    Set up the following directories:
    /Users/myname/Project/Sphinxtrain
    /Users/myname/Projects/sphinxbase
    /Users/myname/Projects/shpinx3
    /Users/myname/Project/sr (and its sub directories etc and so on) I cpoies the
    'sr' dirwctory from my linux box and it has my test code on it.

    Then I built sphinxtrain, sphinxbase and sphinx3 in that order.
    I also used the '-without-python' argument in the ./configure file command and
    built without python .
    That got around the errors and everything compiled and linked OK

    I then tried to run a small recognition test from my sr directory under the
    'Project' directory:

    perl scripts_pl/make_feats.pl -ctl etc/sr-voicebase_test.fileids - This runs
    without ERROR
    sudo ./scripts_pl/decode/slave.pl - This gives me the following ERROR mesage
    in the command line.

    **Loading a Continuous Model**
    **DEC_CFG_NPART = MODULE: DECODE Decoding using models previously trained
    Aligning results to find error rate
    Open Match File
    word_align.pl failed with error code 65280 at ./scripts_pl/decode/slave.pl
    line 175.

    I checked the logfile in the 'logdir/decode' directory and have the following
    message:

    /Users/myname/Project/sr/bin/sphinx3_decode: line 60: /bin/sed: No such
    file or directory
    /Users/myname/Project/sr/bin/sphinx3_decode: line 64: /bin/sed: No such file
    or directory
    /Users/myname/Project/sr/bin/sphinx3_decode: line 101: cd:
    /home/myoldlinuxusername/tutorial/sphinx3/src/programs: No such file or
    directory
    i686-apple-darwin10-gcc-4.2.1: main_decode.o: No such file or directory
    i686-apple-darwin10-gcc-4.2.1: ../../src/libs3decoder/.libs/libs3decoder.so:
    No such file or directory
    i686-apple-darwin10-gcc-4.2.1: /home/myoldlinuxusername/tutorial/sphinx3/../sp
    hinxbase/src/libsphinxbase/.libs/libsphinxbase.so: No such file or directory
    i686-apple-darwin10-gcc-4.2.1: /home/myoldlinuxusername/tutorial/sphinx3/../sp
    hinxbase/src/libsphinxad/.libs/libsphinxad.so: No such file or directory
    i686-apple-darwin10-gcc-4.2.1: /home/myoldlinuxusername/tutorial/sphinxbase/sr
    c/libsphinxbase/.libs/libsphinxbase.so: No such file or directory
    Tue Oct 18 04:58:08 2011Results

    My questions are:

    The 'myoldlinuxusername' appears to be a holdover from my Fedora 13
    installation sample code in the sr/etc directory.
    OSX doesn't use '/home' is used '/Users'
    My sphinx_train.cfg and sphinx_decode.cfg files have been appropriately
    changed to reflect the new directory locations on my OSX box.

    What am I missing? where do you change these directories? command line args
    somewhere? Or is this' /home' dir being inserted because it thinks it is a
    normal linux install?
    Somehow it is pulling up 'myoldlinuxusername" and I am not sure where. How do
    I change that?
    Also, what is up with calling '/bin/sed' explicitly? I have sed but not in the
    '/bin' dir. I can type sed at command line and it runs. Why is the sphinx
    install explicitly calling for sed in '/bin/sed' ? how do i get aroind this?

    Is OSX is that whacky to have changed all these locations and sphinx install
    stripts cannot compensate? I usually do all the work on Fedora which is no
    problem. For this installation I have to use OSX but it is proving to be very
    elusive.... Almost makes me want to dump my OSX (did I just say that? It IS
    that frustration to see Apple pull Microsoft tricks)

    Any ideas or help is greatly appreciated....

    Thanks in advance.

     
  • Nickolay V. Shmyrev

    What am I missing?

    You need to run decoder setup once again or copy the binary file
    sphinx3_decode to modeltrainingfolder/bin manually. You accidentally picked up
    libtool script from Fedora, the script replacement is not compatible with OSX.

    where do you change these directories? command line args somewhere? Or is
    this' /home' dir being inserted because it thinks it is a normal linux
    install?

    Yes, it still thinks you are on Linux

     

Log in to post a comment.