[Coin-discuss] Finding libs at run time and Cbc/Dylp

Lou Hafer lou at cs.sfu.ca
Tue Mar 28 20:57:38 EST 2006


	In response to my previous attempt to explain a makefile problem,
Francois writes (paraphrased)

  ``That explanation doesn't hold water.''

	Huh.  So much for the easy explanation.  So I pulled down Examples/BAC
and Bcp and tried the build.  I think I can do a better job of explaining the
failure mode.

In Examples/BAC/Makefile, you have the lines

default: bc

bc : libdepend
        ${MAKE} -f Makefile.bc bcps

libdepend:
        (cd $(CoinDir)/Osi/OsiClp && ${MAKE} install)
        (cd $(CoinDir)/Cgl && ${MAKE} install)

The result of typing `make' is that control goes from default to bc to
libdepend.  The first line at libdepend heads off to build OsiClp.  At the top
of OsiClp/Makefile there's a line that sets LibType.  All of Clp, Vol, and Osi
are build as dependent builds to OsiClp, hence they see the value of LibType
established in OsiClp.  That value is lost when control returns here.  When the
second line attempts to build Cgl, it fails, because Cgl/Makefile does not
define LibType --- that won't happen until Makefile.Cgl.

	This is the immediate cause of failure.
	
	Francois, as you point out, there's no structural difference between,
say, Clp/Makefile and Cgl/Makefile, or Clp/Makefile.Clp and Cgl/Makefile.Cgl.
It's just the way they are called in this build.

	Laci's fix to Makefile.Linux, which gives a default value to LibType,
neatly solves the problem.

	We should probably be asking some global questions, though. The current
usage of Makefile.coin and Makefile.location needs to be looked at with a 
critical eye.

						Lou




More information about the Coin-discuss mailing list