Previous: Downloading libLCS, Up: Preliminaries
This Section details instructions for building and installing the static library for libLCS. Currently, these instructions are relevant for all Linuxes, Cygwin and MinGW/MSYS with GCC-3.4.2 or higher. However, it should be possible to build the library on other platforms with appropriate modifications. If you are able to build the library on platforms other than those mentioned above, you are are encouraged to submit the build instructions to the libLCS project administrator (email to sivachandra[at]users[dot]sourceforge[dot]net).
The first step is to download the zipped/tarred bundle of the latest libLCS release from the sourceforge.net project page http://www.sourceforge.net/projects/liblcs/. Next unzip/untar this file in a convenient directory. The contents of the zip/tar file are detailed in the Downloading libLCS section. For ease of illustration, let us assume that the downloaded file has a name libLCS-a.b.x.zip. After unzipping/untarring, do the following.
cd libLCS-a.b.x/ make all
This will build the static library into the directory libLCS-a.b.x/lib/
, and all the examples into the
directory libLCS-a.b.x/bin/
. If you do not want to build the examples, then instead of the above command
sequence, do the following.
cd libLCS-a.b.x/ make lib
If you would like to build the examples separately after building the static library, follow the above commands by
make examples
This will build all the examples into the directory libLCS-a.b.x/bin/
. You can do a final and optional
'make clean'
to clean up the object files, the built static library, and the built example binaries.
There are no special steps required to install the static library of libLCS once it has been successfully built.
However, to begin using it in the easiest way, you will have to move the header files and the static library file
to the standard include and linker paths. Copy the directory lcs
as it is to the standard compiler include path
(lcs
is one of the directories packaged into the release zip/tar file for any particular libLCS release. See
the Downloading libLCS section for more information.) On most Linux like platforms, the standard compiler include
path is /usr/include/
. Similarly, copy the newly built static library file lib/libLCS.a
to the standard
linker path. On most Linux like platforms, the standard linker path is /usr/lib/
. All you will typically
need to do is to login as root and do the following in the unzipped/untarred libLCS-a.b.x
directory.
cp -r lcs $COMPILER_INCLUDE_PATH cp lib/libLCS.a $LINKER_PATH
In the above command sequence $COMPILER_INCLUDE_PATH
is the standard compiler include path, and the
$LINKER_PATH
is the standard linker path.