Department of Engineering

IT Services

Using C++ on Macs

The Remote access from MacOS page has information about using a Mac to access the CUED machines. This page contains only the essentials

Working remotely

If you want to run CUED's geany program you can

  • Run the "X11 subsystem" on your Mac (on newer systems it's call X Quartz and you may need to download it from the Apps store)
  • In the resulting window, type
          slogin -X YOUR_CRSID@gate.eng.cam.ac.uk
    
    and type your engineering password. You might get warnings - don't worry.
  • Type
          slogin -X ts-access
    
    and type your password if asked for it.
  • Type
          geany     
    

Working on your Mac

If you want to program on your Mac (rather than logging into CUED) you should be ok. Macs usually have the g++ or clang compiler and Xcode (which has the same role as genie). They're sometimes an optional extra when the operating system's installed, so you might not have them by default. Or you can download them later.

Xcode is overkill, but you might get used to it. An alternative is to type commands rather than click on icons. If you start a terminal window, type

   emacs prog1.cc

Then type in and save a program. Exit from the emacs editor, then type

   g++ -o prog1 prog1.cc

(or on newer Macs)

   clang -o prog1 prog1.cc

which is the command-line equivalent of clicking on geany's brick icon. Typing

   ./prog1

runs the program. You can use up-arrow to retrieve your previous commands, so it's not such a slog. All the programs you've so far written will work on Macs once they're recompiled.

p.s. On the command line

   ls 

list your files.