Skip to content

Compiling

Landon Clipp edited this page Mar 21, 2017 · 3 revisions

Compilation

This program has essentially two options for compiling. The program can be compiled with either static libraries or with purely dynamic libraries. Remembering the difference between static and dynamic:

  • Static -- All libraries are compiled along with the executable. All library code is copied into the executable.
  • Dynamic -- Executable is linked to pre-compiled libraries. Library object code is NOT part of the executable but rather stored somewhere else in memory where multiple programs can use the same object code.

During development of this program, it is recommended that you compile the program dynamically unless you are doing large-scale tests (which may be I/O intensive and/or have large wall clock times). Dynamic compilation allows Valgrind to properly track memory allocations and frees. You will encounter severely reduced functionality out of Valgrind if you compile statically. However it must be noted that dynamic compilation is not optimized for performance, unlike static.

Two makefiles have been provided to aid in static or dynamic compilation. Simply copy the files "dynamicMakefile" or "staticMakefile" into the project's root directory as "Makefile".