This lesson is in the early stages of development (Alpha version)

Basic Setup - tested on OSX

Overview

Teaching: 30 min
Exercises: 30 min
Questions
  • How do I get started in scientific programing

Objectives
  • Learn how to use command line tools

  • Install software you need to do scientific programing

0. Back up your machine

We are going to be messing with your operating system at some level so it is extremely wise to do a complete backup of your machine to an external drive right now.

Also turn off automatic updates. Operating system updates can mess with your setup. Generally, back up before doing updates so you can revert if necessary.

1. Open a unix terminal window

First figure out how to open a terminal on your system. The Carpentries Shell Training has a section that explains this

This should be easy on Linux and OSX but a bit more complicated in Windows.

2. Learn how to use the Unix Shell

There is a nice tutorial from the Carpentries at: Unix Shell Basics.

It tells you how to start a terminal session in Windows, Mac OSX and Unix systems.

Please do the unix shell tutorial to learn about the basic command line.

3. Install some basic tools

You are going to need to install some common tools on your local machine

1. Install Git

Github is a repository for shared code. It is also a good place to back up your code and share with others. You will need to set up an account if you want to store things there. For now we are just going to use it to grab other people’s software so you don’t need to set up an account yet.

Start out by doing the setup/install section of the tutorial at https://swcarpentry.github.io/git-novice/02-setup.html to get started. You can come back and do the full tutorial later.

2. Get a compiler/code editor

Although you will mainly be using python to code to begin with, most HEP code is actually C++ and it is good to have access to a C++ compiler. Bonus is that you normally get a good editor as well.

OSX

Compiler/editor: On OSX, you should install Xcode from the App store. It will take a lot of disk space. When you try to use it it will ask you to install command line tools. Do so.

Compiler/editor: Even though Xcode is what you use to compile and has an editor, many people prefer to use the Visual Studio Code application from Microsoft for editing/testing code.

You can also use vim or emacs if you are old school.

Unix

Windows

Likely you should load up the full Visual Studio as it has a nice C++ compiler

3. Install an x-windows emulator

OSX

Install XQuartz

test it out by typing

xterm &

You should get a terminal window. You can close it.

Unix

Already have one

test by doing

xterm &

Windows

See the information about putty and xming.

4. Install Conda

See Next lesson

HSF Training Center

Unix Shell Basics

Git

Visual Studio Code

Visual Studio

GNU gcc

Xcode

XQuartz

Windows Subsystem for Linux

Key Points

  • This will be useful for a lot of projects

  • It is also something almost all people who get paid to program are expected to know well