Install Panotools-Script on Windows

From PanoTools.org Wiki
Jump to navigation Jump to search

Panotools::Script is a framework for scripting various panorama operations using the command-line tools shipped with hugin, it has some Documentation on CPAN.

Simplified Method

Install Panotools::Script

  1. Install required software:
  2. Install Perl scripts:
    • Open: Start Menu -> Strawberry Perl -> Tools -> CPAN Client
    • Run the following commands:
      notest install Panotools::Script Image::Magick
      exit

The latest version of Panotools::Script should now be installed. These packages will work fine on the computer on which they were built, but .exe tools may be desired in order to run on computers without Perl installed.

Build .exe Tools (Optional)

  1. Install required Perl scripts:
    • Open: Start Menu -> Strawberry Perl -> Tools -> CPAN Client
    • Run the following commands:
      notest install PAR::Packer
      exit
  2. Build .exe tools:
    • Open: Start Menu -> Strawberry Perl -> Perl (Command Line)
    • Change directory to install directory:
      cd <STRAWBERRY-PERL-HOME>\perl\site\bin
    • Build desired .exe tools (replace <PACKAGE> with name of package):
      pp -o <PACKAGE>.exe <PACKAGE>

Perl

Panotools::Script is a Perl module, so for Windows you need to download and install ActiveState Perl first, I got the MSI installer for ActivePerl-5.8.8.822.

For some reason, the installer doesn't set the PATH correctly for manually built modules, so go to Explorer -> My Computer -> right-click -> Properties -> Advanced -> Environment Variables -> System variables. Scroll to Path, click edit, and add this path to the front of the existing list of paths:

 C:\Perl\site\bin; 

Image::ExifTool, Image::Size and Module::Build

You need three extra modules that are not installed by default. So in the Activestate part of the Start menu, run the Perl Package Manager (PPM). This can be used to install pre-built add-on modules, in this case you want to install Image-ExifTool, Image-Size and Module-Build. Reboot after installing Module-Build, remember this is windows.

ImageMagick

ImageMagick is a general purpose command-line image manipulation suite, Panotools::Script uses it for various purposes such as resizing and playing with alpha channels. I downloaded the Win32 dynamic at 16 bits-per-pixel version from the ImageMagick site.

hugin

Install hugin from the sourceforge download area if you haven't already. You need to fix the PATH again, add the hugin installation location the same as you did for Perl above:

 C:\Program Files\hugin\bin;

autotrace

Autotrace is a tool for converting bitmap images to vector graphics, only install this if you plan on editing enblend masks in Inkscape.

Download autotrace from here. You need to manually extract and install this one, put the folder containing the various DLLs and EXE files somewhere like C:\Program Files\autotrace and add this to your PATH as you did for Perl and hugin.

Panotools::Script

Download the latest source-code for Panotools::Script. This is a gzipped tar archive, so you will need something like 7-zip to extract it.

Download nmake

make is required to build and install Perl modules, download nmake from Microsoft and double-click it to extract. Copy NMAKE.EXE and NMAKE.ERR to the directory where you extracted the Panotools::Script sources.

Test and install

Open a command window: Click Start -> Run... -> cmd -> OK.

Change to the directory where you extracted the sources:

 cd Desktop\Panotools-Script-0.09

Then run the tests:

 perl Makefile.PL
 nmake test

The tests will produce lots of output and warnings, but at the end it should report 100% success. Finally install everything:

 nmake install

Creating .exe tools

This step isn't necessary if you have perl installed, but may be useful to make the tools usable on systems without perl. The right tool for this is PAR::Packer, I couldn't get it to work with this version of perl (please update this HOWTO if you know), so I installed App-Packer using Perl Package Manager (PPM).

If you are lucky then you can just create the .exe files with the make_exe.pl script:

 perl bin\make_exe.pl

I wasn't so lucky and had an error from a standard perl module bytes_heavy.pl, which I fixed by pasting this code into C:\Perl\lib\bytes_heavy.pl

<source lang="pl"> sub import {

   return unless $Have_Bytes;
   shift;
   unshift @_, 'bytes';
   goto &bytes::import;

} </source>

Finally, you should be able to run the resulting .exe files on other Windows systems, though you will also need the copy the perl58.dll file to the same destination.

Infrastructure to build the .exe tools - the new way

this is highly experimental. it has been tested on PAR::Packer 0.980 released May 14, 2008. Works for 0.982 / July 29, 2008 as well.

  1. Install MinGW - MSVC 2008 EE is not supported
    • Download MinGW-5.1.4.exe from http://www.mingw.org/
    • Follow default install, but add g++ to the mix, i.e. just click "Next" as often as needed, but on the screen where you can tick boxes to choose what to install, check the box with g++ (and leave anything else as is. It will be installed in C:\MinGW
    • Run the now installed C:\MinGW\MinGW-5.1.4.exe to ensure you get the latest updates.
  2. Install ActiveState Perl 5.10.0 build 1002 (other versions may also work, this is the one that worked for me)
  3. start the Perl Package Manager (PPM), search and install the following packages
    • Getopt-ArgvFile (>=1.07)
    • Module-ScanDeps (>=0.78)
    • PAR-Dist (>=0.22)
    • Parse-Binary (>=0.10)
  4. Download dmake from http://search.cpan.org/dist/dmake/
  5. Extract dmake to C:\MinGW so that you have a folder called C:\MinGW\dmake
  6. Make yourself an environment batch file, call it perl.bat, with the following content:
    set MINGW_PATH=C:\MinGW
    set PERL_PATH=C:\Perl
    set PATH=%MINGW_PATH%\bin;%MINGW_PATH%\mingw32\bin;%MINGW_PATH%\dmake;
    set PATH=%PATH%C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;
    set LIB=%MINGW_PATH%\lib;
    set INCLUDE=%MINGW_PATH%\include;
    set PATH=%PERL_PATH%\site\bin;%PERL_PATH%\bin;%PATH%
    cmd /K
  7. install manually Win32-exe, Par and Par-Packer.
    • get them from:
    • extract them to a temporary folder
    • doubleclick on perl.bat to start a CLI
    • in the CLI, run the following commands
      > perl Makefile.PL
      > dmake
      > dmake test
      > dmake install
  8. test your installation
    • create a file test.pl with the following content:
      #!/usr/bin/perl
      print "hello world!\n";
    • in the CLI, check it works
      perl test.pl
    • compile it
      pp -o test.exe test.pl
    • test it
      test.exe
  9. contribute back! If you have come so far, it is because volunteers have helped you. Those volunteers need your help in turn.
    • Subscribe to the PAR::Packer mailing list.
    • From time to time there will be a request like this one.
    • when you see the request, download the latest packages and repeat the above step 7.
    • when processing the PAR-packer temporary folder, after dmake test, issue a
      dmake par
    • In the temporary folder there should now be a file named PAR-Packer-0.980-MSWin32-x86-multi-thread-5.10.0.par or something similar. Upload that file somewhere and announce it to the mailing list.
    • if you want to intall the latest PAR-Packer, continue with dmake install.

The perl58.dll is no longer required.

Yuval 23:09, 15 May 2008 (CEST) with help from Mark Dootson and the PAR::Packer community