Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#58 closed enhancement (fixed)

EPD: install boost

Reported by: jemian Owned by: jemian
Priority: major Milestone:
Keywords: EPD boost Cc:

Description (last modified by jemian)

Francesco DeCarlo? requests on 2014-02-06:

we developed a python module that depends on Boost C++ (http://www.boost.org/). Do you know how to install this globally so that it is seen by the APS share installation of EPD python?

Change History (8)

comment:1 Changed 8 years ago by jemian

Pete responded 2014-02-06:

It's a non-trivial install. These are notes for me so I can pick them up later, once I can open a proper ticket.

comment:2 Changed 8 years ago by jemian

  • Description modified (diff)

comment:3 Changed 8 years ago by jemian

Francesco passed this on from his collaborators:

From: Gursoy, Doga
Sent: Thursday, February 06, 2014 10:59 AM
To: De Carlo, Francesco
Subject: Re: FW: python external dependencies

We don't need all Boost libraries. We need only these libs:

  • system
  • thread
  • date_time

comment:4 Changed 8 years ago by jemian

download this: http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz

First, develop and test installation procedure locally (on gov.aps.anl.gov):

cd /tmp
tar xzf boost_1_55_0.tar.gz
cd boost_1_55_0
./bootstrap.sh --help

./bootstrap.sh \
   --with-libraries=all \
   --without-libraries=mpi \
   --with-python=/local/epd/rh6-x86_64/bin/python \
   --prefix=$HOME/.local
./b2 install

This built and installed Boost in the location as described. Useful documents:

This test checks out OK.

pushd /tmp/boost_1_55_0/libs/python/test
../../../bjam

Looks like this generates embedded binaries (compiled C++ with Python interpreter added on) rather than Python extensions (import boost). Not satisfied with any of these yet as a complete procedure for /APSshare. Check with Francesco to see what he wants installed.


This page seems to have a clear method:

comment:5 Changed 8 years ago by jemian

Use this procedure

cd /APSshare/epd/rh6-x86_64
tar xzf /home/oxygen/JEMIAN/Downloads/boost_1_55_0.tar.gz
cd boost_1_55_0
./bootstrap.sh \
   --with-libraries=all \
   --without-libraries=mpi \
   --with-python=/APSshare/epd/rh6-x86_64/bin/python \
   --prefix=/APSshare/epd/rh6-x86_64
./b2 install

comment:6 Changed 8 years ago by jemian

test the installation with prog1:

// file:  prog1.cpp

#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>

int main()
{
    using namespace boost::lambda;
    typedef std::istream_iterator<int> in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );
}

// How to build and test this:
//     setenv BI /APSshare/epd/rh6-x86_64/
//     c++ -I ${BI} prog1.cpp -o prog1
//     echo 1 2 3 4 | ./prog1

test returns:

3 6 9 12
Last edited 8 years ago by jemian (previous) (diff)

comment:7 Changed 8 years ago by jemian

test the installation with prog2:

// file:  prog2.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;
    }
}

// How to build and test this:
//     setenv BI /APSshare/epd/rh6-x86_64/
//     setenv BD /APSshare/epd/rh6-x86_64/boost_1_55_0
//     c++ -I ${BI} prog2.cpp -o prog2  ${BI}/lib/libboost_regex.a
//     prog2 < jayne.txt

where jayne.txt contains:

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

From: Gursoy, Doga
Sent: Thursday, February 06, 2014 10:59 AM
To: De Carlo, Francesco
Subject: Re: FW: python external dependencies

We don't need all Boost libraries. We need only these libs:

    system
    thread
    date_time 

test returns:

Will Success Spoil Rock Hunter?
FW: python external dependencies
Last edited 8 years ago by jemian (previous) (diff)

comment:8 Changed 8 years ago by jemian

  • Resolution set to fixed
  • Status changed from new to closed

installed, should update tomorrow morning

bash

export BOOST_ROOT=/APSshare/epd/rh6-x86_64
export BOOST_SRC=${BOOST_ROOT}/boost_1_55_0

tcsh

setenv BOOST_ROOT /APSshare/epd/rh6-x86_64
setenv BOOST_SRC ${BOOST_ROOT}/boost_1_55_0

local documentation

firefox ${BOOST_SRC}/index.html

WWW documentation

firefox http://www.boost.org/doc/libs/1_55_0/index.html
Note: See TracTickets for help on using tickets.