SPO600 Lab4 -GCC Build Lab
In this lab, we are practicing about building large software project, utilizing tools such as make and automake/autotools. I will work on two server, x86-001 and aarch64-002
Task - on each of the servers, obtain build and install the source code for the current development version of the GCC compiler.
Step 1 - Obtain the source code
step 1.1
the command to create a directory for cloning the GCC source code:
mkdir gccsource
step 1.2
command to clone the source code into the current directory:
git clone git://gcc.gnu.org/git/gcc.git ./gccsource
Step 2 - Configure the build
Create a directory for the build of GCC and go into it. We use this directory to build the ggc so that the files created during the build go into this directory. Commands:
mkdir gcc-build-003
cd gcc-build-003
step 2.2
When I configure the build, I do not want the new GCC wipe out the original gcc in the server. So, I use the --prefix=$HOME/spo600/lab4/gcc-test-003 to set the target directory of the install when i configure. Full command:
../gccsource/configure --prefix=$HOME/spo600/lab4/gcc-test-003
Step 3. Perform the build
We perform the build with the command:
time make -j 24 |& tee build.log
time is the shell built-in command for record the time of the build
-j option is the specific the maximum number of job which make will execute simultaneously.
|& is equivalent to 2>&1 | which gather the stdout and stderr and pipe it to the tee command, while the tee command is to record the data to the named file.
Step 4. Install the build
step 4.1
command to install the build:
make install
command to check the version:
./gcc --version
gcc --version
in the aarch64 server:
gcc version we just installed:
default gcc version of the server:
gcc version we just installed in:
default gcc version of the server:
step 4.2
in the aarch64 server:
create a c file for test:
Step 5 - update the timestamp of the pass.cc
Step 6 - Rebuild the software after update the timestamp
Step 7 - Null Rebuild the software (did not update any timestamp after the last build)
time required for x86 server:
Comments
Post a Comment