CS360 Lecture notes -- Libfdr: Jvals, Fields, Dllists, Red-Black Trees

  • James S. Plank
  • Directory: ~jplank/cs360/notes/Libfdr
  • Lecture notes: http://web.eecs.utk.edu/~jplank/plank/classes/cs360/360/notes/Libfdr
  • Wed Aug 25 11:01:12 EDT 1999
  • Last change: Mon Jan 22 15:37:11 EST 2018
    With C, you lose the C++ standard template library, which is a major drag. To help you, I have a 20+ year old library of helper programs, which I call "Libfdr". There are four modules that compose libdr: Each of these has a set of lecture notes associated with them. You should read each of these to familiarize yourself with them. CS360 Lab 2 makes you use all of them.


    Obtaining the Source Code

    The source code is here in this directory, so if you have pulled the bitbucket repo, then you have the source code. Type make to make the precompiled library libfdr.a.

    On the University of Tennessee EECS Machines

    For the purposes of CS360, I have put the header files into the directory /home/jplank/cs360/include, and a compiled library into /home/jplank/cs360/objs. That way, you don't have to have copies of the programs sprinkled all over your lab directories. Obviously, if you are on a non-UT machine, you'll need to design out a way to compile and link the programs with your labs. I would prefer that you put them into a separate directory, though, so you can simply use mine when you are on the EECS machines.

    Compilation and Linking

    To compile your code, you need to use the complier flag -I/home/jplank/cs360/include. For example, if you have included ``fields.h'' and ``dllist.h'' in your program lab1.c, then your first compilation step is:
    gcc -g -I/home/jplank/cs360/include -c lab1.c
    
    That will make lab1.o. Now, when you go to link lab1.o into an executable, you need to link with /home/jplank/cs360/objs/libfdr.a:
    gcc -g -o lab1 lab1.o /home/jplank/cs360/objs/libfdr.a
    
    As always, you can do all of this in a makefile to make your life easier. We will provide makefiles for the first few labs. After that, you'll probably be on your own.