Home » C++

Tag: C++

How to setup Buildbot slave on Ubuntu PC?

Remark: This tutorial describes how to setup Buildbot 0.8.9 slave on a Ubuntu 14.04 LTS PC, but it can be easily adapted for other versions of Buildbot and/or Linux distributions.

Step 1: Create a new script

All required steps to setup Buildbot 0.8.9 slave will be written in a script called BuildbotSlaveSetup.sh (assuming you do not have a file with that name in the current folder already).

To create the file write on the command line the following (excluding the “$” symbol):
$ touch BuildbotSlaveSetup.sh

Step 2: Install dependencies and Buildbot slave

Open the script using your favourite text editor. Assuming this is vi(m) write on the command line the following (excluding the “$” symbol):
$ vim BuildbotSlaveSetup.sh

Next write the contents of the script (i.e. copy and paste the text below into the script):

/scripts/blob/master/scripts/linux/BuildbotSlaveSetup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
 
###########################################################
#
#
# Install script for Buildbot slave 0.8.9
#
#
##########################################################
 
#--------------------------------------------------------
# Install dependent packages
#--------------------------------------------------------
 
# Inform the user about the next action
echo "Installing the dependent packages python2.7 python-setuptools python-pip...";
 
# Execute action
sudo apt-get -y install python2.7 python-setuptools python-pip
 
 
#--------------------------------------------------------
# Install Buildbot slave
#--------------------------------------------------------
 
# Inform the user about the next action
echo "Installing Buildbot slave...";
 
# Execute action
sudo pip install buildbot-slave
 
# Inform user that Buildbot slave was successfully installed
echo "Buildbot slave was successfully installed."

The comments in the script should provide enough details to understand what each instruction does.

Step 3: Execute script

Add execution permission to the script BuildbotSlaveSetup.sh using the following (excluding the “$” symbol):
$ chmod +x BuildbotSlaveSetup.sh

Finally execute the script as below (excluding the “$” symbol):
$ ./BuildbotSlaveSetup.sh

How to setup Buildbot master on Ubuntu PC?

Remark: This tutorial describes how to setup Buildbot 0.8.9 master on a Ubuntu 14.04 LTS PC, but it can be easily adapted for other versions of Buildbot and/or Linux distributions.

Step 1: Create a new script

All required steps to setup Buildbot 0.8.9 master will be written in a script called BuildbotMasterSetup.sh (assuming you do not have a file with that name in the current folder already).

To create the file write on the command line the following (excluding the “$” symbol):
$ touch BuildbotMasterSetup.sh

Step 2: Install dependencies and Buildbot master

Open the script using your favourite text editor. Assuming this is vi(m) write on the command line the following (excluding the “$” symbol):
$ vim BuildbotMasterSetup.sh

Next write the contents of the script (i.e. copy and paste the text below into the script):

/scripts/blob/master/scripts/linux/BuildbotMasterSetup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
 
###########################################################
#
#
# Install script for Buildbot master 0.8.9
#
#
##########################################################
 
#--------------------------------------------------------
# Install dependent packages
#--------------------------------------------------------
 
# Inform the user about the next action
echo "Installing the dependent packages python2.7 python-setuptools python-pip...";
 
# Execute action
sudo apt-get -y install python2.7 python-setuptools python-pip
 
 
#--------------------------------------------------------
# Install Buildbot master
#--------------------------------------------------------
 
# Inform the user about the next action
echo "Installing Buildbot master...";
 
# Execute action
sudo pip install buildbot
 
# Inform user that Buildbot master was successfully installed
echo "Buildbot master was successfully installed."

The comments in the script should provide enough details to understand what each instruction does.

Step 3: Execute script

Add execution permission to the script BuildbotMasterSetup.sh using the following (excluding the “$” symbol):
$ chmod +x BuildbotMasterSetup.sh

Finally execute the script as below (excluding the “$” symbol):
$ ./BuildbotMasterSetup.sh

How to install Xerces-C++ from source on Ubuntu PC?

Remark: This tutorial describes how to install Apache Xerces-C++ 3.1.1 from source on a Ubuntu 14.04 LTS PC, but it can be easily adapted for other versions of Xerces and/or Linux distributions.

Step 1: Create a new script

All required steps to install Xerces-C++ will be written in a script called XercesSetup.sh (assuming you do not have a file with that name in the current folder already).

To create the file write on the command line the following (excluding the “$” symbol):
$ touch XercesSetup.sh

Step 2: Install dependencies and Xerces-C++

Open the script using your favourite text editor. Assuming this is vi(m) write on the command line the following (excluding the “$” symbol):
$ vim XercesSetup.sh

Next write the contents of the script (i.e. copy and paste the text below into the script):

/scripts/blob/master/scripts/linux/XercesSetup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
 
###########################################################
#
#
# Xerces 3.1.1 setup
#
#
###########################################################
 
# Starting setup of Xerces
echo "Setting up Xerces..."
 
 
#----------------------------------------------------------
# Installing dependent packages
#----------------------------------------------------------
 
# Inform the user about the next action
echo "Installing the dependent packages build-essentials g++ gcc..."
 
# Execute the action
sudo apt-get -y install build-essentials g++ gcc
 
 
#----------------------------------------------------------
# Installing Xerces
#----------------------------------------------------------
 
# Inform the user about the next action
echo "Downloading and installing Xerces..."
 
# Constant values definitions
FOLDER_NAME="Xerces"
 
# Create a new folder for storing the source code
mkdir ${FOLDER_NAME}
 
# Change directory
cd ${FOLDER_NAME}
 
# Download source code
wget http://mirror.vorboss.net/apache//xerces/c/3/sources/xerces-c-3.1.1.tar.gz
 
# Extract archive
tar -xvzf xerces-c-3.1.1.tar.gz
 
# Change directory
cd xerces-c-3.1.1
 
# Configure Xerces for compilation
./configure
 
# Compile the project
make
 
# Install Xerces in the default location
sudo make install
 
# Return to the parent directory
cd ../../
 
# Inform user that Xerces was successfully installed
echo "Xerces was successfully installed."

The comments in the script should provide enough details to understand what each instruction does.

Step 3: Execute script

Add execution permission to the script XercesSetup.sh using the following (excluding the “$” symbol):
$ chmod +x XercesSetup.sh

Finally execute the script as below (excluding the “$” symbol):
$ ./XercesSetup.sh

How to install Boost from source on Ubuntu PC

Remark: This tutorial describes how to install Boost 1.55 on a Ubuntu 14.04 LTS PC, but it can be easily adapted for other versions of Boost and/or Linux distributions.

Step 1: Create a new script

All required steps to install Boost will be written in a script called BoostSetup.sh (assuming you do not have a file with that name in the current folder already).

To create the file write on the command line the following (excluding the “$” symbol):
$ touch BoostSetup.sh

Step 2: Install dependencies and Boost

Open the script using your favourite text editor. Assuming this is vi(m) write on the command line the following (excluding the “$” symbol):
$ vim BoostSetup.sh

Next write the contents of the script (i.e. copy and paste the text below into the script):

/scripts/blob/master/scripts/linux/BoostSetup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
 
###########################################################
#
#
# Boost 1.55 C++ libraries setup
#
#
###########################################################
 
# Starting setup of Boost 1.55
echo "Setting up Boost 1.55..."
 
 
#----------------------------------------------------------
# Installing dependent packages
#----------------------------------------------------------
 
# Inform the user about the next action
echo "Installing the dependent packages build-essentials g++ gcc libicu-dev..."
 
# Execute the action
sudo apt-get -y install build-essentials g++ gcc libicu-dev
 
 
#----------------------------------------------------------
# Installing Boost
#----------------------------------------------------------
 
# Inform the user about the next action
echo "Downloading and installing Boost 1.55..."
 
# Constant values definitions
FOLDER_NAME="Boost1.55"
 
# Create a new folder for storing the source code
mkdir ${FOLDER_NAME}
 
# Change directory
cd ${FOLDER_NAME}
 
# Download source code
wget http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.zip
 
# Extract archive
unzip boost_1_55_0.zip
 
# Change directory
cd boost_1_55_0
 
# Run the script which prepares Boost's build process
sudo ./bootstrap.sh --prefix=/usr/local --with-libraries=all
 
# Compile the project
sudo ./b2 install
 
# Add the Boost libraries path to the default Ubuntu library search path
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/boost.conf'
 
# Update the default Ubuntu library search paths
sudo ldconfig
 
# Return to the parent directory
cd ../../
 
# Inform user that Boost 1.55 was successfully installed
echo "Boost 1.55 was successfully installed."

The comments in the script should provide enough details to understand what each instruction does.

Step 3: Execute script

Add execution permission to the script BoostSetup.sh using the following (excluding the “$” symbol):
$ chmod +x BoostSetup.sh

Finally execute the script as below (excluding the “$” symbol):
$ ./BoostSetup.sh