Changes between Version 1 and Version 2 of pm-project-config


Ignore:
Timestamp:
May 31, 2006 8:06:27 PM (14 years ago)
Author:
andreasw
Comment:

started first draft

Legend:

Unmodified
Added
Removed
Modified
  • pm-project-config

    v1 v2  
    33The purpose of the configuration script in a project's main directory ({{{Clp}}} and {{{CoinUtils}}} in the [wiki:user-directories example]) is to test everything required for the compilation of the project's source code, and to set up all Makefiles.
    44
    5 The beginning and the end of the file follow the [wiki:pm-structure-config basic structure] of {{{configure.ac}}} files.  The body for a project main directory {{{configure.ac}}} file then looks like this:
     5The beginning and the end of the file follow the [wiki:pm-structure-config basic structure] of {{{configure.ac}}} files.  The body for a project main directory {{{configure.ac}}} contains the following parts:
     6
     7 * Initialization of tools and checks for programs, such as compiler
     8 * Checks for other COIN components
     9 * Checks for third party libraries (such as GNU's zlib or a third party LP solver)
     10 * Generation of links to files required for unit tests or example programs in case of a VPATH configuration
     11 * Other project specific tests and settings (such as byte size of types, existence of header files etc)
     12
     13In the following we describe the indiviual parts of the {{{configure.ac}} file body in more details and present examples.
     14
     15== Initialization of Tools and Compilers ==
     16
     17This part usually looks like this:
    618
    719{{{
     20#############################################################################
     21#                         Standard build tool stuff                         #
     22#############################################################################
    823
     24# Get the system type
     25AC_CANONICAL_BUILD
     26
     27# If this project depends on external projects, the Externals file in
     28# the source root directory contains definition of where to find those
     29# externals.  The following macro ensures that those externals are
     30# retrieved by svn if they are not there yet.
     31AC_COIN_PROJECTDIR_INIT
     32
     33# Check if user wants to produce debugging code
     34AC_COIN_DEBUG_COMPILE
     35
     36# Get the name of the C compiler and appropriate compiler options
     37AC_COIN_PROG_CC
     38
     39# Get the name of the C++ compiler and appropriate compiler options
     40AC_COIN_PROG_CXX
     41
     42# Initialize automake and libtool
     43AC_COIN_INIT_AUTO_TOOLS
    944}}}
     45
     46 * The '''AC_CANONICAL_BUILD''' makes the {{{configure}}} script check the host type, on which the script is run.
     47
     48 * '''AC_COIN_PROJECTDIR_INIT''' is a COIN specific macro that inializes a few things and should be included at this place
     49
     50 * The macro '''AC_COIN_DEBUG_COMPILE''' makes the {{{--enable-debug}}} flag available for {{{configure}}}.  It also sets the Automake conditional accordingly, as well as the {{{COIN_DEBUG}}} for the configuration header file.
     51
     52 * The macros '''AC_COIN_PROG_CC''' and '''AC_COIN_PROG_CXX''' determine the name of the C and C++ compiler, and chooses the default compiler options.  One only needs to specify those compilers that are required to compile the source code in the project. If the source code contains Fortran files, one should use '''AC_COIN_PROG_F77'''.
     53
     54 * Finally, the '''AC_COIN_INIT_AUTO_TOOLS''' sets everything up that is required to have Automake and Libtool work correctly.
     55
     56== Check for Other COIN Components ==
     57
     58This part looks like this:
     59
     60{{{
     61#############################################################################
     62#                              COIN components                              #
     63#############################################################################
     64
     65AC_COIN_HAS_PROJECT(Cbc)
     66AC_COIN_HAS_PROJECT(Cgl)
     67AC_COIN_HAS_PROJECT(Clp)
     68AC_COIN_HAS_PROJECT(CoinUtils)
     69AC_COIN_HAS_PROJECT(DyLP)
     70AC_COIN_HAS_PROJECT(Osi)
     71AC_COIN_HAS_PROJECT(Sym)
     72AC_COIN_HAS_PROJECT(Vol)
     73}}}
     74
     75Here, for each COIN project that is required to compile the libraries and programs in this project (including unit tests and example programs), we list its name as argument of one '''AC_COIN_HAS_PROJECT'''.  This example is taken from Cbc, and as you see, the project itself should also be listed.
     76
     77The final {{{configure}}} script will search for the project; first, it will check if itself is this package (by comparing with the name that is given to {{{AC_INIT}}} at the beginning of the {{{configure.ac}}} file), and otherwise looks for a parallel subdirectory with the projects name.
     78
     79If the project is found, a {{{#define}}} will set in the configuration header files with the name {{{COIN_HAS_PRJCT}}} (where {{{PRJCT}}} is replaced by the name of the project in all capital letters, e.g., {{{COIN_HAS_CLP}}} in the example above).  Also, an Automake conditional with the same name will be set to true.
     80
     81The project can be listed in any order.
     82
     83== Checks For Third-Party Components ==
     84
     85For a few third-party packages we have defined special COIN macros, namely for those packages that are released under the GNU Public License (GLP).  Those libraries will only be used, if the user specified the {{{--enable-gnu-packages}}} flag for {{{configure}}}.  So far, those macros are
     86
     87 * '''AC_COIN_CHECK_GNU_ZLIB''': Check for the zlib compression library
     88 * '''AC_COIN_CHECK_GNU_BZLIB''': Check for the bzlib compression library
     89 * '''AC_COIN_CHECK_GNU_READLINE''': Check for the readline library.
     90
     91Those macros check for the availability of those packages (if required by the user).  If the package is available, it adds the flags required for linking to the {{{ADDLIBS}}} output variable, {{{#define}}}s the preprocessor {{{COIN_HAS_ZLIB}}} (and similar) in the configuration header file, and defines an Automake conditional with the same name.
     92
     93We also provide a generic macro for testing the availability of other third-party libraries, called '''AC_COIN_HAS_USER_LIBRARY'''.
     94A typical invocation looks like this:
     95
     96{{{
     97AC_COIN_HAS_USER_LIBRARY([Cplex],[CPX],[cplex.h],[CPXgetstat])
     98}}}
     99
     100The arguments have to following meaning:
     101
     102 1. ''Name of the package''.