mivoq / hunpos

Automatically exported from code.google.com/p/hunpos
11 stars 7 forks source link

Build on OSX Sierra fails #26

Open Horsmann opened 7 years ago

Horsmann commented 7 years ago

Hi, I tried to build the hunpos binaries for OSX using the provided build script. I get this error:

Finished, 1 target (0 cached) in 00:00:00.
/usr/local/lib/ocaml/libasmrun.a
mkdir hunpos
ocamldep.opt -pp 'sed -e '\''s/^\(.*[[:space:]]\)\?Bytes\([^[:alpha:]].*\)\?$/\1String\2/g'\''' -modules hunpos/trainer.ml > hunpos/trainer.ml.depends
mkdir hunpos/lib
ocamldep.opt -pp 'sed -e '\''s/^\(.*[[:space:]]\)\?Bytes\([^[:alpha:]].*\)\?$/\1String\2/g'\''' -modules hunpos/lib/getopt.mli > hunpos/lib/getopt.mli.depends
ocamldep.opt -pp 'sed -e '\''s/^\(.*[[:space:]]\)\?Bytes\([^[:alpha:]].*\)\?$/\1String\2/g'\''' -modules hunpos/hmm_tagger.ml > hunpos/hmm_tagger.ml.depends
ocamldep.opt -pp 'sed -e '\''s/^\(.*[[:space:]]\)\?Bytes\([^[:alpha:]].*\)\?$/\1String\2/g'\''' -modules hunpos/io.ml > hunpos/io.ml.depends
sed: RE error: illegal byte sequence
File "hunpos/io.ml", line 1:
Error: Error while running external preprocessor
Command line: sed -e 's/^\(.*[[:space:]]\)\?Bytes\([^[:alpha:]].*\)\?$/\1String\2/g' 'hunpos/io.ml' > /var/folders/27/58qs5tsd719b45h_pddbdpvr0000gn/T/ocamlpp784e22

Exit code 2 while executing this command:
  ocamldep.opt -pp 'sed -e '\''s/^\(.*[[:space:]]\)\?Bytes\([^[:alpha:]].*\)\?$/\1String\2/g'\''' -modules hunpos/io.ml > hunpos/io.ml.depends

Any idea how to fix this?

ljos commented 7 years ago

Try using gnu sed instead of the bsd sed that follows with os x. It can be installed with brew install gnu-sed and added to the path by setting PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH.

Horsmann commented 7 years ago

Thanks. Works with gnu-sed.

giuliopaci commented 7 years ago

Another option is to upgrade ocaml to 4.02 version. I think it would be nice to fix the sed command line so that it works with both gnu sed and bsd sed.