wiki:pm-comments

Version 17 (modified by kmartin, 13 years ago) (diff)

--

Hints, tricks, bugs, and suggestions

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 BuildTools maintainers to improve the system and documentation.


Here are a few comments from a person new to the autotools. Experienced users may not find these useful.

First, some important terminology. This terminology is consistent with that used by Andreas Waechter in his BuildTools? Wiki.

Project Base Directory: If, for example, you download the Cbc project via svn using

svn co https://projects.coin-or.org/svn/Cbc/trunk  Coin-Cbc

then Coin-Cbc is the Project Base Directory.

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.

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.

The following points are all made at the BuildTools? https://projects.coin-or.org/BuildTools/wiki/WikiStart Wiki. I am just summarizing a few key points that are useful to have at your fingertips.

  1. If, the configure.ac file in the Project Main Subdirectory contains (we again illustrate with the Cbc project) the macro

AC_COIN_HAS_PROJECT(Cbc)

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

if COIN_HAS_CBC

AM_CPPFLAGS += -I$(CYGPATH_W) $(CBCSRCDIR)/src

endif

Similarly you can add the Cbc libraries to the library myLibrary by

myLibrary_LDADD = $(CBCOBJDIR)/src/libCbc.la

  1. 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.
  1. 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

/* If defined, debug sanity checks are performed during runtime */ /* #undef COIN_DEBUG */

/* If defined, the Ampl Solver Library is available. */ #define COIN_HAS_ASL 1

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.

  1. Using the Correct Version of Autools. What ever you do take the advice given at the 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.

Many projects use third-party software. See UsingThirdPartySoftware