# Perl toolkit installation [Installing Mascot Parser]

To use the toolkit, an appropriate version of Perl must be installed.

## Installation on Windows

Supported versions (Windows)
The only supported versions of Perl on Windows are 32 bit and 64 bit ActiveState ActivePerl 5.8.x, 5.10.x, 5.12.x, 5.14.x and 5.16.x ActivePerl is available for download from http://www.activestate.com/.
Determine which version of Perl you are using (Windows)
To find out which version of perl you have, type the following at a command prompt:
    perl -v

This will report the Perl version and copyright. The first line gives the version number. For example:
    This is perl, v5.10.1 built for MSWin32-x64-multi-thread

If it reports built for MSWin32-x64... then the 64 bit version of Mascot Parser is required. If it reports built for MSWin32-x86... then the 32 bit version of Mascot Parser is required.
Find the correct version of the Mascot Parser Files (Windows)
The correct Mascot Parser files will be in the following directories:
Perl versionDirectory
ActivePerl 5.8.xperl58
ActivePerl 5.10.xperl510
ActivePerl 5.12.xperl512
ActivePerl 5.14.xperl514
ActivePerl 5.16.xperl516
Copy the two files to a suitable location (Windows)
To use Mascot Parser in your program, the files msparser.pm must either be in the same directory as your program, or in a directory searched by the Perl interpreter.
In either case, msparser.dll must be copied into a subdirectory auto\msparser that is relative to msparser.pm. For example:
    C:\msparser\perl510>dir

Directory of C:\msparser\perl510

17/08/2010  15:05    <DIR>          .
17/08/2010  15:05    <DIR>          ..
17/08/2010  15:05    <DIR>          auto
17/08/2010  15:05           329,964 msparser.pm
1 File(s)        329,964 bytes
3 Dir(s)  28,778,184,704 bytes free

C:\msparser\perl510>dir auto\msparser

Directory of C:\msparser\perl510\auto\msparser

17/08/2010  15:05    <DIR>          .
17/08/2010  15:05    <DIR>          ..
17/08/2010  15:05         6,082,665 msparser.dll
1 File(s)      6,082,665 bytes
2 Dir(s)  28,778,184,704 bytes free

Define the module path (Windows)
If the msparser.pm file is not in the current directory, there are four alternative ways to define the module search path:
1. Define or modify PERL5LIB:
You can define the  PERL5LIB  environment variable to point to the directory where Mascot Parser Perl files are located.

2. Add use lib into your program:
You can use the lib module to add the directory where Mascot Parser Perl files are located to the module search path:

use lib 'c:\path\to\msparser\perl_files';


3. Use the -I command-line flag:
You can use the  -I  command-line flag when running Perl to add a directory to the module search path.

4. Global installation:
You can copy the Mascot Parser Perl files to C:\Perl\site\lib directory as follows:
• Copy msparser.pm into C:\Perl64\site\lib
• Make a directory C:\Perl64\site\lib\auto\msparser
• Copy msparser.dll into C:\Perl64\site\lib\auto\msparser
(The directories above assume that ActivePerl is installed in C:\Perl64).
Install Microsoft Runtime Libraries (Windows)
You may also need to install the Microsoft Visual C++ 2012 Update 3 (or later) Redistributable Package
To check if you need this:
1. Download and run depends.exe from http://www.dependencywalker.com/.
2. Open msparser.dll in the program.
3. If depends.exe reports that the dependent MSVCR110.dll and MSVCP110.dll are missing, download the Visual C++ 2012 Update 3 (or later) redistributable package from the Microsoft Download Center: https://www.microsoft.com/en-us/download/details.aspx?id=30679
4. Choose vcredist_x86.EXE for 32-bit and vcredist_x64.EXE for 64-bit
Test the installation (Windows)
Type the following at a command prompt:
    perl -e "use msparser;"

This should give no output and just return to the command prompt.

## Installation on Linux platforms

Supported versions (Linux)
Different releases and builds of Perl are supported on 32 and 64 bit Linux. The 64 bit .so files all have the name xxxx_64.so. This version of Mascot Parser provides the following builds of the Perl module:
.so filename Linux - 32bit Linux - 64bit
msparser56.so X
msparser58[_64].so X X
msparser510[_64].so X X
msparser512[_64].so X X
msparser514[_64].so X X
msparser516[_64].so X X
msparser518[_64].so X X
msparser520[_64].so X X
msparser522[_64].so X X
You need to determine which .so file matches your version of Perl, and then make a soft link or rename it to msparser.so.
Determine which version of Perl you are using (Linux)
To find out which version of perl you have, type the following at a shell prompt:
perl -v

This will report the Perl version and copyright. The first line gives the version number. For example:
This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi

If it reports built for x86_x64... then the 64 bit version of Mascot Parser is required, otherwise, the 32 bit version of Mascot Parser is required.
Find the correct version of the Mascot Parser Files (Linux)
The correct Mascot Parser files will be in the following directories:
Perl versionDirectory
5.8.xperl58
5.10.xperl510
5.12.xperl512
5.14.xperl514
5.16.xperl516
5.18.xperl518
5.20.xperl520
5.22.xperl522
Determine Perl build options (Linux)
Within each directory, there will be one or more .so files with the following naming convention:
msparser[ver][-thread][-multi][-64int][_64].so


To determine which file you need:
[ver]
Version[ver].so starts with
5.6.x56msparser56
5.8.x58msparser58
5.10.x510msparser510
5.12.x512msparser512
5.14.x514msparser514
5.16.x516msparser516
5.18.x518msparser518
5.20.x520msparser520
5.22.x522msparser522

[-thread]

Type perl -V (note the uppercase V) and look for the line starting usethreads or useithreads. For example:

   usethreads=define useithreads=define ...

If usethreads is define, then you will need an .so file with -thread in the name.

[-multi]

Type perl -V (as above) and look for the line containing usemultiplicity. If it is define, then you will need an .so file with -multi in the name. (This option is no longer supported in Mascot Parser)

[-64int]

Type perl -V (as above) and look for the line containing use64bitint. If it is define, then you will need an .so file with -64int in the name. (This option is no longer supported in Mascot Parser)

[_64]

Type perl -V (as above) and look for the line containing ptrsize. For example:

  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678

If ptrsize is 8, then you will need an .so file with _64 in the name.

Copy the two files to a suitable location (Linux)
To use Mascot Parser in your program, the file msparser.pm must either be in the same directory as your program, or in a directory searched by the Perl interpreter.
• In both cases, msparser.so must be in the directory auto/msparser relative to msparser.pm.
• In that directory, make a soft link msparser.so to the msparser[ver][-thread][-multi][-64int][_64].so file
Define the module path (Linux)
If the msparser.pm file is not in the current directory, there are four alternative ways to define the module search path:
1. Define or modify PERL5LIB:
You can define the  PERL5LIB  environment variable to point to the directory where Mascot Parser Perl files are located.

2. Add use lib into your program: You can use the lib module to add the directory where Mascot Parser Perl files are located to the module search path:

use lib '/path/to/msparser/perl_files';


3. Use the -I command-line flag: You can use the  -I  command-line flag when running Perl to add a directory to the module search path.

4. Global installation: You can copy the Mascot Parser Perl files to the site_perl directory as follows. Note that the exact path will depend on your distribution and how Perl has been configured; the following example is from Ubuntu Linux 10.04 64-bit:
• Copy msparser.pm into /usr/local/lib/perl5/site_perl/5.10.1/x86-linux-thread-multi/
• Make a directory /usr/local/lib/perl5/site_perl/5.10.1/x86-linux-thread-multi/auto/msparser
• Copy msparser510-thread-multi.so into /usr/local/lib/perl5/site_perl/5.10.1/x86-linux-thread-multi/auto/msparser
• Make a soft link msparser.so in /usr/local/lib/perl5/site_perl/5.10.1/x86-linux-thread-multi/auto/msparser

## Using the Perl toolkit

Reasonable proficiency in Perl programming will be required. Please see Quickstart: how to open a results file and Examples for the results file module.