[Haskell-cafe] Re: ANNOUNCE: A Levenberg-Marquardt implementation

Maurí­cio CA mauricio.antunes at gmail.com
Fri Sep 11 11:55:25 EDT 2009


 > The C library prints error messages to stderr. (...)

 > Attached is the patch to the C levmar library.

Thanks for the file.

 > The license issue is indeed a problem. Either your (linked +
 > distributed) code must be GPL or you must acquire a different
 > (commercial) license from the author of the C library.

I don't think the GPL is itself a problem, I just meant that by
packaging levmar with your bindings-levmar you probably have to
GPL bindings-levmar itself. Although, since you used BSD, I don't
think anyone will waste time bothering you about that.

 > Lapack has to be installed on the hackage server in order for
 > the package to build. Another option is to temporarily remove
 > the dependency on lapack from the cabal file. (...). But the
 > downside is that someone won't be able to cabal install it
 > without first modifying the .cabal file. That is unacceptable in
 > my opinion.

Yes, this is difficult to solve... I've even asked that some nice,
trusted C libraries could be installed on hackage so that we could
bind to them. Maybe this can be accepted in the future if the idea
of having many good quality bindings-* packages grow up.

In the mean time, we have a two-sided problem: if we release a
package with linking options removed we have to edit cabal file,
which is unacceptable in my opinion too; and if we do not, all
bindings-*, as well as all packages built on them, will be marked
with "Build failure" on hackage and lack documentation, which is
also unnaceptable...

The good thing is that this problem can be isolated on bindings-*
packages. If it is solved, it is solved once and for all. So far,
my solution has been this:

* to leave a 'pkg-config' line in bindings-* cabal file. This way,
your package can be used properly as long as your installed
library has pkg-config configuration, and this is easy to add
(even for your favorite distribution library package) if it
doesn't.

* to comment that pkg-config line, so that hackage will build your
package. Users can just add something like 'pkgconfig-depends: levmar'
to their own packages.

Though I have no reason to claim this is the best solution.

Also: bindings-common has some macros that could easy your job. You
could have used, for instance:

#bindings_frac LM_INIT_MU
#bindings_frac LM_STOP_THRESH
#bindings_frac LM_DIFF_DELTA

Although this would add a dependency, so I don't know if
it's worth.


Best,
Maurício



More information about the Haskell-Cafe mailing list