Skip to main content

Goals

  • Set up your git repository.
  • Reinforce what you know about the C build process.

Credits

The material developed for this lab was developed by Prof. L. Felipe Perrone. Permission to reuse this material in parts or in its entirety is granted provided that this “credits” note is not removed. Additional student files associated with this lab, as well as any existing solutions can be provided upon request by e- mail to:

perrone[at]bucknell[dot]edu


Preparing for CSCI 315 Labs

Choose a programming text editor to use. In CSCI 315 labs, we will not use any IDE (such as Eclipse or Visual Studio) so that you develop more of your self-reliance. You should ditch gedit for programming, if you haven’t done so yet. Instead, you should work with choose one of the two following editors to master:

  • vim (classic; uses small amount of memory; widely available on barebones environments)
  • emacs (classic; not so small memory footprint)

There are reference cards and tutorials for these editors everywhere on the Internet; find one that works for you and practice working with it before our lab exercise. You will want to know how to create new files, open files, save files, and use any editor functionality that might help you when writing programs.

Set Up

All the work for the lab component of this course will be turned in via a git repository. You need to take the time now to set up your repo!

  • If you never generated your own ssh keys, open a terminal and run the ssh-keygen as follows.
    • Be sure to use the C option to specify your bucknell email (with quotes):

      ssh-keygen -t rsa -b 4096 -C “<your userid>@bucknell.edu”
    • Press enter to use the default file name for your key files.
    • Press enter to use an empty passphrase.
  • Still at the terminal, in your home directory, create a directory called csci315, where you will put all the work for this class.
  • Next, create the directories indicated below (man 1 mkdir) – please make sure to follow the same capitalization convention:
    • Inside ˜/csci315, create a directory called Labs
    • Inside ˜/csci315/Labs, create a directory called Lab0
    • Inside ˜/csci315/Labs, create a directory called Lab1
    • In future labs, you will need to create one such directory for each of the labs.
  • Open a web browser and follow the link https://gitlab.bucknell.edu to access  our Gitlab installation.
  • Authenticate with your Bucknell credentials.
  • Create a new (blank) project ; in the field Project name enter csci315 (all in lowercase!). Leave the visibility level at “private”.
  • Still in Gitlab, follow the link to your newly created project. Look to the menu on the left and go to Manage and then to Members. There will be a blue button on the right that reads “Invite members“. Use this feature to add all the instructors and TAs for the course (see the home page) by inviting them to join your project with the role of Maintainer. Don’t fill in the optional expiration date. Make sure to complete these steps, otherwise your submissions will not be graded.
  • Go back to the local terminal and run the sequence of commands below making sure to substitute YOURUSERID for your actual Linux user id:
cd ~
git clone https://gitlab.bucknell.edu/YOURUSERID/csci315
cd csci315
mkdir Lab0; touch Lab0/README.txt; git add Lab0/README.txt
mkdir Lab1; touch Lab1/README.txt; git add Lab1/README.txt
mkdir Lab2; touch Lab2/README.txt; git add Lab2/README.txt
mkdir Lab3; touch Lab3/README.txt; git add Lab3/README.txt
mkdir Lab4; touch Lab4/README.txt; git add Lab4/README.txt
mkdir Lab5; touch Lab5/README.txt; git add Lab5/README.txt
mkdir Lab6; touch Lab6/README.txt; git add Lab6/README.txt
mkdir Lab7; touch Lab7/README.txt; git add Lab7/README.txt
mkdir Lab8; touch Lab8/README.txt; git add Lab8/README.txt
mkdir Lab9; touch Lab9/README.txt; git add Lab9/README.txt
mkdir Lab10; touch Lab10/README.txt; git add Lab10/README.txt
git commit -m “lab setup”

Dig deeper into git. You have a wide choice of web sources at your disposal, if you look around, and you should try to find one that explains the basic operation of git in a way that you can understand. Here’s one tutorial to get you started; feel free to look for others if you don’t like it. YouTube has many interesting video tutorials, if your learning style is more visual.

Take a look at this! One of our awesome TAs pointed us to this web resource (http://cdecl.org), which can help you “translate” a line of C gibberish (ahem, beautiful source code) into English. It might come in handy when you are trying to understand whether the code you wrote really means what you think it means.

This prelab has three problems. Write the answers to these questions in a text file named “lab0.txt” with the following header.

Your name
Your email
Your specific lab section (e.g., CSCI315L61)
Your specific lab instructor’s name
Your TA’s name

You can find these information at the course website, https://csci315fa2024.courses.bucknell.edu

Then write your answer to Problem 1 in the “lab0.txt” file. Problem 2 and 3 are done in Google Classroom.

Problem 1  (5 points)

Take a minute to think about the values, the facts, the experiences that define you as a person. Make a list of three of the points that you find most relevant and list the preferred pronouns we should use when referring to you. Write them down in “lab0.txt.”

Once you are done with this problem, add, commit, and push the file to your gitlab.

git add lab0.txt
git commit -m "lab0.txt completed"
git push

Problem 2 (10 points)

This problem can be found in your section of Google Classroom. You will watch a YouTube video on debugging and answer an online quiz. Note that your pre-lab quiz must be completed by 8:00am on the day of the lab session.

Problem 3 (15 points)

This problem can be found in your Google Classroom. In preparation for it, spend some time reading and learning about GNU make. There are multiple fine tutorials online and you should look for one that is best suited to your learning style, but here’s one to get you started. Note that you are not trying to become the master of make; you are doing the best to learn a foundation to build upon during the semester. Once you are satisfied, go to your lecture section of Google Classroom and answer the quiz questions for this problem.  Again, your pre-lab quiz must be completed by 8:00am on the day of the lab session.

Grading Rubric

  • Problem 1 – [5 points] for completion.
  • Problem 2 – [10 points] assigned according to the quiz results.
  • Problem 3 – [15 points] assigned according to the quiz results.