Windows port of Marpa::R2

69 views
Skip to first unread message

Jeffrey Kegler

unread,
Nov 8, 2012, 6:25:53 PM11/8/12
to Marpa Parser Mailing LIst
A wishlist item on Marpa::R2's RT queue reports a successful port of Marpa::R2 to Windows.  This is excellent news.  It is ticket 81057.  Jean-Damien's fix requires use of some CPAN dependencies: Config::AutoConf; Archive::Tar; and ExtUtils::MakeMaker.  Of these Config::AutoConf is non-core.  Here is my reply:

I am very much in your debt.  There's been a lot of talk about porting to Windows, but you are
the one who finally did the work.

I do not have access to a Windows box as of this writing.  I'd very much like to see your patch.  
Is the github repository convenient for you?  If not, I'd like to see it whatever form is
convenient.

As for bringing Windows support into the main distribution, I'd like to, consistent with the
following thoughts:

1.) I don't want to introduce any new dependencies that will affect non-Windows users.  That
is, I'm open to "requiring" the three packages you suggest, but I do not want to make them
general CPAN requirements.  There are ways to accomplish this in a Build.PL.

2.) I think in the Windows environment, binaries are possible and expected -- they will
usually not want to install from CPAN.

One approach is to make the changes needed for Windows "downstream", then push them up
to me.  I then incorporate them in a way that does not affect POSIX/UNIX installs.  This makes
the build code more complex for all users but, unlike the extra dependencies, this is a price I
am willing to pay.  It also risks breaking the install for POSIX/UNIX users, but that risk can be
controlled with testing.
-- jeffrey

Ruslan Shvedov

unread,
Nov 8, 2012, 11:54:37 PM11/8/12
to marpa-...@googlegroups.com
That news is truly excellent, my $work is on winxp sp3 now so I'd happily volunteer to test or help otherwise. 

In a meanwhile, JKEGL/Marpa-R2-2.024000.tar.gz installed and ran all my tests just fine under cygwin 1.7.17.

That momentum Marpa seems to be starting to gain now is a very good thing to see, --rns

Durand Jean-Damien

unread,
Nov 10, 2012, 6:53:03 AM11/10/12
to marpa-...@googlegroups.com
Jeffrey,

Please find attached the git diff for the Windows port.
Since this is different from a CPAN distribution, I have uploaded the CPAN equivalent here for the impatients: http://dl.free.fr/gaeYqAc5e .
The diff was done against Marpa--R2 master branch.

I hope this will work out-of-the-box for everybody using win32 here. Of course in case, any trouble, question, I am willing to help.

Added prererqs on win32 only are:
- Archive::Tar
- ExtUtils::MakeMaker
- Config::AutoConf

About Marpa--R2 itself, I have started a project very similar to MarpaX::Parse seen recently: generate marpa grammars from an EBNF grammar. This is working. I want to write a proof-of-concept first and publish it by producing a pure-perl posix shell, and the ultimate goal is to have a tool that generates automatically code writen in any langage using an UML model, for which the description is in XMI.

Regards, Jean-Damien.

Marpa-R2-2.024000.diff

Durand Jean-Damien

unread,
Nov 10, 2012, 7:38:27 AM11/10/12
to marpa-...@googlegroups.com
Just another comment, on win32 one needs of course a compiler.
strawberry ships with gcc, this is a recommended distro.
activestate I do not know if it ships with cl/nmake - I guess not and one has to install it.
other distribs I do not know neither -;
Cheers, JD.

Ruslan Shvedov

unread,
Nov 10, 2012, 7:55:48 AM11/10/12
to marpa-...@googlegroups.com
Great to hear that, here is my take on proof-of-concept Marpa::R2::Grammar generatrion from EBNF — moduletest.

 

Regards, Jean-Damien.


Ruslan Shvedov

unread,
Nov 10, 2012, 8:01:51 AM11/10/12
to marpa-...@googlegroups.com
On Sat, Nov 10, 2012 at 2:38 PM, Durand Jean-Damien <jeandami...@gmail.com> wrote:
Just another comment, on win32 one needs of course a compiler.
strawberry ships with gcc, this is a recommended distro.
activestate I do not know if it ships with cl/nmake - I guess not and one has to install it.
I've just successfully installed Marpa::R2::Grammar from the tar file you've linked to under perl 5.14.2 win xp sp3 compiled with MS VS studio 2003's cl.

Thanks a lot for the great job!

Ruslan Shvedov

unread,
Nov 10, 2012, 8:28:11 AM11/10/12
to marpa-...@googlegroups.com
Yes, and my tests that survived refactoring (i.e. most of them) pass too.

Jeffrey Kegler

unread,
Nov 10, 2012, 12:24:07 PM11/10/12
to marpa-...@googlegroups.com
This looks marvelous.  In the next few days, I'll start to pull this "upstream".  As mentioned, I do not have a Windows box, so we may have be looking at an "iterative solution", where I take your fixes upstream, you pull them downstream and fix my changes, I take your fixes to my changes upstream, etc.

Here's what I plan now:

1.) Simply switch to Archive::Tar for untaring for all installs, including POSIX.  It's core, and its use can be seen as more reliable than the assumption that the system tar is a POSIX tar.

2.) Add the requirement for ExtUtils::MakeMaker for all installs, including POSIX.  POSIX installs won't use it, but is "very core", so there is basically no risk in requiring it.

3.) Add Config::Autoconf as "recommended", and fail in Build.PL with an appropriate message if $^O eq 'MSWin32' and it is not present.

4.) Rename the "PURE_PERL_BUILD_MODE" variable and environment variable to USE_PERL_AUTOCONF and MARPA_USE_PERL_AUTOCONF.  "Pure Perl" suggests "no C compiler required".  Another choice was "WINDOWS_BUILD_MODE" or something like that, but I thought it best to avoid mentioning Windows unless the tie-in to Windows is 100%.  Here it is only 99.99%. :-)

And by the way, I cannot restrain myself from a bit of self-congratulation here.  It looks like my only portability mistake, in almost 50,000 lines of Perl and over 15,000 lines of highly mathematical C code, was the missing "config.h" in avl.h.

Thanks Jean-Damien, and thanks to rns for the prompt test,

jeffrey

Durand Jean-Damien

unread,
Nov 10, 2012, 12:38:12 PM11/10/12
to marpa-...@googlegroups.com
Jeffrey,

Your proposal is fine.
I add the congrats particularly about the C portion of Marpa, C experienced programmer speaking -;

Cheers, JD.
Reply all
Reply to author
Forward
0 new messages