ENEE150 Discussion 01 Section 0101 Adam Wang
Overview Log into GLUE Create a simple hello world program Compile it with gcc and submit
What is GLUE? Basically a network of computers owned by UMD You will submit your assignments to it so we can look at them Kind of like the cloud You will log into it by SSHing into linux.glue.umd.edu NOT glue.umd.edu
PuTTY SSH client SSH stands for Secure Shell Basically lets you remotely login to the GLUE computers
Login to GLUE If you have a mac/linux just use terminal Type “ssh linux.glue.umd.edu” If you’re using windows download PuTTY if you haven’t Linux.glue.umd.edu as the hostname and connect Login using regular UMD credentials
Glue is a UNIX environment Command-line interface, made around 1970s “Dark room” environment You basically ask the computer to show what you want
Basic UNIX commands
pwd Print working directory Used to show where you currently are
ls Displays all files and folders currently within your pwd Use “ls –l” to display even more information
mkdir Creates a new directory Make a folder called “ENEE150” in your home directory by typing “mkdir ENEE150”
cd Change directory We will navigate into the ENEE150 directory by typing “cd ENEE150” If you hit tab the computer will try to autocomplete the file/folder name You can go to parent directory by typing “cd ..”
emacs Basic text editor, like eclipse/notepad/etc. You can use vi/any alternative In the ENEE150 folder, type “emacs hello.c” to create/edit our first hello world program
Our first program Type Ctrl-x, Ctrl-s to save Type Ctrl-x, Ctrl-c to close the window
Compile using GCC Gcc stands for GNU compiler collection Basically transforms your code into an executable file Type “gcc hello.c” to compile your program This will create a file called a.out which can be executed If you type “gcc hello.c –o hello.x” it will name the executable hello.x instead of a.out Type a.out to run your program
Submit your file The format is “submit year semester class class# section assignment# filename” Type “submit 2017 fall enee 150 0101 0 hello.c” to submit your file to me Submit under assignment #0 as a test HWs will be assignment #1,2,3,… Projects will be assignment #10,20,30,… Submitting multiple times is ok, we will take the latest submission
Extra info
More UNIX commands Mv filename location “cut” Cp filename location “copy & paste” Rm name remove file Rm –r name remove a folder
MobaXterm I recommend this over puTTY More features
Cygwin Portable Unix terminal for Windows Lots of features & packages that come with it
WinSCP You can make the program on your own computer, then copy it over to glue Instead of writing your projects on glue
Final Words Make Backups Style is important Don’t Cheat Coding is UNFAIR