Compiling AFD


Run ./configure to generate config.h and the various Makefiles. ./configure --help gives a list of possible options with slightly longer descriptions in README.configure. Read this since here you can decide what parts of AFD you want to compile and how and where you want it to install the binaries.

If you do not have a configure file you can create it by running the script ac-tools/bootstrap. This script needs autoconfig and automake. Here the commands to install them on the different systems:

But before you start you need to ensure that your system has all the required packages installed. Here follow some system specific description on how to install the necessary tools:

You need to decide where you want to install AFD and if you want other users to have access to your AFD. There are three different security models, the default is "single user" where only the user that has started the AFD may have access and may control it. "Group access" is where all members of the same group may see and control the AFD. To activate this configure must be called with --enable-group_can_write. The third model is "any user", where any user may see things and have access and can be activated with the --enable-setuid_progs. The access can be controlled on a much finer level when using the afd.users configuration file. The "any user" model together with afd.users will give you the best control over who may do what, but be aware that some binaries will have the setuid bit flag set. So you should not use this when the binaries belong to root.

Older unix systems may require special options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Here an example:

            ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix

On Linux or newer unix systems you can just say:

            ./configure

Before compiling you might want to set some other preferences in src/afdsetup.h and/or src/init_afd/afddefs.h. Some of these values can also be set via configure parameters:

           --with-max-no-of-parallel-jobs=N
           --with-default-no-of-parallel-jobs=N
           --with-default-archive-unit=N
           --with-max-hostname-length=N
           --with-max-dir-alias-length=N

But note with AFD version before 1.4.6, changing some values here might make this incompatible with a previous AFD version and AFD will no longer work when it is started. So best to leave these values as they are. If you do change them it's best to run the following command before starting AFD again:

            afd -i

This will initialize the internal database of AFD. After this it will be possible to run AFD with the new values. As of version 1.4.6 this is no longer required and AFD does it automatically for you.

Now everything is setup for compiling, run the following command:

            make

To speed up this process try use the -jN parameter, where N is the number of cpu cores you have available. On Linux you can just say -j$(nproc), this will get the number of threads it can use automatically.

The next step is to install the binaries. This is done with the following command:

            make install

The Makefile also has support for generating an RPM. For this to work the package rpm-build needs to be installed. If this is installed, all you need to do is run the following command instead of the 'make install':

            make rpm

Copyright © 2005 - 2023 by H.Kiehl
Holger.Kiehl@dwd.de
Last updated: 26.02.2023
[red dot]Index [red dot]Home