3
votes

Problem

compile boost to use it in cygwin environement with jam

Environement and my skills

First of all thank you for reading my message and I use windows 7 pentium i3 cygwin i686-w64-mingw32-g++. I am a beginner (10 000 lines of c c++ basic code, able to find in documentation when it is easy to find or more often in forum. Here I have fail during a week) I use a magic line to compile given by a friend: i686-w64-mingw32-g++ -g -static main.cpp -I/usr/i686-w64-mingw32/include -L/usr/i686-w64-mingw32/lib -ltesseract -llept -lgdi32 -lws2_32 i only know that -l is to link.

Context

I am working in a project of poker. I have a lot (order of 10^7) of probabilities to compute and it needs a lot of optimizations. I have found the source of the reference programs in this domain called Pokerstove. They have build libraries (my dream :o) ) en.wikipedia.org/wiki/PokerStove the source is here: https://github.com/andrewprock/pokerstove

What I have done and errors

To have those boost libraries I have reed in the documentation that: I need to install boost (header are not enough, I need libraries) And to install boost (in the documentation of poker stove they said it is not easy in windows, I believe it :o) ) I am trying to use bjam (information get from forum and official documentation) I have download sources of boost_1_54_0 sourceforge.net/projects/boost/files/boost/1.54.0/ renamed boost_1_54_0 to boost and put it in c: to have all in a folder in c:\boost then I have folow a french tutorial http://devtricks.wordpress.com/installer-boost-sous-windows-avec-mingw/ i have dowload boost-jam-3.1.17-1-ntx86.zip from sourceforge.net/projects/boost/files/boost-jam/3.1.18/boost-jam-3.1.18-1-ntx86.zip/stats/map put it in the foder c:\boost cd /cygdrive/c cd boost bjam stage --build-type=complete --build-dir="C:\Boost\build" --toolset=gcc --stagedir="C:\Boost" I had bash: bjam : commande introuvable (unknown command in french) so i add "./" before

and I had finally:

$ ./bjam stage --build-type=complete --build-dir="C:\Boost\build" --toolset=gcc
--stagedir="C:\Boost"
warning: mismatched versions of Boost.Build engine and core
warning: Boost.Build engine (C:\boost\bjam.exe) is 03.1.17
warning: Boost.Build core (at C:/boost/tools/build/v2) is 2011.12-svn
Accès refusé.
Accès refusé.
Accès refusé.
Accès refusé.
C:/boost/tools/build/v2/util\path.jam:458: in makedirs
rule MAKEDIR unknown in module path.
C:/boost/tools/build/v2/util\path.jam:456: in makedirs
C:/boost/tools/build/v2/util\path.jam:456: in path.makedirs
C:/boost/tools/build/v2/build\configure.jam:233: in configure.set-log-file
C:/boost/tools/build/v2\build-system.jam:695: in load
C:\boost\tools\build\v2/kernel\modules.jam:289: in import
C:\boost\tools\build\v2\kernel\bootstrap.jam:139: in boost-build
C:\boost\boost-build.jam:17: in module scope

Accés refusé = acess refused in french ^^ And I have not the dll and .lib expected at this step in the tutorial

If someone have the solution or ideas... Thanks :) Feel free to ask more information or test if needed! Also feel free to tell me if the subject isn't at the right place or do not respect the standards.

Bests regards,

Barthelemy

1
For being a new user, great formatting and question asking.Wold

1 Answers

1
votes

There was two problems One was related to windows 7 There was a protection on files

To remove it : I have done:

 $ chmod -R a+r bin
 $ chmod -R a+x bin

It has fixed the

"Accès refusé".

The second problem was : It does not work with all combinations of boost and bjam.

bjam (3.1.18-1-ntx86) with Boost 1.44 works. Build Boost 1.45 using MinGW

I had in the new folder "build" 14 directory and 2613 files with the line:

bjam install --prefix="C:\MinGW" --build-type=complete --build-dir="C:\Boost\build" --toolset=gcc --layout=system

To test it you can create a file example.cpp

#include <boost/regex.hpp>
#include <iostream>
#include <string>

int main()
{
    std::string line;
    boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );

    while (std::cin)
    {
        std::getline(std::cin, line);
        boost::smatch matches;
        if (boost::regex_match(line, matches, pat))
        std::cout << matches[2] << std::endl;
    }
}

and a file

mail.txt

To: George Shmidlap
From: Rita Marlowe
Subject: Will Success Spoil Rock Hunter?
---
See subject.

then do:

$ g++ exemple.cpp -o exemple.exe -I"C:\Boost" -L"C:\Boost\lib" -lboost_regex-gcc-d-1_44.dll
exemple.exe < mail.txt

I have compiled in C:\Boost libboost_regex-gcc-d-1_44.dll.a

Just take the bold part from a file name to compile/build And you will have:

Will Success Spoil Rock Hunter?

Those informations are from a french document: http://devtricks.wordpress.com/installer-boost-sous-windows-avec-mingw/