Installing the Prelude Library¶
This section explains how to install the Prelude library libprelude from the tarball available from the Prelude website. However, libprelude might be included with your distribution as a package and it would be easier to install it this way.
Table of Contents
Install Dependencies¶
Ensure that you have GNUTLS installed. Instructions on installing gnutls can be found on the GnuTLS Installation Page
Get the sources¶
Download the latest Prelude library
Configuration¶
The first step of the installation procedure is to configure the source tree for your system and choose the options you would like. This is done by running the configure script. For a default installation simply enter
./configure
This script will run a number of tests to guess values for various system dependent variables and detect some quirks of your operating system, and finally will create several files in the build tree to record what it found. (You can also run configure in a directory outside the source tree if you want to keep the build directory separate.)
You can customize the build and installation process by supplying one or more of the following command line options to configure:
Installation directories¶
- --prefix=PREFIX
Install all files under the directory PREFIX instead of /usr/local. The actual files will be installed into various subdirectories; no files will ever be installed directly into the PREFIX directory.If you have special needs, you can also customize the individual subdirectories with the following options.
- --exec-prefix=EXEC-PREFIX
You can install architecture-dependent files under a different prefix, EXEC-PREFIX, than what PREFIX was set to. This can be useful to share architecture-independent files between hosts. If you omit this, then EXEC-PREFIX is set equal to PREFIX and both architecture-dependent and independent files will be installed under the same tree, which is probably what you want.
- --bindir=DIRECTORY
Specifies the directory for executable programs. The default is EXEC-PREFIX/bin, which normally means /usr/local/bin.
- --datadir=DIRECTORY
Sets the directory for read-only data files used by the installed programs. The default is PREFIX/share.
- --sysconfdir=DIRECTORY
The directory for various configuration files, PREFIX/etc by default.
- --libdir=DIRECTORY
The location to install libraries and dynamically loadable modules. The default is EXEC-PREFIX/lib.
- --includedir=DIRECTORY
The directory for installing C and C++ header files. The default is PREFIX/include.
- --mandir=DIRECTORY
The man pages that come with the Prelude Library will be installed under this directory, in their respective man_N_ subdirectories. The default is PREFIX/man.
Path to dependencies¶
- --with-libgnutls-prefix=PFX
The Prelude Library require GnuTLS in order to build. Using this option you can tell the configure script in which prefix GnuTLS has been installed.
- --with-libgnutls-extra-prefix=PFX
The Prelude Library can make use of libgnutls-extra to provides additional authentication protocols (example: SRP). Using this option you can tell the configure script in which prefix libgnutls-extra has been installed.
- --with-libgcrypt-prefix=PFX
The Prelude Library require libgcrypt in order to build. Using this option you can tell the configure script in which prefix libgcrypt has been installed.
- --with-perl=PATH
The Perl interpreter is necessary to enable support for Perl language bindings and is normally automatically detected. Using this option you can specify a specific path to Perl or disable its support using --without-perl.
- --with-python=PATH
The Python interpreter is necessary to enable support for Python language bindings and is normally automatically detected. Using this option you can specify a specific path to Python or disable its support using --without-python.
- --with-ruby=PATH
The Ruby interpreter is necessary to enable support for Ruby language bindings and is normally automatically detected. Using this option you can specify a specific path to Ruby or disable its support using --without-ruby.
- --with-lua-config=PATH
The Lua interpreter is necessary to enable support for Lua language bindings and is normally automatically detected. Using this option you can specify a specific path to Lua or disable its support using --without-lua-config.
Optional Features¶
- --enable-gtk-doc
Generate code documentation (note that distribution come with documentation generated).
- --enable-easy-bindings
Enable support for high level bindings (available for C++, Perl, Python, Ruby, Lua).
Once finished, the configure script will dump a summary of the enabled features:
*** Dumping configuration *** - Generate documentation : no - Libtool dynamic loader : System - LUA binding : yes - Perl binding : yes - Python binding : yes - Ruby binding : yes - Easy bindings : yes
If no languages bindings are activated, you will be unable to run agent using Libprelude from the specified language.
Note: Prewikka require Python bindings to be available.
Build¶
To start the build, type
make
The build will take a few minutes depending on your hardware.
Regression Tests¶
If you want to test the newly built library before you install it, you can run the regression tests at this point. The regression tests are a test suite to verify that libprelude runs on your machine in the way the developers expected it to. Type
make check
Install¶
To install Libprelude enter
make install
This will install files into the directories that were specified in step 1. Make sure that you have appropriate permissions to write into that area. Normally you need to do this step as root. Alternatively, you could create the target directories in advance and arrange for appropriate permissions to be granted.
You can use make install-strip instead of make install to strip the executable files and libraries as they are installed. This will save some space. If you built with debugging support, stripping will effectively remove the debugging support, so it should only be done if debugging is no longer needed. install-strip tries to do a reasonable job saving space, but it does not have perfect knowledge of how to strip every unneeded byte from an executable file, so if you want to save all the disk space you possibly can, you will have to do manual work.
The standard installation provides all the header files needed for Prelude application development, such as custom functions or data types written in C.
Post-Installation Setup¶
On systems that have shared libraries (which most systems do) you need to tell your system how to find the newly installed shared libraries. The systems on which this is not necessary include BSD/OS, FreeBSD, HP-UX, IRIX, Linux, NetBSD, OpenBSD, Tru64 UNIX (formerly Digital UNIX), and Solaris.
The following step are necessary if you get the above message while running a program using libprelude:
prelude-admin: error in loading shared libraries libprelude.so.2.1: cannot open shared object file: No such file or directory
If you are on BSD/OS, Linux, or SunOS 4 and you have root access you can run the following command after installation to enable the run-time linker to find the shared libraries faster. Refer to the manual page of ldconfig for more information:
/sbin/ldconfig /usr/local/lib
On FreeBSD, NetBSD, and OpenBSD the command is:
/sbin/ldconfig -m /usr/local/lib
The method to set the shared library search path varies between platforms, but the most widely usable method is to set the environment variable LD_LIBRARY_PATH like so: In Bourne shells (sh, ksh, bash, zsh):
LD_LIBRARY_PATH=/usr/local/lib export LD_LIBRARY_PATH
Or in csh or tcsh:
setenv LD_LIBRARY_PATH /usr/local/lib
Note: Replace /usr/local/lib with whatever you set --libdir to in step 1. On some systems it might be preferable to set the environment variable LD_RUN_PATH before building. If in doubt, refer to the manual pages of your system (perhaps ld.so or rld).