logo Source code compiling


Page partially updated November 27, 2010

NOTICE 14 September 2011

If you reckon Puppy Linux (and siblings and derivatives) is great and want to get involved, and you have a clue or two about programming (C, C++, Bash/Ash, GTK, BaCon, Vala), but want suggestions on what to do, please look at this new page:

http://puppylinux.com/development/projects.htm

Programming languages

This page describes how to setup Puppy as a program development environment. That is, you will be able to compile C, C++, Vala, Genie, BaCon (and in some cases Fortran) source code.

I have also written another page that introduces the languages themselves, and helps you to make a choice if you want to get involved in coding for Puppy:

HOWTO: write programs

Running Puppy with a "pupsave" file

Booting Puppy from live-CD has hardly any limitations compared with a full hard drive installation. You can even compile source packages. That is, you do not have to install Puppy to a hard drive to compile source packages. Come to think of it, what other distro can compile when just running off the live-CD? ...none that I know of.

Ditto when running Puppy from a USB Flash drive, and what we call a "frugal" hard drive installation.

These modes all store the personal data in a "pupsave" file and the instructions here apply to all these modes of running Puppy...

Puppy has an incredibly simple system for converting into a full C/C++ compiling environment. A single file, *devx*.sfs, is all that is required. The "*" in the filename is optional extra information, for example the version number -- for example, Puppy 4.3.1 could be devx_431.sfs.

Running Puppy from live-CD, you will have a personal storage file, named pupsave.2fs, on the hard drive -- you will find it in /mnt/home folder.
All you have to do is download *devx*.sfs to the same place, that is, into /mnt/home/. Run the BootManager (see "System" menu) and select the *devx*.sfs file, then reboot, and that's it, you're ready to do all that 'configure', 'make' and 'make install' stuff.

'devx' SFS file

Introduced above. SFS files are a powerful feature of Puppy. Read this overview of package management to find out more about SFS files:

Introduction to Puppy package management

Where to download this 'devx' file from? Usually the same place that you got the main Puppy live-CD ISO file from. For example, for Puppy 4.3.1:

http://distro.ibiblio.org/pub/linux/distributions/puppylinux/puppy-4.3.1/devx_431.sfs

...but usually you would go to the main download page and choose the best mirror site (ibiblio.org is very slow):

Puppy download page

What about Vala and Genie? If you haven't kept up with the latest in cool languages then you won't know about these. A couple of places with more information:

HOWTO: write programs

Introduction to Genie

Multisession CD/DVD

This is when Puppy is run from a CD or DVD but instead of having a "pupsave" file for personal data, the personal data is saved back to the CD/DVD. This mode does not need a hard drive at all. A PC with 256MB of RAM is required, but if you want to do source code compiling then heaps of RAM is needed -- this has yet to be determined, but I recommend 1GB minimum.

In this case, download the *devx*.sfs file to "/' then reboot. What will happen is that it will get saved to the CD/DVD, then at next bootup Puppy will recognise it and load it. That's it, you are ready to go.

Note however, this only works for Puppy version 4.00 or later.

Full hard drive installation

This is a conventional Linux installation.

Currently, installing the "devx" file in a full hard drive installation (as opposed to a "frugal" installation) is slightly more complicated, and you can't undo it. It involves some steps (assuming that full installation currently running)....

1. Click on the devx_xxx.sfs in a ROX-Filer window to mount it.
2. Open a terminal in the mounted directory.
3. # cp -a --remove-destination ./* /
4. # sync
5. Close the terminal.
6. Click on the devx_xxx.sfs file to unmount it
Note, the '--remove-destination' option is essential. If you only use '-f' to force overwrite, it will follow (dereference) a symlink, that can cause unexpected overwrites.

Warning about SFS files
SFS files are great, see the Package Management Overview page. However, they have a limitation, cannot be loaded and unloaded with the BootManager if you have a full hard-drive installation of Puppy. In that situation, read the above instructions given for the "devx_xxx.sfs" file.

Extra technical notes

One thing I do recommend. You really do need a hard drive partition with Linux filesystem (ext2, ext3, ext4 or reiserfs), as the working area for compiling. This is where you expand the source tarballs and compile them. It is highly recommended to do this, as it is outside the "layered filesystem" -- /root for example is inside the layered filesystem.

Perhaps if you have a hard drive with only a Windows partition on it (Windows NTFS and FAT filesystems must not be used!!!) and do not want to risk resizing it to make room for a Linux partition on the hard drive, consider using a second internal or USB hard drive.

Also, your hard drive should have a Linux swap partition, as Linux can use this extra storage space if it runs low on physical RAM. Compiling does tend to use a lot of RAM space.

To find out how to compile the Linux kernel: How to compile the kernel

Just a note on the side about hard drive partitions. Windows XP uses the NTFS format for partitions, and Microsoft keeps the format a secret, like every other format and protocol -- which is the main reason Microsoft keeps its monopoly. Therefore, Linux support of NTFS is not perfect. If you really want to embrace open standards, and really give Linux a go, you do need to create a Linux partition and a Linux swap partition, on your hard drive. There are tools to do this -- these tools can safely (no guarantees though!) reduce the size of the NTFS partition and create the new ones -- checkout GParted, to be found in the "System" menu.
Recently a free native ext2 driver has become available for Windows NT/XP, so Windows can use a ext2 partition just like any other NTFS or VFAT (the older Windows 9x partition format) drive. Link: http://www.fs-driver.org/
If you take the trouble to do this, your play with Puppy will be so much more fruitful.


(c) Copyright Barry Kauler 2006,2008,2009 http://puppylinux.com/
No part of this page is to be reproduced anywhere else. I have found that there is a problem where parts of my web pages are being inserted at other sites, then not updated, whereas I am updating my pages regularly. This is not a desirable situation, so please just link to my pages.