Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Porting to the Linux Standard Base

Modify your code to run reliably on many Linux flavors

Martin Streicher (martin.streicher@linux-mag.com), Editor in Chief, Linux Magazine
Martin Streicher is the Editor-in-Chief of Linux Magazine. Martin earned a Master of Science in Computer Science from Purdue University and has been programming UNIX-like systems since 1986 in the Pascal, C, Perl, Java, and (most recently) Ruby programming languages.

Summary:  Because Linux® is an open operating system, you can configure and assemble it to suit specialized purposes. However, while variety and choice are beneficial for users, heterogeneity can vex software developers who must build and support packages on a multitude of similar but subtly different platforms. Fortunately, if an application conforms to the Linux Standard Base (LSB), and a flavor of Linux is LSB compliant, the application is guaranteed to run. Discover the LSB, and learn how to port your code to the standard.

Date:  18 Jul 2006
Level:  Intermediate PDF:  A4 and Letter (249 KB | 29 pages)Get Adobe® Reader®

Activity:  10811 views
Comments:  

Before you start

Learn what to expect from this tutorial and how to get the most out of it.

About this tutorial

The Linux Standard Base (LSB) is a specification as well as a collection of tools and test suites that help Linux software developers increase compatibility among Linux software distributions. Applications and distributions can be certified as being compliant with the specification, providing assurances to users that certified software is compatible. This tutorial describes the LSB and explains how to vet your application code to conform with it.

Objectives

In this tutorial, you learn how to install and use the LSB Build Environment, Sample Implementation, and accompanying tools to verify that your application code is LSB conformant. You use VMware's VMware Workstation to create a virtual operating system instance to enable and simplify compliance testing.


Prerequisites

To benefit from this tutorial, you should have experience with the C or C++ programming language as well as the typical Linux software development environment and its cadre of tools, including the compiler, linker, system libraries, configuration and build utilities, and packaging tools.

You should also have experience installing software from the command line and have at least a modicum of experience with administering and maintaining a Linux system, such as configuring a file system, starting and stopping network services, and adding system services.

If you're running Debian Linux, you should also have some experience with the APT package manager. To run VMware Workstation on Debian Linux, you must install the kernel source associated with your kernel version. (You must typically have superuser access to install VMware Workstation.)

Before you start the tutorial, you must install several software packages on your Linux system. Here's everything you need:

  • The VMware Workstation product suitable for your Linux distribution

    Note: Alternatively, you can easily install VMware Workstation on any computer running Microsoft® Windows® XP and run a virtualized Linux instance on the Windows XP platform. Download a trial version of VMware Workstation at no cost and use it to create one or more virtual machines (VMs). After you've created a VM, you can save it and switch to the free VMware Player to replay it.

  • The LSB Sample Implementation
  • The LSB Build Environment
  • The LSB application test suites

You may also find it useful to download and read the LSB V3.0.0 specification appropriate for your target hardware platform. Hardware-specific LSB specifications are available for seven popular architectures: the IA32, IA64, PPC32, PPC64, S390, S390X, and AMD64 processors.

If you want to certify your application, download and read the Application Product Standard associated with your target hardware platform.


System requirements

To run the examples in this tutorial, you must have a computer running either the Linux or Windows XP operating system. VMware Workstation running on either of those platforms provides a Linux environment for you to do the rest of your work.

If your application depends on software libraries other than those ratified as part of the LSB specification for your processor, you must install those libraries on the virtual system, as well. To avoid confusion, it's ideal to install application-specific libraries separately from the standard libraries.

1 of 12 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Linux
ArticleID=146877
TutorialTitle=Porting to the Linux Standard Base
publish-date=07182006
author1-email=martin.streicher@linux-mag.com
author1-email-cc=martin.streicher@linux-mag.com

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.