Changes

Jump to: navigation, search

Savy Cat

152 bytes added, 20:08, 27 March 2018
Rotate90
==== Building On Matrix ====
In order to get performance information using gprof, copy the CImg folder containing all source files to matrix. CImg is built to be cross-platform library and should work as is. Some background information on what makes that is possible [http://cimg.eu/reference/group__cimg__overview.html can be found here]. [http://cimg.eu/reference/group__cimg__environment.html Environment variables] are automatically set based on OS, routing the program to appropriate paths of logic.
Update Rotate.h to use the relative path:
#include "CImg-2.2.1/CImg.h"</nowiki>
Update Rotate.cpp to use relative paths to the .jpg files using Unix forward slash:
<nowiki>
Next, create a new folder to contain the built solution files.
From the extracted source folder ''jpeg-9c'', run the projects libjpeg configure script and specify the new folder you created with the following command:
./configure --prefix=/home/username/dps915/project/jpeg-build
The configure script sets the build path, checks system information, compiler settings, required files, and generates a new makefile.
Next, run make:
This compiles files within the source folder.
Finally, run the following, which will put libjpeg.a into a 'lib' folder within the build folder we created: jpeg-build/lib/.
make install
Now, build the Rotate Rotate90 source for profiling, linking libjpeg.a and X11 resources which are required for CImg Display functionality in a Unix environment. This prevents any errors during compilation, however, if we call the CImg display function, matrix will throw a run-time error of "Failed to open X11 display". I created the following makefile:
<nowiki>
clean:
rm *.o</nowiki>
 
==== Profiling With gprof ====
At last we can measure performance. Giving Rotate90.exe an initial run:
 
gprof -p -b Rotate90 > r90.flt
=== Assignment 2 ===
=== Assignment 3 ===
93
edits

Navigation menu