wiki:pm-comments

Version 4 (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.

  1. Third party software. There are two kinds of third party software. Software that has some Coin support (scripts and makefiles in the SVN respository -- but not the actual software) and third-party software that does not have Coin suppor. So, for example, if you wish to use AMPL with your project, there is support for that. In the Package Base Directory configure.ac file add

AC_COIN_THIRDPARTY_SUBDIRS([ASL],[ThirdParty?/ASL],[solvers/asl.h]

and in your Package Base Directory Externals file add

ThirdParty?/ASL https://projects.coin-or.org/svn/BuildTools/ThirdParty/ASL/trunk

When you checkout your project, the necessary makefiles and scripts for obtaining the AMPL ASL code will be put into the directory ASL which is directly under the ThirdParty? directory. You can then run a script in this directory to download the necessary AMPL code. If you do this and the configure script determines that the ASL files are there, and you can do useful things such as

if COIN_HAS_ASL libOSModelInterfaces_la_SOURCES += OSnl2osil.cpp \

OSnl2osil.h

endif

The COIN_HAS_ASL is set to true if the necessary ASL code is in the ThirdParty? directory. Also, it sets the following variables

ASLLIB = /Users/kmartin/Documents/files/code/cpp/Coin-OS/ThirdParty/ASL/amplsolver.a -ldl

ASL_CPPFLAGS = -I/Users/kmartin/Documents/files/code/cpp/Coin-OS/ThirdParty/ASL -I/Users/kmartin/Documents/files/code/cpp/Coin-OS/ThirdParty/ASL/solvers

These variables are very useful if you are writing code that uses ASL include files and the ALS library. For example, in a src code Makefile.am you may wish to have something such as

if COIN_HAS_ASL

AM_CPPFLAGS += $(ASL_CPPFLAGS)

endif

You can also have third-party software which you have to download on your own. In your configure.ac file in the Project Main Subdirectory put in

# Check which third party solvers are available ToDo?! AC_COIN_HAS_USER_LIBRARY([Lindo],[LINDO],[lindo.h],[LScreateEnv])

You now need to tell the configure script where to look for the LINDO include files and libraries. Here is how to do that:

configure --with-lindo-lib="-L/Users/kmartin/Documents/files/code/lindo/macosx/lib -llindo -lmosek" --with-lindo-incdir=/Users/kmartin/Documents/files/code/lindo/macosx/include

For Mac OS X you must use the -L library directory option, you cannot give the absolute path to the library. This results in the Makefle having the defined variables

LINDOINCDIR = /Users/kmartin/Documents/files/code/lindo/macosx/include LINDOLIB = -L/Users/kmartin/Documents/files/code/lindo/macosx/lib -llindo -lmosek

very useful for including third-party include files and libraries where necessary. For example,

if COIN_HAS_LINDO

AM_CPPFLAGS += -I$(CYGPATH_W) $(LINDOINCDIR)

endif