Directives on Code Compilation and Dedicated Server
Directives on Code Compilation and Dedicated Server
In as much as we all like to use our own computers, it is best to have a single official course machine that everyone can log in to in
order to develop, test, etc. all submitted course work on. The machine for this is cs3400.cs.uwindsor.ca which is accessible to
everyone using SSH. This page provides additional details.
Note that you can use the terminal on your CS Server (i.e. Delta) as well to compile your code if the course dedicated server is
unavailable.
The cs3400.cs.uwindsor.ca machine is accessible using any modern Secure SHell (SSH) client. The SSH client is realdy installed in
Windows 11, MacOS, and Linux:
Under Windows:
SSH can be used by opening a PowerShell prompt and running "ssh [email protected]". (Replace
your-uwinid with your UWinID.)
If you want to use SSH from within a Windows Subsystem for Linux session, then run "ssh your-
[email protected]" at a command prompt within that session. (Replace your-uwinid with your UWinID.)
You can also download the freeware MobaXTerm, which is an SSH client, to access SSH servers such
as cs3400.cs.uwindsor.ca as well. (This is likely necessary if you are using an older version of Windows as SSH is
not with PowerShell and Windows Subsystem for Linux may not be available with an older version of Windows.)
Under MacOS:
MacOS is BSD Unix under the hood. Open up a terminal window and at the command prompt run "ssh your-
[email protected]". (Replace your-uwinid with your UWinID.)
Under Linux:
Open on a terminal window and at its command prompt run "ssh [email protected]". (Replace
your-uwinid with your UWinID.)
Typically to access cs3400.cs.uwindsor.ca you will FIRST need to sign in to the University of Windsor's network using Global Protect
VPN before connecting with SSH will work. The Global Protect VPN client is available from the following locations:
If the UWindsor links above are not sufficient then search uwindsor.ca for more help and/or go to the ITS helpdesk seeking more
help. The information is provided here for your convenience only.
With GCC C++20: g++ -std=c++20 -Wall -Wextra -Wold-style-cast -Werror -pedantic -O3 -march=native program.cxx -
latomic -ltbb
With GCC C++23: g++ -std=c++23 -Wall -Wextra -Wold-style-cast -Werror -pedantic -O3 -march=native program.cxx -
latomic -ltbb
With Clang C++20: clang++ -std=c++20 -Wall -Wextra -Wold-style-cast -Werror -pedantic -O3 -march=native program.cxx -
latomic -ltbb
etc.
where:
-std=c++20 tells the compiler to compile the C++ code using the C++20 standard
-std=c++23 tells the compiler to compile the C++ code using the (not yet released) C++23 standard
-Wall -Wextra turns on all warnings
-Wold-style-cast warns about using "old (C) style casts" --which are prohibited to be used in this course unless explicit
instructions are given permitting the use of such
-Werror treats all warnings as errors (expect marks to be deducted if your code when compiled emits any warnings)
-pedantic is strict about conforming to ISO C++ syntax (e.g., GCC extensions will not be enabled)
-O3 turns on maximum optimizations
-march=native tells the compiler to compile the code using machine code for the hardware the compiler is running on
-pthread might be needed when compiling code using threads
program.cxx is the program name
-latomic is needed when linking to libatomic.so is needed (e.g., in certain cases when using atomics)
-ltbb is needed when using C++ parallel algorithms since GCC uses the Threaded Building Block (TBB) library to implement
C++ parallel algorithms
-lpthread may be needed when linking code using threads
If you need to compile with other settings such as debug (e.g., -g) then add those arguments. See the g++ man page for more detail.
The compiler to be used in this course is GCC installed on cs3400.cs.uwindsor.ca, i.e., the version that is installed with Debian
testing (i.e., GCC 13.2.0), unless otherwise explicitly stated in a specific assessment/activity/context and only for such. If you choose
to use your own computer that is your choice and is at your own risk. Ensure you check that your code properly compiles and runs
on cs3400.cs.uwindsor.ca before submitting it.