hagberg / planarity

Planar graph algorithms
Other
39 stars 11 forks source link

Build fails on Windows because unistd.h is missing #15

Closed NeilStrickland closed 3 months ago

NeilStrickland commented 8 months ago

I tried to install planarity on Windows 11 from PyPi using pip but the build failed because planarity/planarity/src/planarityCommandLine.c has #include <unistd.h> and unistd.h does not exist on Windows systems by default. I cloned the repository, downloaded an ersatz unistd.h from https://gist.github.com/mbikovitsky/39224cf521bfea7eabe9 and an ersatz getopt.h from http://ieng6.ucsd.edu/~cs12x/vc08install/getopt9.zip and copied them into the same directory as planarityCommandLine.c. I was then able to build the package successfully. However, I am sure that this is not the approved way to deal with this kind of thing. I rarely use C and so do not feel competent to submit a PR, sorry about that.

hagberg commented 7 months ago

Thanks for this report. It looks likely that the planarityCommandLine.c file is not needed for the use in this library. It's part of the package this interface is built on (https://github.com/graph-algorithms/edge-addition-planarity-suite) which is used to run from the command line. I suggest we just remove the file from this repository.

SowTheWhirlwind commented 6 months ago

Confirming the same issue here on Windows 10...I was able to get @NeilStrickland's solution working though, brilliant!. I've noticed that deleting planarityCommandLine.c from the src folder didn't seem to help ...hmm

In any case, really appreciate the work here!