Here's what I use to make /dev/stdin and friends on my cygwin installation:

I just add it as a conditional dependency in my toplevel makefile

-----

# first the cygwin check early on in the makefile
SHELL=bash
ARCH=$(shell uname -s)
ifeq ($(findstring CYGWIN,$(ARCH)),CYGWIN)
SRILMARCH=cygwin
STDINTARGET=/dev/stdin
endif

 ...

# use $(STDINTARGET) as a dependency where needed. I do it at top level

...

# then this comes later
/dev/stdin /dev/stdout /dev/stderr: /proc/self/fd
        @echo warning: CREATING LINKS IN /dev. Hope you are on CYGWIN.
        -mkdir /dev
        cd /dev; ln -s /proc/self/fd ; ln -s fd/0 stdin; ln -s fd/1
stdout; ln -s fd/2 stderr
------

Suggest adding this where you need it.

-John




On Feb 18, 2008 8:25 AM, J C Read <[EMAIL PROTECTED]> wrote:
> I've managed to get step 3 of the training process to run under Cygwin for the
> English/French language pair. Here is how I did it. In a nutshell, manually:
>
> #mkdir /dev
> #touch /dev/stdin
> #mkdir -p model
> #/path/to/scripts/scripts-(date)/training/symal/giza2bal.pl -d "zcat
> ./giza.en-fr/en-fr.A3.final.gz" -i "zcat ./giza.fr-en/fr-en.A3.final.gz" > tmp
> #/path/to/scripts/scripts-(date)/training/symal/symal -a=g -d=yes -f=yes -b=no
> -i=tmp -o=./model/aligned.grow-diag-final
> #rm tmp
>
> Obviously, getting this far required a lot of bug hunting, reading scripts and
> generally trying to understand where the process was failing and what it 
> really
> should be doing. The kind of thing the average user isn't really willing to
> do.
>
> I'm trying to get a patch together to fix this. Here is as far as I've managed
> to get on my own. The symal.exe under cygwin doesn't like the fact that there
> is no /dev/stdin file under cygwin. So I made it by hand to see if things
> work.
>
> Then it doesn't like the way, in the training script, output from giza2bal.pl 
> is
> piped to symal.exe and that output is redirected to filesystem via the >
> operator.
>
> Reproducing such a system by hand results in an empty aligned.grow-diag-final
> file. So I got around this by using the -i and -o flags of the symal command
> and by outputting giza2bal.pl output to a temporary file which is fed to
> symal.exe via the -i flag. The -o flag I used to get output to go to the
> correct file location.
>
> I'm trying to reproduce this in the training script (in the word_align 
> function)
> so that a default install of moses will run stage 3 without having to take 
> such
> steps. The problem is that, for reasons I can't quite figure out, the system()
> call, via the safesystem() function, is exiting with error code 127 after sh
> outputs an error of the form:
>
> sh: /path/to/scripts/scripts-(date)/training/symal/giza2bal.pl: No such file 
> or
> directory
>
> This is of course complete nonsense because the files do exist and in the 
> exact
> locations indicated by the sh error messages.
>
> If anybody has any idea how this could be happening, it would be very helpful
> information in fixing this bug.
> _______________________________________________
> Moses-support mailing list
> [email protected]
> http://mailman.mit.edu/mailman/listinfo/moses-support
>
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to