Home » source

Tag: source

How to build gnu parallel from source on Ubuntu PC?

Remarks:
1. This tutorial describes how to install gnu parallel (2014.07.22) from source on a Ubuntu 14.04 LTS PC, but it can be easily adapted for other versions of gnu parallel and/or Linux distributions.
2. For one-line solutions please see this comment and the subsequent reply.

Step 1: Create a new script

All required steps to install gnu parallel (2014.07.22) will be written in a script called GnuParallelSetup.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 GnuParallelSetup.sh

Step 2: Install dependencies and gnu parallel

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

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

/scripts/blob/master/scripts/linux/GnuParallelSetup.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
#!/bin/bash
 
###########################################################
#
#
# Gnu parallel (2014.07.22) setup
#
#
###########################################################
 
 
#----------------------------------------------------------
# Installing Gnu parallel
#----------------------------------------------------------
 
# Inform the user about the next action
echo "Downloading and installing Gnu parallel..."
 
# Constant values definitions
FOLDER_NAME="GnuParallel"
 
# Create a new folder for storing the source code
mkdir ${FOLDER_NAME}
 
# Change directory
cd ${FOLDER_NAME}
 
# Download source code
wget http://ftp.gnu.org/gnu/parallel/parallel-20140722.tar.bz2
 
# Extract archive
tar -xvjf parallel-20140722.tar.bz2
 
# Change directory
cd parallel-20140722
 
# Configure Gnu parallel for compilation
./configure
 
# Compile the project
make
 
# Install Gnu parallel in the default location
sudo make install
 
# Return to the parent directory
cd ../../
 
# Inform user that Gnu parallel was successfully installed
echo "Gnu parallel 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 GnuParallelSetup.sh using the following (excluding the “$” symbol):
$ chmod +x GnuParallelSetup.sh

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

How to install gnuplot from source on Ubuntu PC?

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

Step 1: Create a new script

All required steps to install gnuplot 4.6.5 will be written in a script called GnuplotSetup.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 GnuplotSetup.sh

Step 2: Install dependencies and gnuplot

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

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

/scripts/blob/master/scripts/linux/GnuplotSetup.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
 
###########################################################
#
#
# Gnuplot setup
#
#
###########################################################
 
# Starting setup of Gnuplot
echo "Setting up Gnuplot..."
 
 
#----------------------------------------------------------
# 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 Gnuplot
#----------------------------------------------------------
 
# Inform the user about the next action
echo "Downloading and installing Gnuplot..."
 
# Constant values definitions
FOLDER_NAME="Gnuplot"
 
# 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/gnuplot/files/gnuplot/4.6.5/gnuplot-4.6.5.tar.gz
 
# Extract archive
tar -xvzf gnuplot-4.6.5.tar.gz
 
# Change directory
cd gnuplot-4.6.5
 
# Configure gnuplot for compilation
./configure
 
# Compile the project
make
 
# Install gnuplot in the default location
sudo make install
 
# Return to the parent directory
cd ../../
 
# Inform user that Gnuplot was successfully installed
echo "Gnuplot 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 GnuplotSetup.sh using the following (excluding the “$” symbol):
$ chmod +x GnuplotSetup.sh

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