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

Francois Margot fmargot at andrew.cmu.edu
Tue Mar 28 16:29:28 EST 2006



On Mon, 27 Mar 2006, Ted Ralphs wrote:

> Lou Hafer wrote:
>
>> What is even more
>>> strange is that if I put junk inside Coin/Makefiles/Makefile.Linux,
>>> around line 87, i.e. something like
>>
>>
>>> ifeq (${LibType},SHARED)
>>> zz
>>>    LD  := $(CXX) -o
>>>    LIBLDFLAGS := -shared
>>>    LIBEXT := $(SHARED_LIBEXT)
>>>    CXXFLAGS += -fPIC
>>>    SHLINKPREFIX := -Wl,-rpath,
>>> else
>>
>>
>>> and then I try to compile BAC, I get:
>>
>>
>>> (cd /home/prov/COIN/Osi/OsiClp && make install)
>>> make[1]: Entering directory `/home/prov/COIN/Osi/OsiClp'
>>> /home/prov/COIN/Makefiles/Makefile.Linux:83: *** missing separator.  Stop.
>>> make[1]: Leaving directory `/home/prov/COIN/Osi/OsiClp'
>>> make: *** [libdepend] Error 2
>>
>>
>>> So, apparently, SHINKPREFIX is set properly in Makefile.Linux, but then
>>> it is unset somewhere.
>>
>>
>> 	Actually, I think not. I'm pretty sure all you're seeing here is
>> 	make's parser complaining, before make actually tries to answer the
>> 	question posed by `ifeq (${LibType},SHARED)'. You can see similar
>> 	effects in shell parsers when dealing with potentially undefined
>> 	variables.
>
> That's what I thought, too. I assumed that make parsed the file first to
> ensure proper syntax, then executed it. However, it actually doesn't
> complain if you put "zz" in the else block. Strange.
>

Indeed, this not not related to parsing. You can easily check
that by adding

ifeq (${LibType},FSFSFS)
zz
     LD  := $(CXX) -o
     LIBLDFLAGS := -shared
endif

at the bottom of the file. Do 'make' in COIN/Examples/BAC and it compiles. 
The problem is with the makefiles in COIN/Cgl, I believe:

Comment out line 12 of COIN/Makefiles/Makefile.Linux:

LibType ?= SHARED

Add junk in the "else" part of the ifeq at the bottom of the file.
Remove all libraries in COIN/lib. Remove COIN/Cgl/Linux-*, if any.
Remove COIN/Clp/Linux-*, if any. Do 'make' in COIN/Examples/BAC.

libClp compiles.
libCgl does not, meaning that LibType is not set to SHARED for Cgl.

Yet, I do not see the essential difference betweeen COIN/Clp/Makefile
and COIN/Cgl/Makefile or between COIN/Clp/Makefile.Clp and 
COIN/Cgl/Makefile.Cgl.

Francois






More information about the Coin-discuss mailing list