Gwyddion Unix build system is based on
most of current Unix Free and Open Source Software. If you have ever
compiled software from source code, you very likely met autotools and
already know how to proceed. This section shall describe the
compilation procedure in enough detail even for the uninitiated though.
in the top-level directory of the
source tarball contains generic GNU autotools installation instructions.
If you know the drill:
tar -jxvf gwyddion-2.26.tar.xz
Unpack the source code tarball with
tar -Jxvf gwyddion-2.26.tar.xz
replacing 2.26 with the actual version number. It will create directory
gwyddion-2.26 (again, with the actual version
number in place of 2.26), cd to this directory.
All other compilation actions will take place there.
If your operating system does not come with xz you might want to
gwyddion-2.26.tar.gz (compressed with
gzip) instead and unpack it with
tar -zxvf gwyddion-2.26.tar.gz
However, modern Unix and Unix-like systems come with both xz and
gzip so, the considerably smaller
gwyddion-2.26.tar.xz should be normally the
to configure Gwyddion.
The configure shell script attempts to guess correct
values for various system-dependent variables used during compilation.
It uses those values to create a
Makefile in each
directory of the package, a couple of header
files containing system-dependent definitions and a few other
system-dependent auxiliary files.
Finally, it creates a shell script config.status that
you can run in the future to recreate the current configuration, and
config.log. This file contains the details
of the detection process and it is helpful to include it in compilation
related bug reports.
At the end, configure also prints a summary of
enabled/disabled optional features, including the reasons why features
If configure reports missing required packages, install these packages and re-run it. The same applies to the case when configure passes but you find you have not installed an optional package you want to compile Gwyddion with. It is possible a package is not found or it is misdetected even if you have installed it, namely when it is installed into a non-standard directory. In this case it is necessary to adjust certain environment variables to make configure able to find the packages:
Most packages come with so called
.pc) that describe how programs
should compile and link with them. configure
uses information from these files, therefore
PKG_CONFIG_PATH must be set to list all
non-standard directories with relevant pkg-config files.
To add for instance a GTK+ installation in
/opt/gnome and a FFTW3 installation in
$HOME/opt/fftw3 one can do
It may be necessary to adjust these variables to include non-standard directories with executables and libraries of relevant packages, respectively.
It may be necessary to adjust these variables to include
non-standard directories with header files and libraries of
packages that do not come with pkg-config files, for example
for libTIFF in
/usr/local one can set:
--prefix of configure sets the
base installation directory. Program components will be installed into
share, etc. subdirectories (that will be created if
they do not exist). More detailed control is possible with options
specifying particular subdirectories as
--libdir. The default prefix is
/usr/local/bin, to install
Gwyddion into your home directory you may want
to use for instance
If you install Gwyddion for personal use it is recommended to use a similar installation directory as no steps need to be performed as root in this case.
Optional features can be enabled/disabled with options such as
For instance compilation with FFTW3 can be disabled with:
By default all optional features are enabled if their prerequisites are found. A brief summary enabled and disabled optional features is printed near the end of configure output.
The complete list of configure options and important variables can be obtained with:
Most of these options control inclusion/exclusion of optional features. Some interesting general options are explained below.
Gwyddion comes with various desktop integration files defining MIME types, menu entries, file associations, thumbnailers, etc. If you install Gwyddion to a system prefix they usually end up in the correct location. However, if you install it somewhere to your home directory then these files need to be placed elsewhere, namely into certain dot-directories in your home.
This can be requested using
option of configure.
Note that using this option causes installation of files outside the
If Gwyddion is installed into a staging area for a subsequent packaging it is necessary to disable certain post-installation actions that need to be done on the target system, not while packaging.
Updating of Freedesktop files can be
Installation of GConf2 schemas can be disabled with
--disable-schemas-install. Usually, this
does not have to be done explicitly as installations into a staging
area use non-empty
DESTDIR is found to be non-empty the
build system skips post-installation actions automatically.
If you intend to patch or otherwise modify Gwyddion source code pass
to enable various update and rebuild rules that are not used in plain
compilation. Depending on the nature of the modifications, some of the
additional tools described in section
Subversion Checkout, Development
may be necessary.
and wait until Gwyddion is compiled. If configure finished without errors the compilation should pass too.
If you need to do unusual things to compile the package, please try to figure out how configure could detect whether and what to do, and e-mail patches or instructions to the bug-report address so they can be considered for the next release.
Gwyddion has to be installed to be run, it is not possible to run it uninstalled.
to install Gwyddion to the target directory. If you install Gwyddion to a system directory you have to become root for running this command. This is the only command that you might have to run as root during the installation. For example using sudo:
sudo make install
To install Gwyddion to a staging area,
for example for packaging, set make
DESTDIR variable to a prefix that will be
prepended to all target directories:
make install DESTDIR=/var/tmp/gwyddion-buildroot
Do not override individual directory variables as
If you do not install to a system directory, e.g. to a subdirectory of your home directory, you may need to adjust the following variables during installation:
GCONF_SCHEMA_CONFIG_SOURCE– location of GConf2 schemas
KDE4_MODULE_DIR– location of KDE4 modules
XDG_DATA_DIRS might need to be
adjusted after installation to get full desktop integration.
If you install Gwyddion into
/usr/local and get
error message that
libgwyapp.so.0 cannot be found
your system probably lacks standard library directories in the dynamic
linker configuration. Notably, this happens on Ubuntu. Edit file
/etc/ld.so.conf and add the line
Running Gwyddion does not normally require any additional setup.
The misfeatures of some desktop environments, however, may render
Gwyddion unusable and need to be disabled.
The hijacking of program main menu in Unity
makes most of Gwyddion menus inaccessible. It
can be disabled by by unsetting
in the directory you previously compiled
Gwyddion to remove it. If you have lost
the source directory meanwhile you can try to unpack, configure and
build it exactly as before and then issue
make uninstall, although this relies on your
ability to reproduce the build process.
It is possible to build RPM packages on RPM-based GNU/Linux distributions directly from source code tarballs with
rpmbuild -tb gwyddion-2.26.tar.xz
where 2.26 is to be replaced with the actual version as above. This method was tested mainly on Fedora, openSuSE and Mandriva and the RPM spec file contains some specific provisions for these systems. Specific support for other RPM-based systems can be added on request.