[Lemon-devel] static/shared libraries and solvers

Jeffrey Wildman jeffrey.wildman at gmail.com
Fri Dec 30 01:13:26 CET 2011


Hi,

Got a bit of time to work on things again.  Further info/questions inline.


On Tue, Dec 20, 2011 at 2:12 PM, Alpár Jüttner <alpar at cs.elte.hu> wrote:
> Hi,
>
> Fixes to both of your problems are now in the official hg repositories.
> For more info, see
> https://lemon.cs.elte.hu/trac/lemon/ticket/432
> and
> https://lemon.cs.elte.hu/trac/lemon/ticket/433


Thanks, though perhaps the LEMON developers might be amenable to
having -DBUILD_SHARED_LIBS=yes build both static and shared libraries?
 My motivation for the suggestion follows from looking at other Debian
packages (e.g, BOOST, which is also templated) that provide both
static and shared versions of their libraries.  Patch
(support-shared-and-static-library.patch) does this.


I also wrote a patch to link binaries against the shared libraries if
-DBUILD_SHARED_LIBS=yes is supplied.  If BUILD_SHARED_LIBS=no or
unset, then everything (libraries and binaries) would be built and
linked against the static library as they have in the past.  Patch
(link-exec-against-shared.patch) does this, but note that it depends
on the previous patch and supports only GLPK, which leads me to the
next point.


At the moment, I am only able to package LEMON with bindings to GLPK.
As for the other solvers, I can't find CPLEX in Debian's list of
packages, and there appear to be some obstacles in getting support for
both CLP and CBC.  The current version of the Open Solver Interface in
Debian [1] is built against:

 * COIN-OR LP solver (OsiClp)
 * DyLP (OsiDylp)
 * the Volume Algorithm (OsiVol)

FindCOIN.cmake file requests that several COIN-OR libraries be present
before defining COIN_FOUND to be true.  However, only one library is
not available in Debian (libOsiCbc), so as a result,
LEMON_HAVE_{LP/MIP/CLP/CBC} are all false.  I am not that familiar
with all of these libraries, do they all need to be present, or can
certain subsets be employed separately?

Also, as a disclaimer, I am not well versed in licensing.  It seems
earlier work in packaging other COIN-OR libraries was met with some
barriers [2] in getting different libraries to link against one
another.  Beyond the above issues to linking to CLP and CBC, I may
find that there are licensing issues that need to be addressed when I
submit the package to the mentors.debian.net mailing list for review.

[1] http://packages.debian.org/squeeze/coinor-libosi0
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=485858#25


Regards,

-Jeff


>
> Regards,
> Alpar
>
>
> On Mon, 2011-12-19 at 18:38 +0100, Alpár Jüttner wrote:
>> Hi,
>>
>>
>> > However, the current package I have up on mentors uses the autotools
>> > build system (of which I have some familiarity).  I'm now working on
>> > switching that to use cmake (very little familiarity), so I have a bit
>> > of learning to do.  One question I have so far - is there an
>> > option/flag to build shared libraries using cmake, or would that
>> > require changing/adding to the cmake 'configuration' files?
>>
>> To be honest, shared LEMON library is of very little use. Most of the
>> lemon codes are templates. The lib is really tiny, and only a handful of
>> tools do actually need it (i.e: MIL/LP interface, command line argument
>> parser, and color constants (for graphToEps())). So, static linking
>> causes no real overhead. In addition, you will have less runtime
>> dependency using static linking.
>>
>> But, if you really want it, then it needs a single line change in
>> lemon/CMakeLists.txt:
>>
>> *********************************************
>> diff --git a/lemon/CMakeLists.txt b/lemon/CMakeLists.txt
>> --- a/lemon/CMakeLists.txt
>> +++ b/lemon/CMakeLists.txt
>> @@ -57,6 +57,7 @@
>>  INSTALL(
>>    TARGETS lemon
>>    ARCHIVE DESTINATION lib
>> +  LIBRARY DESTINATION lib
>>    COMPONENT library
>>  )
>> *********************************************
>>
>> (This could be added to the repo by default.)
>>
>> Then, you can build shared library by:
>>
>> cmake -DBUILD_SHARED_LIBS=yes ..
>>
>> Regards,
>> Alpar
>>
>>
>> >
>> > Regards,
>> >
>> > -Jeff
>> >
>> >
>> > On Sat, Dec 17, 2011 at 4:41 PM, Alpár Jüttner <alpar at cs.elte.hu> wrote:
>> > > Hi,
>> > >
>> > > Thank you for pointing out this issue. I've created a ticket about it,
>> > > see https://lemon.cs.elte.hu/trac/lemon/ticket/432
>> > >
>> > >> It just appears to be a tarball packaging issue, is this something
>> > >> that can be changed for future releases of LEMON?
>> > >
>> > > Certainly. I'll soon fix the related Makefile.am files in the
>> > > development branch.
>> > >
>> > > Moreover, CMAKE will replace autotool as the default build environment
>> > > starting from the upcoming major release. Thus, sooner or later all of
>> > > these problems will disappear, because the release tarball will
>> > > basically be a simple snapshot of the hg repository.
>> > >
>> > > Best regards,
>> > > Alpar
>> > >
>> > > P.S.: I'm pleased to see your effort for providing Debian LEMON
>> > > packages. Shouldn't we place a link to your packages here:
>> > > https://lemon.cs.elte.hu/trac/lemon/wiki/Downloads
>> > >
>> > >
>> > >
>> > > On Fri, 2011-12-16 at 13:36 -0500, Jeffrey Wildman wrote:
>> > >> Hi,
>> > >>
>> > >> The subject may sound silly, but some explanation will help.  The
>> > >> nodoc tarball (lemon-nodoc-1.2.3.tar.gz) is provided without pre-built
>> > >> documentation files, but I'd still like to build the documentation
>> > >> myself (for purposes of following up on packaging LEMON for
>> > >> Debian/Ubuntu [1,2,3]).  However, I'm experiencing some problems.
>> > >>
>> > >>
>> > >> Issue 1: doc/references.bib is missing from the tarball.  Without the
>> > >> file, I get errors regardless of which build system I use:
>> > >>
>> > >> autotools: 'make html':
>> > >> >make[1]: *** No rule to make target `doc/references.bib', needed by `references.dox'.  Stop.
>> > >> >make[1]: Leaving directory `/home/wraith/Downloads/lemon-1.2.3'
>> > >> >make: *** [html-recursive] Error 1
>> > >>
>> > >> cmake: 'make html':
>> > >> >Scanning dependencies of target html
>> > >> >Traceback (most recent call last):
>> > >> >  File "/home/wraith/Downloads/lemon-1.2.3/scripts/bib2dox.py", line 813, in <module>
>> > >> >    if __name__ == "__main__": main()
>> > >> >  File "/home/wraith/Downloads/lemon-1.2.3/scripts/bib2dox.py", line 811, in main
>> > >> >    filehandler(filepath)
>> > >> >  File "/home/wraith/Downloads/lemon-1.2.3/scripts/bib2dox.py", line 792, in filehandler
>> > >> >    washeddata = bibtexwasher(filecont_source)
>> > >> >UnboundLocalError: local variable 'filecont_source' referenced before assignment
>> > >> >make[3]: *** [doc/CMakeFiles/html] Error 1
>> > >> >make[2]: *** [doc/CMakeFiles/html.dir/all] Error 2
>> > >> >make[1]: *** [doc/CMakeFiles/html.dir/rule] Error 2
>> > >> >make: *** [html] Error 2
>> > >>
>> > >> Solution: (Note: the file doc/references.bib isn't present in the
>> > >> tarball lemon-1.2.3.tar.gz either!)  I went to the main branch to find
>> > >> the file.  Once it is placed in the doc folder, running 'make html'
>> > >> finishes with either autotools or cmake.
>> > >>
>> > >>
>> > >>
>> > >> Issue 2: doc/template.h is missing from the tarball and causes
>> > >> warnings after after running 'make html'.  From doc/doxygen.log:
>> > >>
>> > >> autotools:
>> > >> >error: Tag file `/home/wraith/Downloads/lemon-1.2.3/doc/libstdc++.tag' does not exist or is not a file. Skipping it...
>> > >> >/home/wraith/Downloads/lemon-1.2.3/doc/dirs.dox:28: warning: No matching directory found for command \dir doc/
>> > >> >/home/wraith/Downloads/lemon-1.2.3/doc/coding_style.dox:122: warning: included file template.h is not found.  Check your EXAMPLE_PATH
>> > >>
>> > >> cmake:
>> > >> >error: Tag file `/home/wraith/Downloads/lemon-1.2.3/build/doc/libstdc++.tag' does not exist or is not a file. Skipping it...
>> > >> >/home/wraith/Downloads/lemon-1.2.3/doc/dirs.dox:28: warning: No matching directory found for command \dir doc/
>> > >> >/home/wraith/Downloads/lemon-1.2.3/build/doc/mainpage.dox:20: warning: found more than one \mainpage comment block! Skipping this block.
>> > >> >/home/wraith/Downloads/lemon-1.2.3/doc/coding_style.dox:122: warning: included file template.h is not found. Check your EXAMPLE_PATH
>> > >>
>> > >> Solution: Two of the relevant warnings are silenced by going to the
>> > >> main branch and copying template.h over to doc/ and rebuilding the
>> > >> documentation.
>> > >>
>> > >>
>> > >> FYI, I am downloading the tarballs from here:
>> > >> http://lemon.cs.elte.hu/pub/sources/
>> > >> ...and the files from here:
>> > >> http://lemon.cs.elte.hu/hg/lemon-main/file/9a716871028e/doc
>> > >> ...and I am running Ubuntu 11.10 Desktop 64-bit.
>> > >>
>> > >>
>> > >> It just appears to be a tarball packaging issue, is this something
>> > >> that can be changed for future releases of LEMON?
>> > >>
>> > >> Regards,
>> > >>
>> > >> -Jeff
>> > >>
>> > >> [1] http://lemon.cs.elte.hu/pipermail/lemon-user/2010-March/000165.html
>> > >> [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570930
>> > >> [3] http://mentors.debian.net/package/coinor-lemon
>> > >> _______________________________________________
>> > >> Lemon-devel mailing list
>> > >> Lemon-devel at lemon.cs.elte.hu
>> > >> http://lemon.cs.elte.hu/mailman/listinfo/lemon-devel
>> > >>
>> > >
>> > >
>> >
>>
>>
>> _______________________________________________
>> Lemon-devel mailing list
>> Lemon-devel at lemon.cs.elte.hu
>> http://lemon.cs.elte.hu/mailman/listinfo/lemon-devel
>
>



-- 
Jeffrey W. Wildman II
PhD Candidate
Data Fusion Lab (DFL) - Drexel University
Email: jeffrey.wildman at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: support-shared-and-static-library.patch
Type: text/x-patch
Size: 1054 bytes
Desc: not available
URL: <http://lemon.cs.elte.hu/pipermail/lemon-devel/attachments/20111229/947409f7/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: link-exec-against-shared.patch
Type: text/x-patch
Size: 1410 bytes
Desc: not available
URL: <http://lemon.cs.elte.hu/pipermail/lemon-devel/attachments/20111229/947409f7/attachment-0001.patch>


More information about the Lemon-devel mailing list