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 called csci315 (use all lowercase, please).
  • Back in the local terminal, go to your directory for csci315. Run the following commands: (You should see the same sequence of commands suggested by gitlab in the gitlab browser window for the case of “Existing folder”.)
git config --global user.name "youruserid"
git config --global user.email "youruserid@bucknell.edu"
cd csci315
git init
git remote add origin git@gitlab.bucknell.edu:youruserid/csci315.git
touch README.md
git add README.md
git add .
git commit -m 'repo setup'
git push -u origin master
  • Return to your browser pointed at Gitlab, share your project with all CSCI315 professors and TAs (see the home page) by inviting them as a developer of your project (under “Project Information”->”Members”). Set your project to be unprotected so that the TAs can write grading comments to your project. Make sure to complete these two steps, otherwise your submissions will not be graded.

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.