Monday 4 June 2012


Boost: A Guide to Building C++ Boost with MinGW (v1.48,  v1.49 and later)

As mentioned in the Boost Documents you only need to build a few of the libraries. These include regex, filesystem and Threads.

Where to get Boost:
Download the Library from: http://www.boost.org/users/download/




Where to get MinGW: http://www.mingw.org/ or http://sourceforge.net/projects/mingw/files/

Let get down to basics, unzip the zip file into C:\Boost, move the unzip folders into the following structure

c:\boost\
    - boost
    - doc
    - lib
    - more
    - stage
    - status
    - tools



Now start a command line for MinGW
Mini-guide
  • Run cmd.exe {command line windows should appear}
  • Add D:\mingw\bin {or wherever the WinGW installed}
    • Make sure no other compiler is included in the path like VC
    • I.e. path = %PATH%;C:\mingw\bin
    Hint: The windows command line has a default path (windows path), any changes made to the path inside the command line are not persisted or seen in other command line window. So, creating separate path batch(s) for the command line can be useful.

Now go to the boost folder


cd c:\boost\

Then execute (this will set the special building setting, it the magic)


bootstrap.bat 

Build 32 bit version of the libraries (not tested)
.\b2 --prefix=c:\boost\bin.v2 --toolset=gcc --build-type=complete stage

Build 64 bit version of the libraries (not tested)
.\b2 --prefix=c:\boost\bin.v2 --toolset=gcc --build-type=complete architecture=x86 address-model=64 stage  




Depending on PC specs the process can take several hours & build size is ~4Gb (per build version).

You will find the libraries in c:\boost\stage\

The intermediate files are located in c:\boost\bin.v2\ and sub folders

Sunday 25 March 2012

Strawberry Perl : Portable Version Installation (5.14)

If you choose to use the portable version (.zip) version or you move the folder then the folder paths in Strawberry Perl will not be correct. The default path is:

C:\Strawberry\

Now I like to install in

F:\Programs\StrawberryPerl\

The solution is to change the instance of C:\Strawberry path in the following files.

If you want to verify this just AstroGrep (or any search tool) and search for the following:
c:\strawberry
c:\\strawberry
c:/strawberry

The files you will probably need to change are:

The following are required for CPAN to work!


F:\Programs\strawberryPerl\perl\lib\CORE\config.h
From: C:\\strawberry
To  : D:\\Programs\\strawberryPerl <your path>


F:\Programs\strawberryPerl\perl\lib\CPAN\Config.pm
From: C:/strawberry
To  : D:/Programs/strawberryPerl <your path>
And
From: C:\\strawberry
To  : D:\\Programs\\strawberryPerl <your path>


The followng are probably for the build process
From: C:\strawberry
To  : D:\Programs\strawberryPerl <your path>


D:\Programs\strawberryPerl\perl\lib\CPANPLUS\Config.pm
D:\Programs\strawberryPerl\perl\lib\perllocal.pod
D:\Programs\strawberryPerl\perl\lib\Config_heavy.pl


The following Files are for the batch utilities:

Change required
From: C:\strawberry
To  : D:\Programs\strawberryPerl <your path>

D:\Programs\strawberryPerl\perl\bin\c2ph.bat
D:\Programs\strawberryPerl\perl\bin\config_data
D:\Programs\strawberryPerl\perl\bin\config_data.bat
D:\Programs\strawberryPerl\perl\bin\cpandb
D:\Programs\strawberryPerl\perl\bin\cpandb.bat
D:\Programs\strawberryPerl\perl\bin\find2perl.bat
D:\Programs\strawberryPerl\perl\bin\h2ph.bat
D:\Programs\strawberryPerl\perl\bin\h2xs.bat
D:\Programs\strawberryPerl\perl\bin\libnetcfg.bat
D:\Programs\strawberryPerl\perl\bin\perlbug.bat
D:\Programs\strawberryPerl\perl\bin\perldoc.bat
D:\Programs\strawberryPerl\perl\bin\perlivp.bat
D:\Programs\strawberryPerl\perl\bin\perlthanks.bat
D:\Programs\strawberryPerl\perl\bin\pl2pm.bat
D:\Programs\strawberryPerl\perl\bin\pod2html.bat
D:\Programs\strawberryPerl\perl\bin\pod2latex.bat
D:\Programs\strawberryPerl\perl\bin\pod2man.bat
D:\Programs\strawberryPerl\perl\bin\pod2text.bat
D:\Programs\strawberryPerl\perl\bin\prove.bat
D:\Programs\strawberryPerl\perl\bin\psed.bat
D:\Programs\strawberryPerl\perl\bin\pstruct.bat
D:\Programs\strawberryPerl\perl\bin\s2p.bat
D:\Programs\strawberryPerl\perl\bin\splain.bat

The following (no idea)
Change required
From: C:\strawberry
To  : D:\Programs\strawberryPerl
D:\Programs\strawberryPerl\win32\CPAN Module Search.url
D:\Programs\strawberryPerl\win32\Learning Perl (tutorials, examples).url
D:\Programs\strawberryPerl\win32\Live Support (chat).url
D:\Programs\strawberryPerl\win32\Perl 5.14 Documentation.url
D:\Programs\strawberryPerl\win32\Strawberry Perl Release Notes.url
D:\Programs\strawberryPerl\win32\Strawberry Perl Website.url
D:\Programs\strawberryPerl\win32\Win32 Perl Wiki.url
D:\Programs\strawberryPerl\strawberry-ui.reloc.txt
D:\Programs\strawberryPerl\strawberry-merge-module.reloc.txt
Strawberry Perl : Install Module(s)

There are two method to install modules. Either by using CPAN or the build process included in Strawberry Perl

Method 1 : The Building Method

In this example I am installing File::backwards, this is a module that allows reverse find.

Get the module from CPAN

Unzip the module to <Strawberry Perl Folder>\cpan\build\<Module Name>
I.e.
<Perl InstallPath>\cpan\build\File-ReadBackwards-1.05\
    - blib
    - t
    bw.data
    Changes
    Makefile
    Makefile.PL
    MANIFEST
    META.yml
    MYMETA.json
    MYMETA.yml
    pm_to_blib
    ReadBackwards.pm
    README

Note: if you have installed Strawberry Perl without the installer or a portable version and the installation folder is not c:\strawberry please refer to the Strawberry Perl Installation issues.
If the module has dependencies you will need to install these in order.

Now Command line to the module folder
>Makefile.pl or perl Makefile.pl (depending if the .pl file is reference correctly)
>dmake
>dmake test
>dmake install

Module should now be installed.

Methos 2 : Via CPAN

In this example I will be installing PadWalker, Padwalker is a module which allows you to debug via EPIC/Eclipse. As there are dependencies in PadWalker CPAN installation will automatically install these.

The CPAN way

>perl -MCPAN -e shell
>install PadWalker
hopefully you will get done and the
>exit
My Background Colours

Due to movement in life I don't always have mail access, so her is my preferred background colour

Hue: 80
Sat: 69
Lum: 194
 or
Red  : 192
Green: 220
Blue : 192

Sunday 18 March 2012

Boost: A Guide to Building C++ Boost with Visual C++ (v1.48,  v1.49 and later)

This guide is especially useful if multiple installation of Visual Studio C++ (tested with Visual Studio 2008 and 2010)

As mentioned in the Boost Documents you only need to build a few of the libraries. These include regex, filesystem and Threads.

Where to get Boost:
Download the Library from: http://www.boost.org/users/download/

Let get down to basics, unzip the zip file into C:\Boost, move the unzip folders into the following structure

c:\boost\
    - boost
    - doc
    - lib
    - more
    - stage
    - status
    - tools
   
Now start a Visual Studio C++ command line

cd c:\boost\

Then execute (this will set the special building setting, it the magic)
 

bootstrap.bat

Build options
--prefix=c:\boost\bin.v2, where the intermediate files will be located
--toolset=msvc-9.0, Toolset MSVC, version 9.0
--build-type=complete stage, see the RTFM :-)

Visual Studio 2008 (32 bit version) (use VC++ 32bit command line)

.\b2 --prefix=c:\boost\bin.v2 --toolset=msvc-9.0 --build-type=complete stage

Visual Studio 2008 (64 bit version)
(use VC++ 64bit command line)

.\b2 --prefix=c:\boost\bin.v2 --toolset=msvc-9.0 --build-type=complete architecture=x86 address-model=64 stage


Visual Studio 2010 (32 bit version)
(use VC++ 32bit command line)
.\b2 --prefix=e:\boost\bin.v2 --toolset=msvc-10.0 --build-type=complete stage

Visual Studio 2010 (64 bit version, not tested)
(use VC++ 64bit command line)
.\b2 --prefix=c:\boost\bin.v2 --toolset=msvc-10.0 --build-type=complete architecture=x86 address-model=64 stage


Depending on PC specs the process can take several hours & build size is ~4Gb (per build version).

You will find the libraries in c:\boost\stage\

The intermediate files are located in c:\boost\bin.v2\ and sub folders