|Version 7 (modified by cotto, 4 years ago)|
Developers working on Windows
|François Perrad||Win2000-SP4||MinGW/GCC 3.4.2|
|Ronald Blaschke||Windows XP, Windows XP x64||Visual C++ 9.0|
|Paul Cochrane||Windows XP||Visual C++ 2005 Express Edition|
Development on Windows
What to download and install
One of the following:
- Microsoft Windows SDK
- Microsoft Visual Studio 2008 Express Edition for C++
- Microsoft Visual C++ 2010 Express
Setting up Microsoft Windows SDK
The free download of Microsoft's Windows SDK doesn't require registration and comes with the C compiler tools needed to build Parrot using a Microsoft toolchain. The latest version (7.1 as of this writing) requires the .Net framework 4.0, which may take some time to download and install. Neither the Windows SDK nor the .Net framework 4.0 require a reboot.
Setting up Microsoft Visual Studio 2008
Now you will need to register the software, otherwise you can only use it for 30 days. To register, start up the Visual C++ Express program directly from the Start Menu. Go to the Help menu and select "Register Product". Then click on the "Register now" link in the window which appears. You'll need to get a Hotmail email account so that you can log in and eventually get the registration number. Once you've done that, sign in and you should be presented with a web form to fill out. Fill this information out and you should then be given a registration key. Copy and paste this key into the relevant field in Visual C++ Express. You can now close the program; you'll be developing Parrot from within the command line interface anyway :-)
Setting up Microsoft Visual C++ 2010 Express
Microsoft Visual C++ 2010 Express doesn't require a registration. It only forces you to download and install a bunch of other stuff related to Windows development.
Open up the Visual Studio 2008 or Windows SDK command prompt, and create a clone of Parrot's repository in a suitable location:
git clone https://github.com/parrot/parrot.git parrot_msvc
When using MSVC 2010, run "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat".
Configuring and Building Parrot (MingW)
You should now be able to run these steps:
perl Configure.pl nmake nmake test
This will build parrot with MingW. This is because Strawberry Perl is built with gcc and Configure.pl gets its settings from the perl used to run Configure.pl. See below for instructions on using the Microsoft compiler toolchain with Strawberry Perl.
Configuring and Building Parrot (Strawberry/msvc)
Strawberry Perl is community-driven full featured Perl for Windows systems. Parrot's Configure.pl determines compiler options from Perl executable. Strawberry Perl is compiled with gcc, so Configure.pl will try to use gcc's options on VS compiler and linker, which will result in nothing - you won't be able to compile/test Parrot. In order to fix that you have to set up compiler's options manually.
First of all, open a Visual Studio Command Prompt (Windows->Microsoft Visual Studio 2010->Visual Studio Tools) or Windows SDK Command Prompt (depending on which you installed) and navigate to directory with your git clone of Parrot. The following options should get you a workable Makefile:
perl Configure.pl --without-icu --cc=cl --link=link --ld=link --ccflags="-nologo -GF -W4 -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC" --linkflags="-nologo -nodefaultlib -debug"
Now you can run nmake. Enjoy your parrot.exe! Let
Setting up the cpan shell
The great thing about Strawberry Perl is that it's just like using Perl in almost every other Perl environment, so if you go from Solaris to Linux, and with Strawberry Perl, even to Windows, the way you interact with Perl will be exactly the same. Therefore, to install new modules from CPAN, you need to set up the cpan shell. But first, you'll need to install some helper programs for the cpan shell. There is an awesome site hosting many of the standard GNU utilities bundled for use on Windows systems at http://sourceforge.net/projects/gnuwin32. You will need to download and install the following programs:
After you have done this, add C:\programs\gnuwin32\bin to your Windows PATH environment variable.
Then run cpan from within your Visual Studio Command Prompt and you should then be asked for lots of configuration information. If the cpan shell doesn't find some of your programs, just enter the full path to it when prompted to do so. For instance, when asked for your gzip program location, enter:
Also note that when you are asked if the CPAN mirror sites should be downloaded anew, then enter y (i.e. yes) rather than the default option of no (sometimes the previous setup of the cpan shell hasn't got the list properly, and you won't be able to enter a relevant continent, country, and CPAN mirror location, which means you can't actually use CPAN which would be bad).
Running the smoke tests
In order to run tests such as make smoke and make languages-smoke (both really important and helpful things you can do to contribute to Parrot, even if you don't have lots of time to hack the source) you will need to install the Test::TAP::HTMLMatrix module. To do this, you can use the cpan shell from within your Visual Studio Command Prompt. Once at the prompt, enter cpan to go to the cpan shell, then you just need to do:
cpan> install Test::TAP::HTMLMatrix
To install the module so that you can run the smoke tests.
Read README_cygwin.pod first.
Install the following cygwin packages:
- perl (v5.10)
and optionally: libgmp-devel libgdbm-devel m4 ctags readline gettext gettext-devel icu libicu-devel pcre pcre-devel libaio-devel
Then install the following CPAN modules:
- Test::Base for some APL language tests
- Test::TAP::HTMLMatrix if you want to run the language smoke tests (make languages-smoke)
As of Nov 2008, these instructions work for a fresh cygwin install using perl 5.10.5 You may need to force install Test::TAP::HTMLMatrix from within cpan depends on (but does not 'use') Test::Harness::Straps, which may have problems installing under cygwin perl 5.10.5 cpan -- you may need to tweak around a /usr/share/man/man3 error to make things work.
Finally, make sure <YOUR_PARROT_SRC_DIR>/blib/lib is in your PATH (this may or may not be explicitly necessary by the time you read this) so miniparrot.exe can find libparrot.dll. There is a patch available.
The NCI postgresql test will fail because of the wrong pg.dll name. Everything else should pass.
As of January 2009, Parrot 0.9.0 and Strawberry Perl 184.108.40.206 play well together, but some workarounds are needed. The Makefile built by Configure.pl needs two changes, and some files need to be copied from the Strawberry Perl c directories into the Parrot build directory. The below assumes that you let Strawberry Perl install in its choice of directory.
After you have generated Makefile by using "perl Configure.pl", but before the first attempt at "ming32-make", edit the Makefile file and change the existing empty make lines to:
LINKFLAGS = -L=C:\strawberry\c\lib -L=C:\strawberry\c\lib\gcc\mingw32\3.4.5 LDFLAGS = -Wl,-L=C:\strawberry\c\lib -Wl,-L=C:\strawberry\c\lib\gcc\mingw32\3.4.5
This allows various build steps to find libraries they would otherwise miss. However, updating this doesn't cure all the missed files. To do that you need to copy selected files from Strawberry Perl's C / mingw32 directories to the Parrot build directory, like so:
copy C:\strawberry\c\bin\ld.exe copy C:\strawberry\c\bin\gcc.exe copy C:\strawberry\c\libexec\gcc\mingw32\3.4.5\cc1.exe copy C:\strawberry\c\libexec\gcc\mingw32\3.4.5\cc1plus.exe copy C:\strawberry\c\lib\dllcrt1.o copy C:\strawberry\c\lib\dllcrt2.o copy C:\strawberry\c\lib\gcc\mingw32\3.4.5\crtbegin.o copy C:\strawberry\c\lib\gcc\mingw32\3.4.5\crtend.o copy C:\strawberry\c\lib\crt1.o copy C:\strawberry\c\lib\crt2.o
This allows libraries and parrot.exe to build when you finally run "ming32-make". But not everything builds...
It falls apart at the step of trying to build pbc_to_exe.exe because that step builds its own gcc execution command line parameters and assumes all C include files will be in ./include under the build directory.