From: Matthew Fernandez Date: Mon, 2 Jan 2023 17:24:43 +0000 (-0800) Subject: Autotools: discover libANN manually if ann.pc is missing X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3faa5adc9ab57d480eed15951c0bc6cc18c4269f;p=graphviz Autotools: discover libANN manually if ann.pc is missing On Debian and Debian derivatives (e.g. Ubuntu) the libann and libann-dev packages ship without an ann.pc file to support `pkg-config`. As a result of this, `pkg-config` cannot find libANN and concludes it is not installed. This change teaches the Autotools build system how to discover libANN manually if the `pkg-config` technique fails. Note that we need to use `AC_CHECK_FILE` instead of `AC_CHECK_HEADER` because libANN is in C++. Gitlab: closes #1835 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 1be153c54..075c03563 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 from ~3.8MB to 32MB. #1710 - Reserved stack size on macOS for the `dot` binary when built with CMake has been increased from 8MB to 32MB. #1710 +- The Autotools build system can now find libANN on Debian-based operating + systems, enabling compilation of libmingle and `mingle`. #1835 ### Fixed diff --git a/ci/tests.py b/ci/tests.py index 73f917fc1..e2167a2a8 100644 --- a/ci/tests.py +++ b/ci/tests.py @@ -115,12 +115,6 @@ def test_existence(binary: str): os_id = _freedesktop_os_release().get("ID") - # FIXME: Remove skip when - # https://gitlab.com/graphviz/graphviz/-/issues/1835 is fixed - if os_id == "ubuntu" and binary == "mingle" and not is_cmake(): - check_that_tool_does_not_exist(binary, os_id) - pytest.skip(f"mingle is not built for {os_id} (#1835)") - # FIXME: Remove skip when # https://gitlab.com/graphviz/graphviz/-/issues/1834 is fixed if os_id == "centos" and binary == "smyrna": diff --git a/configure.ac b/configure.ac index ef8a8113f..2439de5e7 100644 --- a/configure.ac +++ b/configure.ac @@ -1924,7 +1924,18 @@ else AC_SUBST([ANN_CFLAGS]) AC_SUBST([ANN_LIBS]) ],[ - use_ann="No (no ann.pc found)" + # fall back discovery for the Debian ecosystem which does not ship an ann.pc + AC_CHECK_FILE(/usr/include/ANN/ANN.h, [ + ANN_CFLAGS= # nothing required + AC_CHECK_LIB(ann, ann_visit_pts, [ + ANN_LIBS=-lann + use_ann="Yes" + ], [ + use_ann="No (no ann.pc or libANN found)" + ]) + ], [ + use_ann="No (no ann.pc or ANN.h found)" + ]) ]) fi AM_CONDITIONAL(WITH_ANN, [test x"${use_ann%% *}" = "xYes"])