Pike on Windows (VC2015)

[ Start > PikeDevel > Pike on Windows (VC2015) ] [ Edit this Page | Show Page Versions | Show Raw Source ]


This build environment uses a Windows virtual machine with a filesystem shared from the build driver system. An example would be a MacOS host running VMWare.

Prepare the build driver system:

1. create a directory that will contain the files shared between the driver and the build host (for example, /home/myuser/pike_windows).

  1. git clone pike repo
  2. git checkout -b nt-tools origin/nt-tools
  3. copy nt-tools to the shared directory.
  4. download and unzip a pike source release tarball in the shared directory (release tarballs avoid the need to precompile cmods, making the build simpler).
  5. copy the win32libs directory to the shared directory from another build host
  6. Create $HOME/.init_ntrc (note that trailing slashes will cause problems):
REMOTE_METHOD="sprsh"
NTHOST="192.168.1.102"
NTDRIVE="Z:"
NTPORT=9999
NTMOUNT=/home/myuser/pike_windows
NTLD_LIBRARY_PATH=/home/myuser/pike_windows/win32libs/lib
RNTCL_VC=14

Create a virtual machine for the windows build host:

1. install windows

  1. install pike for windows
  2. install vc2015 community edition
  3. install git for windows
  4. install wix v2 by transferring wix directory from another build system
  5. share a directory on the build driver system with the windows host (for example /home/myuser/pike_windows as Z:)
  6. run "Visual Studio Command Line"
  7. add pike and nt-tools directory to your nt-path
  8. add wix2 to path
  9. share a folder between the unix "configure" box and the win-nt box.
  10. start sprshd on windows box:
 cd z:/nt-tools/tools 
 pike sprshd <port> <ip of configure box>

At this point, it may be advisable to take a snapshot of the virtual machine so that you can roll back if things go sideways.

Building Pike

on build driver box, run nt-tools/init_nt then, run configure normally:

CC=rntcl LDFLAGS="-LZ:/win32libs/lib" CPPFLAGS="-IZ:/win32libs/include" CXX=rntcl make

Getting an error 267 create_process on sprshd can mean that the drive and directory you specify in the configure - to - build drive mapping isn't right (wrong drive or wrong folder)

When the build completes, you'll need to copy any DLLs for the dependencies you've enabled into the build directory. If you don't, the pike binary won't be able to find them and you'll get errors about modules not loading and such. There's a utility called "Dependency Walker" or "depends.exe" that can help explain what libraries a component is trying to load.

You should be able to run bin/pike from the build driver host and have the pike binary run on the windows host. If you do this, don't use Control-D to exit hilfe, which will cause the process to hang. Type "exit" instead.

Building the installer

Building the Pike MSI installer package requires wix2 installed on the Windows build host. Newer versions of wix are currently incompatible with the installer xml generated by the pike build process. It's almost impossible to find wix2 on the internet, so your best hope is to get a copy from someone else. Ask on the pike devel list and someone should be able to help.

If wix2 is in PATH when you start the build, the necessary tools should automatically be detected and all that is necessary to generate the MSI is to run:

make wix

At the end of the process, you should see "Pike.msi" in the build directory.

Building dependencies

Some dependencies can be built using rntcl, others may be fetched online, depending on whether they've been compiled with a compatible version of Visual C++. The Shift Media Project provides Visual Studio solutions for a number of common projects. These may be cloned and then built using Visual Studio or msbuild. Note that these projects deposit the build artifacts to a directory called "msvc" on the drive the project is located. You'll need to move the headers and libs to the win32libs folder. Note that some dependencies use the naming format "libwhatever.lib", and in these cases, you will need to remove the leading "lib" in order to conform to the way rntcl and friends expect things to be named.

Building Nettle using rntcl

CC=rntcl ./configure --disable-assembler --build=i686-pc-windows_nt

Copy nettle.lib and nettle/*.h to appropriate places in win32libs.

Details and Background

Martin Sternholm was the original "master builder" for Windows. He put together a lengthy and informative document describing the steps involved in preparing a windows build. This document is a must-read for anyone interested in building Pike for Windows themselves.

- http://www.gotpike.org/pikemlarchives/viewmessage.pike?msgid=12640


Powered by PikeWiki2

 
gotpike.org | Copyright © 2004 - 2009 | Pike is a trademark of Department of Computer and Information Science, Linköping University