help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Patch for GLPK 4.35 to support SWIG


From: Harley Mackenzie
Subject: Re: [Help-glpk] Patch for GLPK 4.35 to support SWIG
Date: Fri, 30 Jan 2009 02:16:20 +0300

I would definitely support the addition of the SWIG changes into the 
GLPK main source as it opens up the API to a large range of languages 
and, although the interfaces can be crude, offers a really painless way 
of enhancing the usability of GLPK.

Harley Mackenzie

Kelly Westbrooks wrote:
> Hello,
>
> I am a PhD student studying bioinformatics and I uses GLPK to solve linear 
> programming problems that I encounter in my research. I write my software in 
> high level languages such as Java or Ruby, and since GLPK is written in C, I 
> make calls to GLPK using my language's foreign function interface.
>
> Rather than write an entire foreign function interface for GLPK by hand, I 
> use SWIG (http://www.swig.org/) to machine-generate the interface for me. 
> Unfortunately, the source for GLPK needs to be (slightly) modified for SWIG 
> to process it correctly and generate the interface for the target language.
>
> Until now, I've been maintaining private forks of GLPK and applying the 
> changes manually each time I upgrade to a new release. Today, I went ahead 
> and packaged them into a patch file so that (hopefully) they can make it into 
> the trunk and save me the effort of maintaining my own local GLPK copy.
>
> The patch does two things:
> (1) Adds "glpk.i" to the root of the source tree. This is a SWIG interface 
> file that SWIG users can use to generate an interface to GLPK in their 
> language of choice.
>
> (2) Modifies "include/glpk.h" so that SWIG doesn't complain when generating 
> the foreign interface. It seems like glpk.h contains some redundant lines 
> that can be safely removed without compromising the current GLPK build and by 
> removing those lines it also satisfies SWIG's demand for a clean C interface 
> file.
>
> This patch DOESN'T modify the GLPK build to generate any foreign language 
> interfaces...that can be left up to GLPK users themselves, since it is hard 
> to predict in advance what language support they desire.
>
> To apply the patch, just place the patchfile in the same directory as the 
> directory containing the GLPK 4.35 source code (the directory structure 
> should look like the following:)
>
> /path/to/some/directory:
>   glpk-4.35/
>   swig_support.patch
>
> Then execute:
> cd /path/to/some/directory/glpk-4.35
> patch -p1 < ../swig_support.patch
>
> I hope that someone else finds this useful. If it make it into GLPK trunk, 
> then at least I would find it useful!
>
> --Kelly Westbrooks
>
>
>
>       
> ------------------------------------------------------------------------
>
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk
>   

-- 
------------------------------------------------------------------
     Dr. Harley Mackenzie         ABN:   36 348 783 012

     HARD Software                Web:   www.hardsoftware.com
     PO BOX 8004                  Tel:   +61 3 5222 3435
     Newtown 3220, Australia      Email: address@hidden
------------------------------------------------------------------








reply via email to

[Prev in Thread] Current Thread [Next in Thread]