Menu

Mini-guide, Compiling Xaira on OSX 10.6

XAIRA
2010-06-20
2013-05-13
  • tailblues(TG Noh)

    First of all, Xaira is a great tool for guys like me who does NLP research.
    I'm using OSX servers with OSX 10.6. Since leopard, default GCC on OSX is 64bit.
    However, Xaira 1.25 source does not work correctly in 64bit GCC.
    Thus, the only (easy) way to run xaira on your OSX is compile it and run it as a 32bit executable.
    I have successfully compiled and run the xaira indexer as 32bit executable  in OSX 64bit environment with following method.
    I hope this info helps any future OSX xaira users.

    ---

    Step 0) XCODE : prepare compiler: Install XCODE, OSX development tool from Apple. It provides GCC and make.

    Step 1) ICU and XERCES : Xaira depends on ICU and XERCES-C. Using Macport is the easy way to build ICU and XERCES-C.
    Download and install Macports (www.macports.org). run port as root (> sudo port), and install ICU and XERCESC3 (xerces c++ interface 3.x) like followings
    > install ICU +universal
    (… system fetches, compiles and installs)
    > install XERCESC3 +universal
    (… again fetches, compiles and installs)

    Don't forget the "+universal" at the end of install command. It will build universal binary libraries. Without it, it will install only the 64bit dylib. We need 32bit dylib.

    Step 2) Configure, as 32bit building.
    Use the following options at the ./configure ;

    > ./configure LDFLAGS="-arch i386 -L/opt/local/lib/" CFLAGS="-m32 -I/opt/local/include/" CXXFLAGS="-m32 -I/opt/local/include/"

    * "-m32" option tells GCC to compile objects in 32bit modes. This will remove almost all errors from Xaira 1.25 source code. There are some dangerous pointer accesses which breaks in 64bit modes, however, they work correctly in 32bit modes.
    * "-arch i386" option tells ld (loader) to link the objects in 32bit modes.
    * other options specifies the library and include directory for ICU and XERCES installed by Macport.

    Step 3) Make:
    After configure ends, compile it by calling make. When make completes, test it with "make check".
    With this setup, make check runs OK for indexer. Now you can use Xaira inderxer.
    (However, make check will fail later, in "check-TESTS". For the moment, you can ignore this error.).  

    Now you can use XAIRA indexer, in your trusty OSX server. 

    PS)
    check-TESTS ends with a runtime error. seems that there lurks a "access on freed object." .
    xaira_test(76489) malloc: *** error for object 0x17caa20: incorrect checksum for freed object - object was probably modified after being freed.

     
  • Lou Burnard

    Lou Burnard - 2010-06-20

    Thanks for this encouraging report! I think that Tony has successfully built a true 64-bit version on Linux, so it may be that there are some fixes missing in the released source: more on that in due course. How would you like to make us a Mac binary for distribution?

     
  • Lou Burnard

    Lou Burnard - 2010-06-28

    Tony confirms that the latest sources (in our SVN repository) include several fixes for 64-bit  working. You might like to try checking out that source and checking that it compiles for you in 64-bit mode (we have tested it only under gcc on redhat so far) . If you note any significant differences, we'd like to know before the next release!

     
  • tailblues(TG Noh)

    Current version, (Version 1.26), compiles without a problem in a Mac 64bit environment.
    Thus, in the above mini-guide, we now no longer need to specify 32bit options in OSX.

    In detail:

    In step 1), "+universal" option at the time of port installing,  is not needed.
    In step 2), "-m32" in the compiler option of configure, is no longer needed.
    "-arch i386" in the ld option of configure, is no longer needed.

    =====

    Nice work.  Sorry I couldn't check this before 1.26 release :)
    It's good to have a sound 64-bit version of Xaira running on my OSX.

     

Log in to post a comment.