Installating XForms from the Sources

In the following it is assumed that you already have downloaded the XForms source package, if not please first go to the download area for XForms at Savannah and pick the version you want (the latest release considered to be stable is always called xforms.latest_stable.tar.gz).

To unpack the package (it's assumed that it is called xforms.latest_stable.tar.gz here) use a command like

tar -xzf xforms.latest_stable.tar.gz

This will create a new directory with the sources of the library with a name according to the release that you downloaded (xforms-1.2.1 at the moment of this writing when you picked xforms.latest_stable.tar.gz).

Now go into this directory, using

cd xforms-1.2.1

and run the configure utility within this directory:

./configure

This script checks if all requirements for building the library are satisfied and creates a few files that are needed. After not too long a time the script should be finished.

Per default neither the documentation nor the demo programs will be created. If yopu want them to also be build use instead

./configure --enable-docs --enable-demos

If you're lucky everything will have worked out ok and you will see at the end of the output something similar to

Configuration
  Host type:                      x86_64-unknown-linux-gnu
  Special build flags:
  C Compiler:                     gcc
  C Compiler flags:               -O
  Linker flags:

Configuration of xforms was successful.
Type 'make' to compile the program,
and then 'make install' to install it.
    

If that's the case (I'll try cover what needs to done otherwise below) all you now need to do is to type

make

This starts the compilation of the library. After a minute or two, depending on the speed of your machine, this should end successfully. Then all left to be done is to install the library using

make install

and after a few seconds you should have a working installation of the library (per default all files will be installed below /usr/local/.

Since new libraries have been installed you may also have to make the system aware of it, which can be done runninh

/sbin/ldconfig

You must have root privileges to do that.

Trouble shooting

It may happen that running the configure script fails due to missing dependencies. Since the library is written in C you obviously will need a working C compiler. Also obviously, since the XForms library is a wrapper for the rather low-level Xlib library, you need a development version of this library installed (i.e. not just this library but also its header files – if it's not installed you will have to figure out how to get it for your distribution, e.g. on Debian and Ubuntu it's the libx11-dev package you need to install).

Two further libaries that are required are the XPM and the JPEG libraries, together with their header files (i.e. development packages for the libraries). Again, it's unfortunately not possible to say how exactly you can get them since this is too dependent on what distribution you use. For Debian and Ubuntu you need to install the packages libxpm-dev and libopenjpeg-dev, for other distributions please look for similar packages.

If you want OpenGL support included into XForms you may also have to install the development version of the OpenGL library.

Getting help

If you have problems building the library the best place to ask for help is on the XForms mailing list. Since there are numerous things that can go wrong you can help fixing the problem by giving deatiled information about your system. Probably the most helpful thing you can do is to log the output of the commands you run when trying to create the library. This requires that you redirect the output of these commands to files that you can append to the email you send to the mailing list.

Redirecting the output of a command is not too difficult but how it's done depends on the type of shell you're using. If you use bash as your shell you could do

./configure > configure.log 2>&1
make > make.log 2>&1

This creates the file configure.log and make.log that will contain all the output of the configure script and what make is reporting. Quite often a look at these files will help a lot in determining what went wrong.

If you're using the Korn or C shell you can redirect the output of configure and make by using instead

./configure >& configure.log
make >& make

Configuring configure

There's also quite a number of parameters that can be passed to the configure script which influence how the library is built and where it does get installed. To get a list of all available parameters run it with the --help option

./configure --help

The options probably most often used are --enable-optimization and --enable-demos. The first one needs to be followed by an equal sign and and an optimization option that will then get passed on to the compiler, e.g.

./configure --enable-optimization=-O2

in order to get the gcc compiler to be invoked with the -O2 option, resulting in rather highly optimized code.


Last modified: January 5, 2014 by Jens Thoms Törring Valid CSS! Valid XHTML 1.0 Strict