24
Desig n Developing Software on Linux Tim Marriott Mel Nicholson ICCAD 2003

Developing Software on Linux

  • Upload
    dagmar

  • View
    41

  • Download
    0

Embed Size (px)

DESCRIPTION

Developing Software on Linux. Tim Marriott Mel Nicholson ICCAD 2003. Introduction. Why Linux? Porting to Linux Developing on Linux. Why Linux?. The question should be “Why the PC?” Inexpensive Performance What is wrong with Windows as the OS? It is too different from Unix - PowerPoint PPT Presentation

Citation preview

Page 1: Developing Software on Linux

Des

ign Developing Software on

Linux

Tim MarriottMel NicholsonICCAD 2003

Page 2: Developing Software on Linux

© 2003 Synopsys, Inc. (2)

Introduction

• Why Linux?

• Porting to Linux

• Developing on Linux

Page 3: Developing Software on Linux

© 2003 Synopsys, Inc. (3)

Why Linux?

• The question should be “Why the PC?” Inexpensive Performance

• What is wrong with Windows as the OS? It is too different from Unix Major EDA software runs on Unix The initial port is tough and the continued

support is difficult

• Linux is a robust OS that is very close to Unix The initial port is easy and the continued

support is also easy It is in the right place at the right time

Page 4: Developing Software on Linux

© 2003 Synopsys, Inc. (4)

Why Linux?

• We port to Linux because customers want it Fast Hardware

Inexpensive Hardware

It’s an easy port

• We develop on Linux because it increases our productivity Fast Hardware

Inexpensive Hardware

Not a steep learning curve for our developers

Page 5: Developing Software on Linux

© 2003 Synopsys, Inc. (5)

Porting to Linux

• Porting Overview

• What Linux to choose?

• Problems with the Linux Support Story

• The Enterprise is Coming

• Porting Issues Encountered

Page 6: Developing Software on Linux

© 2003 Synopsys, Inc. (6)

Porting Overview

• Linux is really just another flavor of Unix The port was not difficult

The issues encountered were no more difficult than between flavors of Unix

• Very few problems were encountered

• OS and hardware configuration took the most time to get right

Page 7: Developing Software on Linux

© 2003 Synopsys, Inc. (7)

What Linux to Choose?

• Versioned Linux was the gating factor to delivering a port Can’t base a product on all variants of the OS that

the open source community produces

• Various companies supply versioned variants of Linux Red Hat, SuSE, Caldera, Mandrake

Synopsys chose Red Hat

Page 8: Developing Software on Linux

© 2003 Synopsys, Inc. (8)

Problems with the Linux Support Story

• Linux companies didn’t deliver a true enterprise support structure Versions are not compatible No long term support of versions No compatibility guarantees between patches Versions release very often

• ISV’s stay with old versions for long periods of time Synopsys is still based on Red Hat 7.2

• Linux companies have recognized the flaw Enterprise versions are becoming available Consumer versions are unfriendly to business

Page 9: Developing Software on Linux

© 2003 Synopsys, Inc. (9)

The Enterprise is Coming

• Red Hat now only supports an Enterprise version Yearly subscription based support

Guaranteed binary and API compatibility between versions

12-18 months between major releases

• Cost will increase Stability will offset the additional cost

Red Hat Enterprise Linux WS $179 - $299 on x86• $792 on Itanium and AMD64

Information on this slide from http://www.redhat.com

Page 10: Developing Software on Linux

© 2003 Synopsys, Inc. (10)

Porting Issues Encountered

• Calling fclose() on a file that is not open crashes

Be sure to only call fclose() once per open file

• Binary files are not platform independent due to Little Endian byte order Must decide where you want to handle the

conversion when reading/writing binary files

Page 11: Developing Software on Linux

© 2003 Synopsys, Inc. (11)

Porting Issues Encountered

• Gcc doesn’t increment i++ until the end of the statement result = foo(x[i++], x[i]);

Increment some other way• i and i+1 is one option

• C compiler has problems with nested function calls and function calls in “if” statements Use separate statements instead

Page 12: Developing Software on Linux

© 2003 Synopsys, Inc. (12)

Porting Issues Encountered

• “/bin” and “/usr/bin” are separate directories Make sure command location is defined for Linux

• Default sorting order is not the same Set environment variable LC_ALL to C

Page 13: Developing Software on Linux

© 2003 Synopsys, Inc. (13)

Porting Issues Encountered

• Can’t initialize global scope to be stdout or stdin stdout/stdin are not constant expressions and are

therefore not suitable for initialization

• If a NULL pointer is passed to fclose it will crash Check the pointer

• if (fd)

fclose(fd);

Page 14: Developing Software on Linux

© 2003 Synopsys, Inc. (14)

Porting Issues Encountered

• intptr_t is not defined in int_types.h It is defined in stdint.h

• SIGEMT is not defined Do not use SIGEMT

Page 15: Developing Software on Linux

© 2003 Synopsys, Inc. (15)

Porting Issues Encountered

• The default floating point precision varies Uses native support of underlying hardware

Different results for register operation versus loaded

Makes golden-file based regression testing difficult

IEEE compliance options incur a performance penalty

Page 16: Developing Software on Linux

© 2003 Synopsys, Inc. (16)

Developing on Linux

• Linux Development Model

• Office Productivity Tools

• Developer Tools

• GUI Development

Page 17: Developing Software on Linux

© 2003 Synopsys, Inc. (17)

Linux Development Model

Windows Desktop

2 CPU4 GB Memory

Linux Box

Computer Room

ExceedVnc

SCM DataServers

Big LocalDisk

Page 18: Developing Software on Linux

© 2003 Synopsys, Inc. (18)

Office Productivity Tools

• Windows Desktop avoids the office productivity tool issues OpenOffice and StarOffice available on Linux

• MS Office compatible

CodeWeavers CrossOver Office • Allows MS Office to run directly on Linux

VMware dual operating system capable

Page 19: Developing Software on Linux

© 2003 Synopsys, Inc. (19)

Developer Tools

• Compilers Gnu (gcc, g++) Intel Compilers

• Debuggers gdb Graphical front end, ddd

Page 20: Developing Software on Linux

© 2003 Synopsys, Inc. (20)

Developer Tools

• Editors (IDE’s) Emacs, Vim

• Highly configurable editors• Can tightly integrate gdb and SCM systems

Kdevelop• Full integrated MS Visual C++ style IDE

• Source Control Systems Clearcase, Perforce, CVS, RCS

Page 21: Developing Software on Linux

© 2003 Synopsys, Inc. (21)

Developer Tools

• Memory Debug Purify (Available Soon)

Valgrind

• Performance Quantify (Available Soon)

Kcachegrind

Page 22: Developing Software on Linux

© 2003 Synopsys, Inc. (22)

Developer Tools

• Test Coverage Purecov (Available Soon)

Gcov

• Scripting Language Perl, Tcl/Tk, Python, JavaScript

Page 23: Developing Software on Linux

© 2003 Synopsys, Inc. (23)

GUI Development

• Native GUI toolkits available Gnome GTK+ is a C based public domain toolkit

LessTiff is Motif compatible library

Tcl/Tk provides scripting type capabilities

Java, AWT or Swing

Qt is a C++ class library commercially available from Trolltech

• KDE is written in Qt

• Portable across Linux/Unix/Windows platforms

• Public Domain version available

• Synopsys standardized on Qt

Page 24: Developing Software on Linux

© 2003 Synopsys, Inc. (24)

Summary

• The PC has given us fast, inexpensive hardware

• Linux enables EDA on the PC

• Enterprise Linux makes this a viable solution Stability, Compatibility, Predictability

• Linux is a winning platform for EDA! For customers and developers