Compiling Software on UNIX. System Administration Decal Spring 2009 Lecture #4 George Wu Slides prepared by Joshua Kwan

Similar documents
CS155: Computer Security Spring Project #1

EL2310 Scientific Programming

The build2 Toolchain Installation and Upgrade

Application Management

Spring Modern Computer Science in a Unix Like Environment CIS c

TEMU installation and user manual

Exercise 1: Basic Tools

143a, Spring 2018 Discussion Week 4 Programming Assignment. Jia Chen 27 Apr 2018

CS197U: A Hands on Introduction to Unix

SSH Deploy Key Documentation

COPYRIGHTED MATERIAL. Installing Xcode. The Xcode Installer

Installing Python Modules

Applied Informatics POCO PRO C++ Frameworks

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

CMSC 311 Spring 2010 Lab 1: Bit Slinging

Introduction to the shell Part II

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Unix Tools / Command Line

Global-Net 2.0d Quick Installation

Installing SeisComP3

Lecture # 2 Introduction to UNIX (Part 2)

CS 1110 SPRING 2016: GETTING STARTED (Jan 27-28) First Name: Last Name: NetID:

Lab #1 Installing a System Due Friday, September 6, 2002

R- installation and adminstration under Linux for dummie

Slide Set 4. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

Intro to Linux & Command Line

Unzip zip files command line

Lab 2 Building on Linux

Singularity: container formats

Lecture 3: Web Servers / PHP and Apache. CS 383 Web Development II Monday, January 29, 2018

Manual Shell Script Linux If Not Equal String Comparison

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

Introduction to Linux

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

CSE 374 Programming Concepts & Tools. Hal Perkins Winter 2012 Lecture 16 Version control and svn

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo

Introduction to Linux

Test Lab Introduction to the Test Lab Linux Cluster Environment

Linux Software Installation Exercises 2 Part 1. Install PYTHON software with PIP

EL2310 Scientific Programming

GUIDE Development tools for Windows(10) installation... 2

Nexus Application Development - SDK

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

Getting started with Raspberry Pi (and WebIoPi framework)

CISC 220 fall 2011, set 1: Linux basics

3rd Party Application Deployment Instructions

Adding GNU/Hurd support to GNU Guix Porting GNU Guix to a new platform

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

Introduction to Pintos. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

GNU-AVR Building the GNU AVR Toolchain for Mac OS X and Linux

CS197U: A Hands on Introduction to Unix

How to install and build an application

CSC209. Software Tools and Systems Programming.

CSC209. Software Tools and Systems Programming.

APIs and API Design with Python

Setting up PostgreSQL

Unzip command in unix

Ubuntu unzip tar file

CS Unix Tools & Scripting Lecture 7 Working with Stream

Linux Systems Security. Backup and Change Management NETS Fall 2016

Platform Migrator Technical Report TR

Coding in C at Home. Part 2 Computational Physics. April 21, 2016

Installing and Using Docker Toolbox for Mac OSX and Windows

Chapter-3. Introduction to Unix: Fundamental Commands

PROGRAMMING PROJECT ONE DEVELOPING A SHELL

Lab 1: Accessing the Linux Operating System Spring 2009

CS 460 Linux Tutorial

Everything about Linux User- and Filemanagement

Lecture 1. A. Sahu and S. V. Rao. Indian Institute of Technology Guwahati

Introduction to Linux Spring 2014, Section 02, Lecture 3 Jason Tang

CptS 360 (System Programming) Unit 2: Introduction to UNIX and Linux

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

OpenSSL Software Foundation, Inc.

CS 356, Fall 2018 Data Lab (Part 2): Manipulating Bits Due: Mon, Sep. 17, 11:59PM

TECH 4272 Operating Systems

bwunicluster Tutorial Access, Data Transfer, Compiling, Modulefiles, Batch Jobs

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Introduction to Linux Environment. Yun-Wen Chen

bash Scripting Introduction COMP2101 Winter 2019

OpenSSL Software Foundation, Inc.

SDK. About the Cisco SDK. Installing the SDK. Procedure. This chapter contains the following sections:

Computer Center, CS, NCTU. Outline. FreeBSD version 9.0-RELEASE 9.1-RC1. Installing FreeBSD. From CD-ROM From USB

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

CS155: Computer Security Spring Project #1. Due: Part 1: Thursday, April pm, Part 2: Monday, April pm.

CS 105 Lab 1: Manipulating Bits

CS 361S - Network Security and Privacy Spring Project #2

Faculty of Computer Science Institute for System Architecture, Operating Systems Group. Complex Lab Operating Systems 2016 Winter Term.

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

Linux for Beginners. Windows users should download putty or bitvise:

Unleashing the Shell Hands-On UNIX System Administration DeCal Week 6 28 February 2011

Using LSF with Condor Checkpointing

Setting Up U P D AT E D 1 / 3 / 1 6

CPS221 Lecture: Operating System Protection

2 Installing the Software

System Administration for Beginners

CSCI2467: Systems Programming Concepts

bwunicluster Tutorial Access, Data Transfer, Compiling, Modulefiles, Batch Jobs

A Gentle Introduction to CMSC311 labs and CVS Or How I learned to use CVS in CMSC311. William Arbaugh September 2, 2004

Lab 5a Shell Script Lab 4 Using Arithmetic Operators in shell script

Data Lab: Manipulating Bits

Transcription:

Compiling Software on UNIX System Administration Decal Spring 2009 Lecture #4 George Wu Slides prepared by Joshua Kwan

Today How to turn source code into programs that run on Linux? What if that software needs other software to function? What if there s a problem during the build? Set up final project groups and assign virtual servers

Clarifications If you ve had problems doing labs because of account problems, use your shiny new virtual server! (later on) Running programs; the $PATH variable. check with echo $PATH PATH does not include current dir by default to run foo from your current directory, 3 must type./foo to tell the shell where it

Types of Software Packages Programs things you can run off the command line. Libraries software that other source code can use the functions from. Modules extension code written specifically to work with a certain program Script libraries code archives in languages like Python, Perl, Ruby for various purposes.

The Three-Step Procedure Step 0: Download and unpack source Generally, using the tar application. e.g. tar xvzf MyProg 1.0.tar.gz tar xvjf MyProg 1.0.tar.bz2 Step 1: Run./configure Prepares source for building on your particular system Step 2: Run make Compiles source files to binaries (if applicable) Step 3: Run make install Installs programs and data into system

The Three-Step Procedure This works in the majority (70-75%) of cases Many other software environments (e.g. scripting languages) have own system For example.. Python: python setup.py install Perl: perl Makefile.PL; make When in doubt, look for an INSTALL text file or a README

Patching Software When released software has issues, a code patch is released instead of a new version Generally come in the unified diff format, which the patch utility understands You should apply patches before you build, obviously - hence mentioning this here. 7

maildirtree 0.6/maildirtree.c~ 2008 10 07 14:19:42 0700 +++ maildirtree 0.6/maildirtree.c 2008 10 07 14:19:48 0700 @@ 103,7 +103,7 @@ { case 'h': puts(usage); exits(0); + exit(0); case 's': summary = true; Patch Example Example: patch p1 < fix.diff p1: If fix.diff wants to look for a/b/test.c, actually modify b/test.c. p2: fix.diff looks for a/b/test.c, actually modifies./test.c 99% of patches: Enter the source directory, then use p1 8

What is make? Powerful build system! You ll be using the GNU version of make in this class Lets you specify what to build, how to build (compiler and arguments), order to build in Includes strong dependency system Don t build my_program without having libprogram.a built already If I update foo.h, rebuild foo.c

Configuration Options Configure script generally has options; try./configure help You can enable features, point it to library install paths that it needs, use different compiler, etc. Reacting to a configure/build error often involves trying to find an option that will fix things.

Build Problems Missing library: Download, build and install the needed library Missing compiler: Install your OS s compiler distribution (e.g. Xcode or gcc package on Linux) Make sure to install the C development headers! Compilation error: Is your operating system supported by the author? You could try and fix it then submit your solution to the author!

Dependency Hell What if your program depends on libfoo? Download libfoo source and try to build libfoo depends on libbar! Download libbar source and try to build ad infinitum We call this Dependency hell Package systems in Linux distributions or ports in BSD-type distributions can help.

Want to install program on Ubuntu? Easy! apt get install program program and its dependencies will be installed from binary packages. Thus, apt get install program is equivalent to apt get install program libfoo libbar But: You can t customize; desired program may not have a package; no learning involved. Not allowed to do this for your final project Distribution Package Systems

Final Project We re giving you a virtual Linux server Your goal: combine several pieces of open source software to make a cool service. Groups of three or four. Find some partners! Your lab this week includes setting up user and administrator access for all group members.

Final Project Ideas IRC server and services (NickServ, ChanServ) Open-source game server (bzflag, OpenArena) Multiple OS network boot server (PXE/ DHCP) or any number of database-backed web applications... (using Apache/MySQL/etc.) 1

Virtual Servers If your server is ixy, login by doing: ssh p 2XY22 root@decal.ocf.berkeley.edu Change your root password immediately using passwd The lab will walk you through getting everything else set up. Talk to me about port forwarding for any network servers you want to run for the proj.