This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:c4eng:fall2023:projects:abc0 [2023/08/19 20:15] – [Create and execute hello.c] mwinter4 | notes:c4eng:fall2023:projects:abc0 [2023/08/29 19:09] (current) – [Clone lab46 semester repo on your system] jparrish | ||
---|---|---|---|
Line 11: | Line 11: | ||
====Clone lab46 semester repo on lab46==== | ====Clone lab46 semester repo on lab46==== | ||
After you've logged into lab46 via shell, we'll be using Mercurial to clone a remote repository. | After you've logged into lab46 via shell, we'll be using Mercurial to clone a remote repository. | ||
- | This is done with the command: < | + | |
+ | You can accomplish this by running **fixrepo** at the lab46 prompt: | ||
+ | |||
+ | < | ||
+ | lab46:~$ fixrepo | ||
+ | </ | ||
+ | |||
+ | and follow and instructions, | ||
+ | |||
+ | Should you wish to do things more manually, do the following: | ||
+ | |||
+ | This is done with the command: < | ||
Where uppercase **USER** is replaced with your lab46 username, and lowercase **user** remains unchanged. | Where uppercase **USER** is replaced with your lab46 username, and lowercase **user** remains unchanged. | ||
This will clone the repository into a directory named //src// that is a subdirectory of your home (~) directory. | This will clone the repository into a directory named //src// that is a subdirectory of your home (~) directory. | ||
- | We will also be cloning a second repository for the semester, done with the command: < | + | We will also be cloning a second repository for the semester, done with the command: < |
Where **SEMESTER** is your semester written as the name of the month in lowercase and then the year in YYYY format, without spaces, e.g. <wrap hi> | Where **SEMESTER** is your semester written as the name of the month in lowercase and then the year in YYYY format, without spaces, e.g. <wrap hi> | ||
====Log into Lab46 wiki==== | ====Log into Lab46 wiki==== | ||
Line 31: | Line 42: | ||
Once Mercurial is installed, you may proceed. | Once Mercurial is installed, you may proceed. | ||
You should start by creating a directory anywhere you'd like, using the mkdir command, i.e. < | You should start by creating a directory anywhere you'd like, using the mkdir command, i.e. < | ||
- | Where **NAME** is the name you'd like to give the directory. | + | Where **NAME** is the name you'd like to give the directory. do not freak out when the terminal spits back nothing. the directory is created, and you should be able to see it by typing " |
After making this organizational directory, we will now clone the repo. | After making this organizational directory, we will now clone the repo. | ||
To do so, we'll use Mercurial' | To do so, we'll use Mercurial' | ||
- | < | + | < |
Where **NAME** is the name you gave the directory, and you are currently in its parent directory. | Where **NAME** is the name you gave the directory, and you are currently in its parent directory. | ||
Once that is done, we'll clone the semester repo: | Once that is done, we'll clone the semester repo: | ||
- | < | + | < |
Recall that **SEMESTER** is the lowercase name of the month and the year in YYYY format, without spaces. e.g. <wrap hi> | Recall that **SEMESTER** is the lowercase name of the month and the year in YYYY format, without spaces. e.g. <wrap hi> | ||
Line 49: | Line 60: | ||
====Create info.text file with information==== | ====Create info.text file with information==== | ||
Assuming we are currently in the **SEMESTER** directory, we can enter the abc0 project directory using < | Assuming we are currently in the **SEMESTER** directory, we can enter the abc0 project directory using < | ||
- | To create and edit <wrap hi>info.txt</ | + | To create and edit <wrap hi>info.text</ |
- | < | + | < |
- | This creates the file info.txt and starts editing it. You can see all the commands at the bottom of the terminal, with <wrap hi> | + | This creates the file info.text and starts editing it. You can see all the commands at the bottom of the terminal, with <wrap hi> |
+ | |||
+ | When you are finished editing the file, use the "Write Out" command and chose a format. Press enter to send the command. Then " | ||
+ | **Note, the ^ symbol correspond to the CRTL key and the M corresponds to the ALT key.** | ||
+ | |||
+ | If you wish to view this information, | ||
+ | < | ||
+ | This displays the content of the file on the terminal. It is most useful when you wish to view text files. | ||
====Create and execute hello.c==== | ====Create and execute hello.c==== | ||
Assuming we are still inside abc0, the next steps are writing a "Hello World" program in C, compiling, and then executing it. | Assuming we are still inside abc0, the next steps are writing a "Hello World" program in C, compiling, and then executing it. | ||
Line 66: | Line 84: | ||
Later we'll go into more depth on what the surrounding lines of code do, but for now we should know that <wrap hi> | Later we'll go into more depth on what the surrounding lines of code do, but for now we should know that <wrap hi> | ||
- | Now we want to //compile// this code into instructions that the computer can understand. We can do that simply using the GCC compiler: < | + | Now we want to //compile// this code into instructions that the computer can understand. We can do that simply using the GCC compiler: < |
+ | |||
+ | This will give us our executable as a file named hello, which we can now run by typing < | ||
+ | |||
+ | If everything has worked correctly, you should see "Hello World" printed to the terminal. | ||
====Locate journal and customize title and intro==== | ====Locate journal and customize title and intro==== | ||