diff --git a/basic_test.cpp b/basic_test.cpp index 3155fc6..6c58c25 100755 --- a/basic_test.cpp +++ b/basic_test.cpp @@ -1,4 +1,4 @@ -#include "gtest/gtest.h" +#include #include #include @@ -12,12 +12,6 @@ using namespace std; -//---------------------------------------------------------------------------------------- -// COPY BASIC_TEST INTO THIS FILE. -// AND THEN, -// DO NOT EDIT THIS FILE ANY FURTHER -//---------------------------------------------------------------------------------------- - bool basic_test(bool debug=false) { const int MAX = 20; @@ -54,13 +48,6 @@ TEST(BASIC_TEST, BasicTest) } -int main(int argc, char **argv) { - ::testing::InitGoogleTest(&argc, argv); - std::cout<<"\n\n----------running basic_test.cpp---------\n\n"< 00_lab_0 git:(master) βœ— 😊 $> tree includes @@ -74,7 +61,6 @@ includes 2 directories, 4 files 00_lab_0 git:(master) βœ— 😊 $> ./build/bin/basic_test -----------running basic_test.cpp--------- [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from BASIC_TEST diff --git a/images/mac/a-00-clang_version.png b/images/mac/a-00-clang_version.png new file mode 100644 index 0000000..3e99850 Binary files /dev/null and b/images/mac/a-00-clang_version.png differ diff --git a/images/mac/a-00-git_version.png b/images/mac/a-01-git_version.png similarity index 100% rename from images/mac/a-00-git_version.png rename to images/mac/a-01-git_version.png diff --git a/images/mac/a-01-cmake_version.png b/images/mac/a-02-cmake_version.png similarity index 100% rename from images/mac/a-01-cmake_version.png rename to images/mac/a-02-cmake_version.png diff --git a/mac.md b/mac.md index 245363e..63a67c7 100644 --- a/mac.md +++ b/mac.md @@ -1,98 +1,122 @@ # Mac Instructions
-- ### [Installing `git`](#mac_installing_git)
-- ### [Installing `cmake`](#mac_installing_cmake)
+- ### [Installing `Xcode`](#mac_installing_Xcode)
+- ### [Installing `CMake`](#mac_installing_cmake)
+- ### [Configuring `Git`](#mac_configure_git)
---
- -## Installing git -
- -### Install git + -We use [homebrew](https://brew.sh/) to [install git](https://git-scm.com/download/mac). +## Installing Xcode -```sh -$ brew install git -``` +You need to install **Xcode Command Line Tools** to use **clang** and **git** -If you see "brew: command not found", then you need to install brew. +### Install Xcode Command Line Tools -```sh -$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +To install Xcode Command Line Tools in your terminal, run: +```shell +xcode-select --install +``` +Click install and wait until the installation completes -# The following two lines for Apple M1 Processor +### Check clang installation -# you can find the following command in terminal -$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/YOUR_DEVICE_NAME/.zprofile +Let's make sure clang is installed correctly -$ eval $(/opt/homebrew/bin/brew shellenv) +```shell +clang --version ``` -You need to install **Xcode** from App Store before you use other IDE. +git version -
+If you do not get a response similar to this, then you do not have `CMake` on your system. ### Check git installation To make sure git is installed correctly -```sh -$ git --version +```shell +git --version ``` -git version +git version -
-### Login git -Login git with username and email address: + -```sh -$ git config --global user.name "stephengineer" -$ git config --global user.email "swang03@pasadena.edu" -``` +## Installing cmake ---- +### Install cmake -
+We use homebrew to install [CMake](https://cmake.org/): - +```shell +brew install cmake +``` -## Installing cmake +If you see `brew: command not found`, then you need to install brew. + +```shell +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +```
-### Install cmake +### Check CMake version -We use homebrew to install [cmake](https://cmake.org/): +To check to see if `CMake` is installed successfully: -```sh -$ brew install cmake +```shell +cmake --version ``` +cmake version +
-### Check cmake version -Let's check to see if `cmake` is installed successfully: + + +## Configuring git + +### Configure git + +Configure git with your username and email address: -```sh -$ cmake --version +```shell +git config --global user.name "stephengineer" +git config --global user.email swang03@pasadena.edu ``` -cmake version +### Install GitHub CLI -
+Installing the CLI + +```shell +brew install gh +``` -If you do not get a response similar to this, then you do not have `cmake` on your system and you have to install it. +To login to GitHub + +```shell +gh auth login +``` + +The CLI will step you through logging in with your github account --- -Once everything is installed, you can move on to the [next step](start_project.md) \ No newline at end of file +### After you have installed: +- **Xcode Command Line Tools** + - **clang** + - **git** +- **Cmake** +- **GitHub CLI** + +you can move on to the [next step](start_project.md) \ No newline at end of file diff --git a/start_project.md b/start_project.md index 895adb9..ea6a744 100644 --- a/start_project.md +++ b/start_project.md @@ -365,10 +365,10 @@ You should be able to right click on `CMakeLists.txt` and click on `Clean Reconf A prompt should appear on top, just click on similar compiler to: -- Mac: `Clang 13.0.0` +- Mac: `Clang X.X.X` compiler_mac -- Windows: `GCC 6.3.0 mingw` +- Windows: `GCC X.X.X mingw32` compiler_win
@@ -379,7 +379,7 @@ If it does not show up, you will need to manually select it on the bottom there
-- If it does not show `GCC 6.3.0 mingw32` click on that button and select it. +- If it does not show `GCC X.X.X mingw32` click on that button and select it. - If there is no option, try scanning for kits and try again. - If it still doesn’t show up, you probably messed up your Mingw installation. diff --git a/windows.md b/windows.md index fe5e862..8acb12d 100644 --- a/windows.md +++ b/windows.md @@ -1,18 +1,44 @@ # Windows Instructions
-- ### [Installing `git`](#win_installing_git)
-- ### [Installing `cmake`](#win_installing_cmake)
-- ### [Installing `MinGW`](#win_installing_mingw)
+- ### [Installing `MSYS2`](#win_installing_msys2)
+- ### [Installing packages with pacman](#win_installing_packages)
+- ### [Installing git and GitHub CLI](#win_installing_git)
---
- + -## Installing git +## Installing MSYS2 + +### Download installer +Download MSYS2 from [here](https://www.msys2.org). You should get an exe similar to this: `msys2-86_x64-20230718.exe` + +### Install MSYS2 +Run the exe and follow the instructions to install MSYS2 to a convenient directory like `C:/msys64`. Remember this directory as we will need it later. + +### Adding MSYS2 to your PATH +After the install has completed, go to **Edit the system environment variables** which can be accessed from the start menu and add the following to your PATH system environment variable `\ucrt64\bin` usually this is just `C:\msys64\ucrt64\bin` + + +## Installing GCC and CMake +Once MSYS2 has been installed and added to your PATH, open the MSYS2 bash and install all required packages using the following command: +```shell +pacman -Syu mingw-w64-ucrt-x86_64-{gcc,cmake} +``` +Before moving on, verify that both packages have been installed properly by trying these commands in a normal terminal (eg: cmd.exe): +```shell +gcc --version +cmake --version +```
+At this point, if you get an error about `gcc/cmake is not a recognized command`, double check your path is set correctly and then restart your terminal + + + +## Installing git ### Download `git` @@ -33,245 +59,46 @@ Open/run the executable, and follow the steps to install. You can safely stick w To make sure git is installed correctly ```sh -$ git --version +git --version ``` download_git
-### Login git +### Configure git -Login git with username and email address: +Configure git with username and email address: -```sh -$ git config --global user.name "stephengineer" -$ git config --global user.email swang03@pasadena.edu +```shell +git config --global user.name "stephengineer" +git config --global user.email swang03@pasadena.edu ``` +### Download the GitHub CLI ---- - -
- - - -## Installing cmake - -
- -### Download `cmake` - -Download cmake from [here](https://cmake.org/download/). Choose the Windows win64-x64 Installer. You should get an msi with a name similar to this: `cmake-3.19.4-win64-x64.msi` - -download_cmake - -
- -### Install `cmake` - -Open/Run the executable file, and follow the steps to install. - -install_cmake - -
- -Check I accept the terms in the License Agreement. - -install_cmake - -
- -**Make sure** to select Add CMake to the system PATH for all users. You can create a Desktop icon if you want, but you will not need to use it for this class. - -install_cmake - -
- -The default install location should be C:\Program Files\CMake\ - -> install_cmake - -
- -Install! +The GitHub CLI can be downloaded from [here](https://github.com/cli/cli/releases/latest). Download the windows amd64 installer, you should download an msi file like: `gh_2.32.1_windows_amd64.msi` -install_cmake +### Install GitHub CLI -install_cmake +Open the .msi and click through to install the GitHub CLI -
- -When it is done installing, click Finish. - -install_cmake - -
+### Login to GitHub -### Check the version of the git again: +To login to GitHub -Let's check to see if `cmake` is installed successfully: - -```sh -$ cmake --version +```shell +gh auth login ``` -cmake_version +The CLI will step you through logging in with your github account --- -
- - - -## Install MinGW - -
- -### Is `MinGW` installed? - -Let's check to see if `g++` is installed on your system: - -```sh -$ g++ --version -``` - -If you do not get a response similar to this, then you do not have `g++` and/or `MinGW` on your system and you have to install it. - -g++_version - -
- -### Download `MinGW` - -Download cmake from [here](https://sourceforge.net/projects/mingw/files/). You should get an exe named similar to this: `mingw-get-setup.exe` - -
- -### Install `MinGW`/`g++` - -Open/Run the executable file, and follow the steps to install. - -g++_install - -g++_install - -
- -The default Installation location should be `C:/MinGW`. Once again, you can add a Desktop shortcut, but it will not be necessary for this class. - -g++_install - -
- -If you get a warning that MinGW is already installed, you can either reinstall and continue with this walk through or choose `Run Now` and skip to the steps below with the MinGW Install Manager. - -g++_install - -
- -Installing... - -g++_install - -
- -When it is done installing, click Continue. - -g++_install - -
- -The **MinGW Installation Manager** should be opened up automatically. For this class, you will need mingw32-base, mingw-gcc-g++, and mingw23-gcc-objc. - -g++_install - -
- -To select a package for installation, right click on it in the menu and select Mark for Installation. - -g++_install - -
- -Marked packages will be selected like this: - -g++_install - -
- -You **also** need to select the pthreads package from under
-All Packages -> MinGW Libraries - -g++_install - -
- -Once all necessary packages have been marked, go to Installations > Apply Changes to install. - -g++_install - -
- -Click Apply - -g++_install - -
- -Once the changes are applied you may close the Installation Manager. - -g++_install - -
- -### Add g++ as a System Variable and to your path - -Search for "path" in the task bar search box. Open Edit the system environment variables. - -g++_path - -
- -Click on "Environment Variables..." - -g++_path - -
- -Add the path to the gcc and g++ executables to environment variables as shown below and press OK. - -g++_path - -
- -Next, double click on the **user variable** Path (in the top half of the window). A window like this should pop up: - -g++_path - -
- -Click New, and enter `C:\MinGW\bin` to the text box. Click OK. - -g++_path - -
- -Your environment and user variables should look like this after you are done: - -g++_path - -
- -### Check the version of the g++ again: - -To make sure `MinGW`/`g++` is installed correctly, if the version output doesn't show, reboot your machine and try again. - -```sh -$ g++ --version -``` - -g++_path - ---- +Once you have installed: +- **MSYS2** +- **GCC** +- **CMake** +- **git** +- **GitHub CLI** -Once everything is installed, you can move on to the [next step](start_project.md) +you can move on to the [next step](start_project.md)