flatsurf / e-antic

Embedded algebraic number fields
https://flatsurf.github.io/e-antic/libeantic/
GNU Lesser General Public License v3.0
12 stars 11 forks source link

Check for arb headers also with prefix arb/ #200

Closed mkoeppe closed 3 years ago

mkoeppe commented 3 years ago

This is how Fedora installs the headers, see https://trac.sagemath.org/ticket/

dimpase commented 3 years ago

it is in https://trac.sagemath.org/ticket/32376

videlec commented 3 years ago

Is there a standard way to deal with that?

One way is to have alternative include statements, eg on non-Fedora systems

#include <arb.h>

and on Fedora

#include <arb/arb.h>
dimpase commented 3 years ago

it depends on the build system; no idea about cmake; with autotools one can certainly try searching for different headers, and e.g. set up CPPFLAGS with -I/usr/include/arb

videlec commented 3 years ago

Though that is precisely against what Fedora is trying to do : avoid name conflicts for header files.

dimpase commented 3 years ago

I'd say that using <arb.h> in the 1st place was a mistake

videlec commented 3 years ago

I also agree with that. And this is what Fedora "solved" by moving the headers in /usr/incude/arb.

mkoeppe commented 3 years ago

To deal with the similar situation with cddlib, in LattE we check the (relative) header prefixes that occur in the wild (https://github.com/latte-int/latte/blob/master/m4/cddlib-check.m4#L28) and use configuration variables in the #include - see https://github.com/latte-int/latte/blob/master/code/latte/latte_cddlib.h#L33

saraedum commented 3 years ago

Has upstream arb agreed to this change? Otherwise, I tend to say that Fedora users should add the extra -I to their CPPFLAGS.

saraedum commented 3 years ago

I'd vote to improve the error message for Fedora users but not actually introduce any convoluted logic for this.