Wednesday, April 2, 2014

Install GIZA++ 1.0.7 on Mac OSX 10.9.2

GIZA++ was written for Linux. A few modifications of the code enabled me to compile it for Mac.
Here is how you do it:

Create and move to your install folder, then:

curl http://giza-pp.googlecode.com/files/giza-pp-v1.0.7.tar.gz -o giza-pp-v1.0.7.tar.gz
tar -xzvf giza-pp-v1.0.7.tar.gz
cd giza-pp
perl -pi -w -e 's/<tr1\//</g;' GIZA++-v2/* mkcls-v2/*
perl -pi -w -e 's/using namespace std::tr1;//g;' GIZA++-v2/* mkcls-v2/*
perl -pi -w -e 's/std::tr1:://g;' GIZA++-v2/* mkcls-v2/*
sed '36d' mkcls-v2/mystl.h > mkcls-v2/mystl.h.tmp
sed '50d' mkcls-v2/mystl.h.tmp > mkcls-v2/mystl.h
rm mkcls-v2/mystl.h.tmp
make

(The first 3 lines download and decompress the GIZA++ archive. The last 5 lines remove all the references to tr1.)

Enjoy!

9 comments:

  1. Thank you so much! Worked perfectly!

    ReplyDelete
  2. Waouh! My first reader! I'm glad you like it :)

    ReplyDelete
  3. Thanks, that was really helpful!

    ReplyDelete
  4. Thanks a lot. It was very helpful. :)

    ReplyDelete
  5. Thanks, this also worked for me. I'm curious -- is there a downside to removing the tr1 references? Will this break other parts of the giza++ code? Also, I still get two warnings after doing "make" which are "illegal character encoding in string literal [-Winvalid-source-encoding]" but hopefully this is not a problem?

    ReplyDelete
  6. Since Google Code is no longer online, the URL in the curl command should be replaced with https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/moses-suite/giza-pp-v1.0.7.tar.gz

    ReplyDelete
  7. Thank you. This post is helpful to me

    ReplyDelete