[Coin-discuss] Additional linker options

Lou Hafer lou at cs.sfu.ca
Fri Jan 12 18:42:09 EST 2007


Yan,

	I guess the first thing to say is that if you're a project maintainer
aiming to do serious extension to the configuration scripts for COPS, you
probably want to spend some quality time with the autoconf and automake manuals,
and read through the wiki pages on `Using the Autotools In COIN', starting down
toward the bottom of the page
https://projects.coin-or.org/BuildTools/wiki/pm-main.

	That said, I'm still lacking necessary information to advise you.  You
say you want to link in an additional library.  How and where you modify the
autotools scripts depends on how your library relates to the rest of the code
base.

	The simple case is that you're augmenting one of Alps, Bcps, or Blis
with new code, and your new code requires some external library.  In this case,
your initial attempt at setting LDFLAGS should not have failed as quickly as it
did. But I can't really say more without config.log.

	If this is what you need to do, adding code to the appropriate
configure.ac to augment ADDLIBS, either directly or via
AC_COIN_HAS_USER_LIBRARY, is probably the right approach.  Libraries specified
in ADDLIBS end up in the file prjct_addlibs.txt, generated from
prjct_addlibs.txt.in (where prjct would be one of blis, alps, bcps).  You can
see this in the existing configure.ac files.

	If what you're doing is intended to be a new subproject at the same
level as Alps, Biceps, or Blis, then you'll likely be producing completely new 
configure.ac and makefile.am sources. You can use the existing ones as examples.
Again, ADDLIBS is the way to go to specify an additional library that needs to 
be used when linking your subproject.

	If what you're doing is making a new executable, that, too, is a 
slightly different thing. One good example is Cbc/src/makefile.am, where you can 
see how all the various pieces of cbc and cbc-generic are assembled. For cbc, 
there's little variability and everything is specified directly. For 
cbc-generic, you can see the more general pattern, and the use of 
prjct_addlibs.txt.
	
							Lou




More information about the Coin-discuss mailing list