Project is now configured such that it should compile
cleanly with or without optional libraries.
To compile the project, the user must (at minimum) have boost installed.
If boost is installed in a standard location, such as /usr/local,
then XCode should be able to find boost without any help from the user.
If boost is in a non-standard location, the user must configure XCode
such that the Source Tree variable XCODE_MOSES_INCLUDE_BOOST is set to
the directory where boost is installed.
For example, if you download and unzip boost in /path/to/boost_1_53_0,
then after compiling boost, headers would be located in
/path/to/boost_1_53_0/include and libraries would be located in
/path/too/boost_1_53_0/lib. In this case, set XCODE_MOSES_INCLUDE_BOOST=
/path/to/boost_1_53_0/include.
If you want to compile using IRSTLM, RandLM, SRILM, or the HHMM SynLM,
you will need to set the paths to those projects' respective include dirs
in the respective corresponding Source Tree variables:
For IRSTLM:
XCODE_MOSES_INCLUDE_IRSTLM
For RandLM:
XCODE_MOSES_INCLUDE_RANDLM
For SRILM:
XCODE_MOSES_INCLUDE_SRILM
For the HHMM syntactic LM:
XCODE_MOSES_INCLUDE_SYNLM_RVTL
XCODE_MOSES_INCLUED_SYNLM_WSJPARSE
At the moment, the project is configured with the
LM_SRI, LM_IRST, and LM_RAND preprocessor macros enabled,
which means that to compile the project, the respective source tree
variables must be defined. Alternatively, you could remove those macros
from the project definitions.
By default, SRILM defines a function called zopen.
However, on Mac OS X (and possibly other BSDs),
<stdio.h> already defines a zopen function.
To resolve this conflict, SRILM checks to see if HAVE_ZOPEN is defined.
If it is, SRILM will rename its zopen function as my_zopen.
So, before importing any SRILM headers,
it is important to define HAVE_ZOPEN if we are on an Apple OS.
This commit updates that code to take into account Hieu's major refactoring.
Additionally, this commit re-instates changes from
commit 8459a86 (moses/LM/Jamfile, moses/LM/Ken.h, moses/LM/Ken.cpp),
commit d340218 (moses/LM/Ken.h),
commit 95e3a37 (moses/LM/Ken.h, moses/LM/Ken.cpp), and
commit aacc936 (moses/LM/Jamfile, moses/LM/Ken.cpp)
The above changes appear to have been improperly discarded
during the merge in commit 4894df6 and then again in commit 3ed17bb.