0% found this document useful (0 votes)
52 views

Software Development On Linux Platforms (Cygwin, Etc.)

This document introduces software development on Linux platforms using Cygwin. It discusses installing and using Cygwin, which provides a Linux-like environment for Windows. It covers mounting file systems, using the text editor vi, modifying environment variables in the .bashrc file, starting the X-server for GUI applications, and using the GTK toolkit to create graphical user interfaces. The document encourages readers to download Cygwin and familiarize themselves with Linux commands through examples and exercises.

Uploaded by

Teto Schedule
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Software Development On Linux Platforms (Cygwin, Etc.)

This document introduces software development on Linux platforms using Cygwin. It discusses installing and using Cygwin, which provides a Linux-like environment for Windows. It covers mounting file systems, using the text editor vi, modifying environment variables in the .bashrc file, starting the X-server for GUI applications, and using the GTK toolkit to create graphical user interfaces. The document encourages readers to download Cygwin and familiarize themselves with Linux commands through examples and exercises.

Uploaded by

Teto Schedule
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

INTRODUCTION TO DESIGN AUTOMATION

Lecture 2.
Software Development on Linux
Platforms (Cygwin, etc.)
Guoyong Shi, PhD
[email protected]
School of Microelectronics
Shanghai Jiao Tong University
September, 2010

2010-9-10 Slide 1
Outline
• The Linux emulator on Windows - CYGWIN
• Cygwin installation etc.
• A GUI toolkit GTK

2010-9-10 Lecture 2 slide 2


CYGWIN – Free Software
• GNU + Cygnus + Windows = CYGWIN

• What is Cygwin?
ƒ Cygwin is a Linus-like environment for Windows.

• Where to get Cygwin?


ƒ http://www.cygwin.com/

• Cygwin follows GNU General Public License (GPL),


meaning Cygwin is free software.

2010-9-10 Lecture 2 slide 3


How to Install Cygwin
• Click “Install Cygwin now” icon on the Cygwin
homepage.
• Download Cygwin binaries to a Windows
directory you select.
• Follow the instructions for installation.
• Choose to “install all” packages if you are not
familiar with how to choose the packages.

• Install Cygwin at C:\cygwin


ƒ Cygwin package is now very big ( > 2GB)
• The latest release is Cygwin 1.7.7 (with qt4)

2010-9-10 Lecture 2 slide 4


Use Cygwin
• Cygwin is a complete Unix/Linux system
ƒ but runs on the Windows OS.
• So try to learn some Linux basics before you
use Cygwin
ƒ command line commands
ƒ environment setup
ƒ shell scripts (advanced)
• Most important things:
1. Set up a basic environment (consult TA)
2. Install a text editor: vi (or gvim)
3. Cygwin includes “vi”.

2010-9-10 Lecture 2 slide 5


Use Cygwin
• After successful installation, you’ll see the
Cygwin icon on you desktop.
• Double click the icon, you see a black window
pops up.

This window is exactly a


Linux window.
You may type in any Linux
commands.

You may also choose to install a


Linux virtual machine.

2010-9-10 Lecture 2 slide 6


To access files
• Use the “mount” command to mount your
Windows file system.
• To mount your C: disk
ƒ mount c: /c/
• After that, you can assess a file at
C:\mydir\myfile.txt by typing
ƒ cd /c/mydir/
ƒ ls (listing all files there)
ƒ vi myfile.txt (use vi to edit the file)

2010-9-10 Lecture 2 slide 7


Edit a text file
• Cygwin has a home dir (depending on machine)
ƒ cd (just type cd at any dir)
ƒ pwd (show the current path)
• You see “/home/[computer_name]”
• Type
ƒ ls –a (-a means “to list all”)
• You should see a file named “.bashrc” among others.
ƒ If not, ask TA to create one.
• “.bashrc” is a shell file where you can define some
environment variables. Type
ƒ vi .bashrc

2010-9-10 Lecture 2 slide 8


Text Editor “vi” (or “gvim”
• “vi” is a popular text editor developed for
UNIX originally.
• It is available in Cygwin.
• There exists a Windows version called “gvim”
(a free software).

• Learn some basic text editing commands


specific to “vi”.

2010-9-10 Lecture 2 slide 9


Modify .bashrc
• At the end of the file “.bashrc”
• Add:
ƒ alias vi=‘/c/ “Program Files”/Vim/vim70/gvim’
ƒ (depending on your gvim installation)
ƒ export PATH=“.:$PATH”
ƒ (then you can execute a program directly at the current
directory)
ƒ export DISPLAY=“localhost:0”
ƒ (needed for running GTK applications with X-windows)
• Save “.bashrc”. Then $ source .bashrc
• Also, the newly started Cygwin window takes
effect.
• Try to add others if you know Bourne shell.

2010-9-10 Lecture 2 slide 10


Start X-Server
• The X-window server is included in the
Cygwin installation.
• You’ll see the icon with “X” on your
desktop or in the “Start” menu.
• Start the X-window server.
• This X-Server is needed for displaying
the GUI developed by the tool kits with
Cygwin – GTK or Qt4.

2010-9-10 Lecture 2 slide 11


Xming Server
• Another “free” X-server “Xming” is available
on the Internet.
• It is available at: sourceforge.net/projectsxming
• You have to install both the x-server and
fonts if decide to use Xming.

2010-9-10 Lecture 2 slide 12


GTK
• www.gtk.org
• GTK+ is a multi-platform toolkit for creating
graphical user interfaces (GUI).
• GTK+ is free software and part of the GNU
Project.
• You may download the GTK windows version.
ƒ In the extracted folder, there is a directory called
“example”.
ƒ You’ll find some GTK program examples.
• Cygwin has the GTK libraries, anyway.
2010-9-10 Lecture 2 slide 13
GTK
• Going through all the example programs is a
good way to learn new programming API’s.
• GUI programming is a little different from
other programming.

• We’ll walk through a simple GTK GUI example


to see how a GUI program works.

2010-9-10 Lecture 2 slide 14


Worm-up Exercise
• Download and install Cygwin and start
playing around.

• Or, install a Linux virtual machine and


familiarize yourself with the Linux OS.

• Choose a text editor or an IDE tool for your


coding.

2010-9-10 Lecture 2 slide 15

You might also like