Skip to content

planarity-4.x compatibility #741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
orlitzky opened this issue Apr 1, 2025 · 2 comments · May be fixed by #753
Open

planarity-4.x compatibility #741

orlitzky opened this issue Apr 1, 2025 · 2 comments · May be fixed by #753
Labels
gap-days-brussels-2025 Label for things we might work on in Brussels

Comments

@orlitzky
Copy link
Contributor

orlitzky commented Apr 1, 2025

There's a new version of planarity out:

The headers have been moved around a bit, causing the digraphs build to fail when an external libplanarity (4.x) is used. Here's the lazy version of the patch:

--- a/src/planar.c
+++ b/src/planar.c
@@ -38,10 +38,7 @@
 #include "c/graphK33Search.h"
 #include "c/graphK4Search.h"
 #else
-#include "planarity/graph.h"
-#include "planarity/graphK23Search.h"
-#include "planarity/graphK33Search.h"
-#include "planarity/graphK4Search.h"
+#include "planarity/graphLib.h"
 #endif
 #if defined(__clang__)
 #pragma clang diagnostic pop

No other changes are required though, so it should be possible to support both versions by trying both sets of headers.

@james-d-mitchell james-d-mitchell added the gap-days-brussels-2025 Label for things we might work on in Brussels label Apr 7, 2025
@james-d-mitchell james-d-mitchell linked a pull request Apr 8, 2025 that will close this issue
@james-d-mitchell
Copy link
Member

I've spent a bit of time trying to update to edge-planarity 4 today. The patch you've suggested above doesn't currently work unfortunately. I could update the vendored version of planarity to v4 without too much trouble. However,
it seems that the conda version of planarity is still v3, and so any changes to Digraphs that we might try to include now, would have to detect what version of planarity is available. Because of the wholesale renaming of files in the v4 release, and the fact that in planarity-3.x there is no macro defining the version number, this is more work than I'm willing to undertake at the present time.

I'll happily revisit this when conda includes planarity v4.

@orlitzky
Copy link
Contributor Author

No problem, I understand. I could have done it properly myself if not for lack of time.

I've used the patch above on Gentoo where I have the luxury of being able to force external libplanarity >= 4.0. The old header paths like planarity/graphK23Search.h no longer exist in 4.x, so checking for planarity-3.x should be as easy as checking for those headers, and then defining some constant to indicate whether the 3.x or 4.x paths should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gap-days-brussels-2025 Label for things we might work on in Brussels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants