by Alan Zeichick
Getting Started with a Linux* Software Development Toolchain
For many Windows* developers, Linux* presents a learning challenge. Not only does Linux have a different programming model, but it also requires its own toolchain, as programmers must leave behind the Visual Studio* (VS) or Visual Studio* .NET (VS.NET) suites and third-party plug-in ecosystem. This article helps Windows developers understand the options available as they seek to replicate, on Linux, the rich and efficient toolchain experience they've long enjoyed on Windows.
Making the move to Linux can be an exciting and challenging opportunity for Windows developers. The power of the open-source operating system, including its support for a wide variety of hardware platforms, is appealing. So too is its now-legendary stability, performance and scalability. But programmers seeking to write software for Linux will need the appropriate native software development tools -- and finding the right toolchain can be a challenge in its own right.
The Toolchain Challenge
Why is there a toolchain challenge? The short answer is, because the Linux world has grown organically, with separate teams and open-source projects building different parts to suit their own needs and schedules. There's no unifying vision between the operating system and development tools. The open-source project led by Linus Torvalds that just introduced kernel 2.6, for example, is unrelated to the contributors who evolve the GNU Compiler Collection*, Borland Kylix*, the Intel® VTune™ Performance Analyzer, or the open-source Eclipse* project founded by IBM.
By contrast, Microsoft designs and builds its tools (now consolidated under the Visual Studio suite) in close lockstep with each evolution of the operating system, with an eye not only to adding those features that developers want most, but also guiding programmers into a specific software-development model.
Plus, Microsoft, through VS and VS.NET, as well as its Visual Studio Integration Partner program and MSDN* subscription service, intends its tools to be the "official" software development resources for Windows. There's no such default "official" choice with Linux. Even though most Linux distributions come with a wide variety of command-line tools, and even some GUI offerings, there's no particular reason to use those tools instead of other open-source or commercial-license products.
A related difference is that while Microsoft's tools are generally tightly integrated with Windows and each other, there's no tightly integrated Linux toolchain -- though perhaps Eclipse and the Free Software Foundation's GNU tools come the closest. That means for the most part, developers will need to carefully evaluate individual components, and then integrate them together. It's more work than simply installing VS.NET on a Windows XP* workstatio n -- but well worth the effort.
(Important note: While we'll be discussing many tools here, most of which your author has used or evaluated personally, these tools are not being specifically recommended or endorsed for your individual application. As with choosing any programming tools, you should download and test the tools for yourself, to ensure that they suit your own needs, as well as the needs and coding standards of your clients/employer.)
Weaving a Toolchain
Toolchains exists on different levels. Every programmer needs a basic toolchain, which comprises the fundamental software-development tools needed to write software. But there's also the extended toolchain, which adds functions required for distributed teams or more advanced enterprise development.
The basic toolchain, which will be discussed in this article, centers on an integrated development environment or a smart language-aware code editor. Working alongside the IDE, or editor, are modelers, compilers, debuggers, code analyzers and libraries. Those other parts might be wholly independent tools, completely integrated tools, or might actually be somewhere in-between -- for example, a profiler that runs independently, but which can be invoked by a menu option on the IDE. The basic toolchain is generally operating-system dependent.
By contrast, the extended toolchain adds layers that extend beyond the programmer's desktop to server-based or Web-based collaborative systems. The extended toolchain includes requirements management tools, source-code and other asset-management tools, version-control systems, large-scaled modeling tools, build-management system, project management tools, and so-on. Most extended-toolchain tools are available cross-platform, or with web-based interfaces.
Moving from Windows to Linux doesn't generally affect those team-oriented tools; it's the code editors, compilers, libraries, and so-on which are of more concern to most Windows developers seeking to make the switch to Linux. These also tend to have the steeper learning curve.
Editors and Environments
To most developers, the most visible tool -- and burned into the screen's phosphor 24/7 -- is the editor or IDE. While the editor's user interface doesn’t directly affect the quality of the binaries generated by the programmer, a good editor can make the coding process seem effortless. Visual cues point out syntax errors and key code constructs; keyboard macros ease repetitive tasks. Wizards, keyword-completion, and drag-and-drop features slash coding time. A good IDE or code editor is worth its weight in gold.
Editors and IDEs are also among the most divisive topics to developers. While I've never actually seen a fistfight between emacs and vi adherents, editors have always been a perilous topic, and like the choice of golf clubs or power tools, is a very personal one. So, without further ado, and in fisticuff-avoiding alphabetical order, here is a selecti on of just some of the top-notch IDEs for native Linux developers.
- ActiveState Komodo* - This is the IDE for scripting language users. Not every application requires the complexity and structure of languages such as C/C++, Fortran or Java*. In fact, Visual Basic users might find themselves much happier using Perl* or Python* than C/C++. Komodo is an excellent IDE for those languages, and also for PHP and Tcl -- languages that are little known in the Windows world, but are revered in Linux-land. Komodo is easy to learn and easy to use.
- Borland C++BuilderX* - C/C++ developers will feel right at home with Borland's C++Builder Suite*, which not only works with a variety of plug-in compilers and tools, like GCC and the Intel® Compilers and libraries, but also can link with Borland's full suite of software development lifecycle tools. In fact, Borland comes closest to offering the same out-of-the-box experience for Linux as Microsoft's VS.NET does for Windows. An older version of C++Builder is the tool that I personally use most often for Linux.
- Borland Kylix* - Borland's tools, starting with Turbo Pascal* nearly 20 years ago, are renowned for their developer-centric user interface and blazing code speed. Anyone experienced in Object Pascal*, the language used by Borland's Delphi* (for Windows), will enjoy a straightforward migration to Borland Kylix (for Linux). However, C/C++ programmers who don't use Delphi would have little reason to look at Kylix; stick with C++BuilderX.
- IBM Eclipse and Eclipse-based tools - There are many tools built on the Eclipse framework, including IBM's own WebSphere* Studio Application Developer,and the Red Hat* Developer Suite*. In addition there now the new Intel Compilers and Intel VTune Performance Analyzer for Eclipse. While the framework works with many languages, it's strongest for C/C++ and Java. Many open-source projects and commercial developers have been creating plug-ins to integrate other tools with Eclipse. Keep an eye on the web site to see the evolution of Eclipse 3.0, which promises to be one of the hottest tools of 2004.
- GNU Tools* - There are many powerful development tools in the Free Software Foundation. Linux itself is generally compiled with the C++ compilers in GCC, the GNU Compiler Collection*. The wildly popular emacs code editor, the gdb debugger, QtUnit unit tester, and many other tools are available from the Web or on most Linux distributions. The good news is that they're free. The bad news is that they're mainly command-line centric, with a syntax and mode of operation that will be very familiar to Unix enthusiasts or old-line DOS developers, but which are the antithesis of GUI-based rapid application development. Download the tools at Free Software Foundation.
- Metrowerks CodeWarrior* - This specialized IDE is for embedded programming, and Metrowerks offers versions of CodeWarrior for an amazing combination of languages, operating systems and processors. It would probably take an article as long as this one to merely list all the combinations. Anyone planning kernel-level Linux work should consider Metroworks Platform Creation Suite for Linux OS. The debugging support is incredible.
- Visual SlickEdit* - This is one of the most venerable code editors available for programmers, and incidentally, the company is releasing a version that can work as an Eclipse plug-in. It's designed to work with C/C++, Java, XML and HTML, and other languages. SlickEdit is extremely customizable; it includes keyboard emulations for environments like emacs and vi, for example. SlickEdit can work with many version-control, build management and source-control systems. It also has an incredible three-way merge editor.
Seven Tools Beyond the Editor
The choice of a code editor or integrated development environment may be hardest to make. There are so many choices, so many visual styles, and so few metrics one can use to determine which works best for a specific developer, development team, or project.
Fortunately, when assembling a Linux toolchain, programmers can experiment with different editors while separately evaluating the other elements, including the C/C++ compiler, debuggers, libraries, static analyzers, run-time profiles, build tools, documentation tools -- in fact, one of the real tests of a code editor or IDE will be the ease with which one can incorporate other tools' functionality into its user interface, or at least be able to context-shift seamlessly into another tool.
Rather than attempting to present a comprehensive list of Linux development -- which can be easily gathered with a Web search -- here are just a few tools for native C/C++ projects in Linux, that come highly recommended.
- Intel® C++ Compiler for Linux* - Basically, the fastest optimizing compiler for Intel processors available. Most Linux editors are preconfigured to use the GNU C compiler (gcc), but they can be readily changed to use icc, the Intel compiler, which is ABI-compatible with gcc. Hint: The new version 8 compiler even has optimizations for the forthcoming "Prescott" processor and includes a code-coverage analyzer.
- Intel® VTune™ Performance Analyzer for Linux* - The version 2.0 upgrade of the Intel's run-time code profilers offers significant improvements over the previous -- including better ability to analyze run-time results using a native Linux workstation. The first release required that analysis be performed on Windows. What's impressive is that the analyzer really understands the internals of Intel processors, and can help hand-tune code for fastest performance on specific deployment platforms -- a real boost for enterprise developers.
- No Magic MagicDraw* - This is an excellent, low-priced and full-featured modeling tool that supports round-trip object-oriented design with both Java and C++ (as well as a host of other languages). While it's not a native Linux tool, it's a 100% Java tool, and thus can work on a Linux workstation equipped with a Java Virtual Machine* and the X Window System. Importing C++ source code and running it through MagicDraw is an excellent way of reverse-engineering and documenting an existing application.
- Parasoft CodeWizard* - This is an incredible static code analyzer that not only reveals where the source varies from industry standards, it also explains where (and how) it varies from good programming practice. According to the company, there are 500 coding guidelines built into CodeWizard; those can be extended or overridden to cover individual style preferences and corporate rules.
- Nokia Qt Framework* - This is the easiest route to creating portable code -- other than using Java. For anyone building native C++ apps, Qt provides a multiplatform application framework that lets applications (and their graphical user interfaces) run on Linux, Unix, Windows and even Apple Mac OS* X. For Linux and Unix, Qt-based applications run on the X Window System.
- Wine* - Wine is an open-source implementation of the Windows Win32 GUI APIs on top of the X Window System. Wine is essential for running some Windows-based tools, such as Altova's excellent XMLSpy* 2004 (an XML editor) on Linux. All programmers and Linux power users should ensure that their workstations have the latest version of Wine installed.
Code, Compile, Link, Go!
Windows developers considering a move to Linux, or who want to add Linux development skills to their portfolio, face a learning curve -- a new operating system, new APIs, new coding model, and new tools.
While no Linux-based toolchain will offer the out-of-the-box, one-stop-shopping experience that once faces with Microsoft's Visual Studio .NET, there are many powerful alternatives. Linux developers have their choice of fully functional code editors and integrated development environments, compilers, debuggers, profilers, libraries -- it's all there.
Yes, it's more work to find and assemble a best-of-breed Linux development toolchain. But the end result will be worth the effort.
Coding for Linux... or for Java?
In the Windows world, there's an increasingly close blending of the classic Win32 and newer .NET paradigms, and it's clear that for most developers, especially those of server applications, .NET and ASP.NET are the preferred directions.
The relationship between Linux and Java is in some ways synergistic to that of Windows and .NET: For many programmers and enterprises, Linux is the preferred operating system for hosting high-performance Java virtual machines and J2EE application servers. However, many developers and businesses see a value in targeting Linux natively with C/C++ software.
The emphasis of this article is on finding a toolchain for native Linux development, primarily in C/C++. Java developers may wish to investigate different options, because the requirements are very different -- for example, Java doesn't need a separate compiler.
Where to start? Check out the Eclipse project, and tools based on it, such as IBM WebSphere Studio Application Developer, are increasingly popular for Java developers. Also popular are Borland JBuilder*, Sun NetBeans* and Sun ONE Studio* (now called Sun Java Studio*), Oracle* JDeveloper* and BEA WebLogic* Workshop.
There are a plethora of other Java tools available, many from the Apache Software Foundation, or from other open-source projects or commercial vendors. Most of them are either 100% Pure Java, in which case they'd run fine on any Linux development workstation equipped with a Java virtual machine, or in C/C++ with Linux versions available.
- POSIX Event Logging for Linux, Architecture Specification
- Porting Linux Applications to the Itanium® Processor
About the Author
A former mainframe software developer and systems analyst, Alan Zeichick is principal analyst at Camden Associates, an independent technology research firm focusing on networking, storage, and software development.