ntamas / plfit

Fitting power-law distributions to empirical data, according to the method of Clauset, Shalizi and Newman
GNU General Public License v2.0
47 stars 17 forks source link

SO library via autotools machinery #19

Closed jgmbenoit closed 3 years ago

jgmbenoit commented 6 years ago

In view to build a SO library for plfit in such a way it can be use in our own code, this chain of patches sets up a parallel autotools machinery. For now, the Python part is not set up., but it is a matter of time. Pleas ehave a look and let me know what you think.

ntamas commented 6 years ago

Commit f109b2a could be merged into the trunk as is; I would be happy to merge it if you separate it into a new PR.

ntamas commented 6 years ago

Re f8c8474: does hzeta.c use anything from config.h so that it needs to depend on it?

ntamas commented 6 years ago

Commit cfee8d5 is a good idea; I think it could be merged as is (if you file a separate PR with it).

ntamas commented 6 years ago

In general: I appreciate all the efforts you have put into implementing an autotools machinery around plfit very much; however, I am a bit reluctant to include it in master because my preferred toolset is CMake and I cannot guarantee that I won't break anything with the autotools part - and I will probably not notice it if I do because I won't be using it regularly. So, even if I merge it in master, I cannot take the responsibility of maintaining it if anything breaks.

May I ask you what is your overall goal with adding an autotools-based build system? Is it only to be able to build a shared library? Or is there another project that would integrate plfit and that cannot cope with the build files that CMake generates?

jgmbenoit commented 4 years ago

My motivation was to package plfit for Debian (I am a DD). Now I can see that plfit comes with igraph.

jgmbenoit commented 4 years ago

Otherwise CMake is fine for package. I just prefer autotools. It was indeed about building a share library.

ntamas commented 4 years ago

CMake will build a shared library if you configure it like this:

mkdir build
cd build
cmake .. -DBUILD_SHARED_LIBS=on

I haven't actually tried the shared libs, but they seem OK for me. One problem with CMake is that you cannot build both shared and static libs in the same compilation pass, you need to configure CMake once for static libs and once for shared.

jgmbenoit commented 3 years ago

I can build in two passes the shared and the static libraries. However, they are not getting install at install time. Must we add some cmake material ?

jgmbenoit commented 3 years ago

I have just figured out how to install the shared and static libraries with cmake.

jgmbenoit commented 3 years ago

I am on my way to pull similar material but cmake centric ones.