Changes between Version 19 and Version 20 of pm-comments


Ignore:
Timestamp:
Sep 8, 2006 3:46:03 PM (15 years ago)
Author:
lou
Comment:

Added a paragraph about use of autoreconf vs. run_autotools.

Legend:

Unmodified
Added
Removed
Modified
  • pm-comments

    v19 v20  
    11= Hints, tricks, bugs, and suggestions =
    22
    3 This page is meant to provide a place to project managers using the COIN autotools system to share their experience.  Please write anything down that might be useful to other project managers.  For example, what didn't work the way you expected, what did you misunderstand, what bug did you find in the autotools, how did you gets something to work, what is not clear in the documentation etc.  This will also be helpful for the [http://projects.coin-or.org/BuildTools/wiki BuildTools] maintainers to improve the system and documentation.
     3This page is meant to provide a place to project managers using the COIN autotools system to share their experience.  Please write anything down that might be useful to other project managers.  For example, what didn't work the way you expected, what did you misunderstand, what bug did you find in the autotools, how did you get something to work, what is not clear in the documentation, ''etc''.  This will also be helpful for the [http://projects.coin-or.org/BuildTools/wiki BuildTools] maintainers to improve the system and documentation.
    44
    55-------------------------------
     
    1515}}}
    1616
    17 then Coin-Cbc is the Project Base Directory.
     17then {{{Coin-Cbc}}} is the Project Base Directory.
    1818
    19 '''Project Main Subirectory:''' If you download the Cbc project via svn with the above command there will be Cbc subdirectory under the Project Base Directory Coin-Cbc. We call this Cbc subdirectory the Project Main Subdirectory.
     19'''Project Main Subirectory:''' If you download the Cbc project via svn with the above command there will be {{{Cbc}}} subdirectory under the Project Base Directory {{{Coin-Cbc}}}. We call this {{{Cbc}}} subdirectory the Project Main Subdirectory.
    2020
    21 '''Source Subdirectory:''' It is common for the Project Main Subdirectory to have a src subdirectory. This is the Source Subdirectory. Some projects such as Cgl will have source code in the src subdirectory and source code in directories under src
     21'''Source Subdirectory:''' It is common for the Project Main Subdirectory to have a {{{src}}} subdirectory. This is the Source Subdirectory. Some projects such as Cgl will have source code in the {{{src}}} subdirectory and source code in directories under {{{src}}}
    2222
    2323The following points are all made at the [http://projects.coin-or.org/BuildTools/wiki BuildTools] Wiki. I am just summarizing a few key points that are useful to have at your fingertips.
    2424
    25 1. If, the configure.ac file in the Project Main Subdirectory contains (we again illustrate with the Cbc project) the macro
     251. If the {{{configure.ac}}} file in the Project Main Subdirectory contains (we again illustrate with the Cbc project) the macro
    2626
     27{{{
    2728AC_COIN_HAS_PROJECT(Cbc)
     29}}}
    2830
    29 then the variable COIN_HAS_CBC will be defined to 1 and there will be a variable CBCSRCDIR which is the path to the Cbc Project Main subdirectory and a variable CBCOBJDIR which is the path to the Cbc object subdirectory. So, if you have some code and want to include the Cbc header files you can do this
    30 
     31then the variable {{{COIN_HAS_CBC}}} will be defined to 1 and there will be a variable {{{CBCSRCDIR}}} which is the path to the Cbc Project Main subdirectory and a variable {{{CBCOBJDIR}}} which is the path to the Cbc object subdirectory. So, if you have some code and want to include the Cbc header files you can do this
     32{{{
    3133if COIN_HAS_CBC
    3234  AM_CPPFLAGS += -I`$(CYGPATH_W) $(CBCSRCDIR)/src`   
    3335
    3436endif
    35 
     37}}}
    3638Similarly you can add the Cbc libraries to the library myLibrary by
    37 
     39{{{
    3840        myLibrary_LDADD = $(CBCOBJDIR)/src/libCbc.la
    39 
    40 2. The variable AM_CPPFLAGS is important. It is used to set the include directories for the header files. It is also used to set additional "-D" preprocessor flags.
     41}}}
     422. The variable {{{AM_CPPFLAGS}}} is important. It is used to set the include directories for the header files. It is also used to set additional {{{-D}}} preprocessor flags.
    4143
    4244
    43 3. There is a very useful header file, config_prj.h that is automatically generated by the configure script and put into the inc subdirectory in the Project Main Subirectory. It has #defines such as
    44 
    45 
     453. There is a very useful header file, {{{config_prj.h}}} (''e.g.'', {{{config_cbc.h}}}) that is automatically generated by the {{{configure}}} script and put into the {{{inc}}} subdirectory in the Project Main Subirectory. It has {{{#defines}}} such as
     46{{{
    4647/* If defined, debug sanity checks are performed during runtime */
    4748/* #undef COIN_DEBUG */
     
    4950/* If defined, the Ampl Solver Library is available. */
    5051#define COIN_HAS_ASL 1
     52}}}
     53These variables can then be used in {{{#ifdef}}} statements inside the C++ code. See {{{CbcConfig.h}}} for an example of how to use the {{{config_prj.h}}} file.
    5154
    52 These variables can then be used in #ifdef statements inside the C++ code. See !CbcConfig.h for an example of how to use the config_prj.h file.
     554. '''Use the Correct Version of Autools'''. What ever you do take the advice given at the [http://projects.coin-or.org/BuildTools/wiki BuildTools] page and put your autotools in {{{$HOME/bin}}} and the configuration files in {{{$HOME/share}}}.  The !BuildTools page says you can alternatively install them in another directory and set the appropriate environment variable. Don't even think about it! Also make sure you don't have alternative versions of the autotools lurking about in directories such as {{{/usr/bin}}} that appear before {{{$HOME/bin}}} in {{{PATH}}}.
    5356
    54 4. Using the Correct Version of Autools. What ever you do take the advice given at the [http://projects.coin-or.org/BuildTools/wiki BuildTools] page and put your autotools in $HOME/bin and the configuration files in $HOME/share.  The !BuildTools page says you can alternatively install them in another directory and set the appropriate environment variable. Don't even think about it! Also make sure you don't have alternative versions of the buildtools lurking about in directories such as /usr/bin that appear before $HOME/bin in PATH.
     57-------------------------------
    5558
    56        
    5759Many projects use third-party software. See [wiki:UsingThirdPartySoftware]
    5860
     61-------------------------------
     62
     63== Using autoreconf ==
     64
     65As distributed, COIN packages do not provide {{{acinclude.m4}}} and {{{aclocal.m4}}}. Instead, these are generated when the script {{{BuildTools/run_autotools}}} is executed. (Have a look at the script to see how it's done; {{{aclocal}}} is responsible for {{{aclocal.m4}}}.) Documentation to the contrary, {{{autoreconf}}} is not capable of correctly (re)generating {{{acinclude.m4}}} and {{{aclocal.m4}}}. If you're writing configuration macros, you want to be using {{{run_autotools}}} to incorporate your changes into {{{acinclude.m4}}} and {{{aclocal.m4}}}. If you're not writing configuration macros, you need to run {{{run_autotools}}} at least once to prodice {{{acinclude.m4}}} and {{{aclocal.m4}}}, after which you can use {{{autoreconf}}}.