wbreeze / davenport-ruby

Ruby binding for C Implementation of Davenport's algorithm
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Compile Davenport library if not present at installation #1

Open wbreeze opened 5 years ago

wbreeze commented 5 years ago

This Gem doesn't compile properly when it is installed. The native C code ext/davenport/davenport.c needs compiling. It would be nice if it brought-in the davenport C implementation to compile and install as well.

wbreeze commented 5 years ago

This repository, wbreeze/dvt has a smoke test.

wbreeze commented 5 years ago

I've been working from:

Writing and compiling

Compiling and distributing

which I am also using. All of this is mixed up with the Hoe set of rake tasks that I'm trying to use, with the difficulty that I still don't have the gem installing its native component properly. Hoe is perhaps more distraction than value add due to it promises a lot but I'm reading the code as documentation. Not sure.

wbreeze commented 5 years ago

It's possible that rake-compiler wants me to cross-compile and prepare all of the platforms from the dev environment, rather than compile on the native platform. I want to compile on the native platform at installation. That means the native platform will have to have the C compiler installed, which isn't such a long throw. It already has it for installing the davenport C library.

wbreeze commented 5 years ago

The gem now properly installs and compiles the C extension. Having the install take care of installing the Davenport library, if it isn't already present, might work if it compiles the library locally as a static library, and compiles the C extension against that static library. Dynamic libraries require LOAD_PATH hacks although... Well, I think it's possible. It isn't high on my list.