Browse Source

Building boost from source, using g++ 4.8 to make it work on Ubuntu 12.04 and 14.04

Roel Standaert 11 years ago
parent
commit
9ae5025995
4 changed files with 29 additions and 16 deletions
  1. 14 10
      toolset/setup/linux/frameworks/wt.sh
  2. 11 0
      wt/bash_profile.sh
  3. 2 3
      wt/setup.py
  4. 2 3
      wt/setup_postgres.py

+ 14 - 10
toolset/setup/linux/frameworks/wt.sh

@@ -3,18 +3,22 @@
 RETCODE=$(fw_exists wt)
 RETCODE=$(fw_exists wt)
 [ ! "$RETCODE" == 0 ] || { return 0; }
 [ ! "$RETCODE" == 0 ] || { return 0; }
 
 
-# TODO can this be changed based on the OS we are using? This is not
-# available on 12.04 (libboost-all-dev is available, but requires some
-# apt-get cleaning before it can be installed)
-sudo apt-get -y install libboost1.54-all-dev
+fw_get http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz -O boost_1_55_0.tar.gz
+fw_untar boost_1_55_0.tar.gz
+cd boost_1_55_0
+echo 'using gcc : 4.8 : g++-4.8 ;' > tools/build/v2/user-config.jam
+./bootstrap.sh --prefix=${IROOT}/boost
+./b2 --toolset gcc-4.8 install
+cd ..
 
 
-fw_get http://downloads.sourceforge.net/witty/wt-3.3.3.tar.gz -O wt.tar.gz
-fw_untar wt.tar.gz
+fw_get http://downloads.sourceforge.net/witty/wt-3.3.3.tar.gz -O wt-3.3.3.tar.gz
+fw_untar wt-3.3.3.tar.gz
 
 
-mv wt-* wt
-cd wt
+cd wt-3.3.3
 mkdir -p build
 mkdir -p build
 cd build
 cd build
-cmake .. -DWT_CPP_11_MODE=-std=c++0x -DCMAKE_BUILD_TYPE=Release
+cmake .. -DWT_CPP_11_MODE=-std=c++0x -DCMAKE_BUILD_TYPE=Release \
+	-DBOOST_PREFIX=${IROOT}/boost -DCMAKE_INSTALL_PREFIX=${IROOT}/wt \
+	-DCONFIGDIR=${IROOT}/wt/etc -DCMAKE_CXX_COMPILER=$(which g++-4.8)
 make
 make
-sudo make install
+make install

+ 11 - 0
wt/bash_profile.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+export BOOST_ROOT=${IROOT}/boost
+export BOOST_INC=${BOOST_ROOT}/include
+export BOOST_LIB=${BOOST_ROOT}/lib
+
+export WT_ROOT=${IROOT}/wt
+export WT_LIB=${WT_ROOT}/lib
+export WT_INC=${WT_ROOT}/include
+
+export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"

+ 2 - 3
wt/setup.py

@@ -4,11 +4,10 @@ import setup_util
 
 
 def start(args, logfile, errfile, cwd='wt'):
 def start(args, logfile, errfile, cwd='wt'):
     setup_util.replace_text("wt/benchmark.cpp", "INSERT_DB_HOST_HERE", args.database_host);
     setup_util.replace_text("wt/benchmark.cpp", "INSERT_DB_HOST_HERE", args.database_host);
-    subprocess.check_call('g++ -O3 -DNDEBUG -std=c++0x -L/usr/local/lib -I/usr/local/include -o benchmark.wt benchmark.cpp -lwt -lwthttp -lwtdbo -lwtdbomysql -lboost_thread', shell=True, cwd=cwd, stderr=errfile, stdout=logfile)
-    os.environ['LD_LIBRARY_PATH'] = '/usr/local/lib:' + os.environ.get('LD_LIBRARY_PATH', '.')
+    subprocess.check_call('g++-4.8 -O3 -DNDEBUG -std=c++0x -L${BOOST_LIB} -I${BOOST_INC} -L${WT_LIB} -I${WT_INC} -o benchmark.wt benchmark.cpp -lwt -lwthttp -lwtdbo -lwtdbomysql -lboost_thread', shell=True, cwd=cwd, stderr=errfile, stdout=logfile)
     subprocess.Popen(['./benchmark.wt',
     subprocess.Popen(['./benchmark.wt',
         '-c', 'wt_config.xml',
         '-c', 'wt_config.xml',
-        '-t', str(args.max_threads * 4),
+        '-t', str(args.max_threads),
     	'--docroot', '.',
     	'--docroot', '.',
         '--http-address', '0.0.0.0',
         '--http-address', '0.0.0.0',
         '--http-port', '8080',
         '--http-port', '8080',

+ 2 - 3
wt/setup_postgres.py

@@ -4,11 +4,10 @@ import setup_util
 
 
 def start(args, logfile, errfile, cwd='wt'):
 def start(args, logfile, errfile, cwd='wt'):
     setup_util.replace_text("wt/benchmark.cpp", "INSERT_DB_HOST_HERE", args.database_host);
     setup_util.replace_text("wt/benchmark.cpp", "INSERT_DB_HOST_HERE", args.database_host);
-    subprocess.check_call('g++ -O3 -DNDEBUG -DBENCHMARK_USE_POSTGRES -std=c++0x -L/usr/local/lib -I/usr/local/include -o benchmark_postgres.wt benchmark.cpp -lwt -lwthttp -lwtdbo -lwtdbopostgres -lboost_thread', shell=True, cwd=cwd, stderr=errfile, stdout=logfile)
-    os.environ['LD_LIBRARY_PATH'] = '/usr/local/lib:' + os.environ.get('LD_LIBRARY_PATH', '.')
+    subprocess.check_call('g++-4.8 -O3 -DNDEBUG -DBENCHMARK_USE_POSTGRES -std=c++0x -L${BOOST_LIB} -I${BOOST_INC} -L${WT_LIB} -I${WT_INC} -o benchmark_postgres.wt benchmark.cpp -lwt -lwthttp -lwtdbo -lwtdbopostgres -lboost_thread', shell=True, cwd=cwd, stderr=errfile, stdout=logfile)
     subprocess.Popen(['./benchmark_postgres.wt',
     subprocess.Popen(['./benchmark_postgres.wt',
         '-c', 'wt_config.xml',
         '-c', 'wt_config.xml',
-        '-t', str(args.max_threads * 4),
+        '-t', str(args.max_threads),
     	'--docroot', '.',
     	'--docroot', '.',
         '--http-address', '0.0.0.0',
         '--http-address', '0.0.0.0',
         '--http-port', '8080',
         '--http-port', '8080',