-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add a gap-config
script
#275
Comments
This comment has been minimized.
This comment has been minimized.
gap-config
script as well as a gap.pc
pkg-config filegap-config
script
The if [[ -x "$GAPPATH/gap-config" ]]; then
eval $("$GAPPATH/gap-config" --sysinfo)
else
. "$GAPPATH/sysinfo.gap"
fi And similar for Makefiles. I.e. we use The great advantage of doing it this way is that it is dead easy for us to make the switch. We can then worry about more fancy options for |
This seems to come from pre-libgap times. pkg-config's .pc file has an advantage of being more or less standard nowadays (e.g. GMP has it, MPFR has it), and it has reasonable autoconf support (macros for checking versions, getting values of variables, etc) |
This is particularly important now that libgap's headers require a garbage collector to be specified. Reading GAP_CPPFLAGS from sysinfo.gap might be enough for gap packages, but a more standard solution is needed for other third party software (such as Sagemath) that wants to use libgap. |
That's not intentional, please open a bug report, then we can habe this fixed in 4.12.1 (it should be easy).
I agree it would be nicer (hence I opened this issue, and would welcome patches adding this). but claiming it is necessary seems like a stretch? I mean, sure, it would of course make life a little bit easier, but extracting the required data from |
That's great to hear, filed #5075 |
an advantage of pkg-config is that interfaces to it exist in autoconf, in python, etc. (besides the ability to call it from shell). while one can replicate this functionality by parsing non-standard meta-data, and writing micro-parsers, it'd be much nicer if it's not needed. |
should we close this in view of #5080 done? |
OK, fine by me. If someone still wants this, they can (ask to) reopen or file a new issue |
A
gap-config
script would allow the user (and more importantly: the build systems of GAP packages) to query the CFLAGS, LDFLAGS, etc. that were used to build GAP, as well as various other options. Currently this is handled by squeezing all this data intosysinfo.gap
-- but that file is static, and it is currently read / "included" into both shell scripts and Makefiles, so we are very limited in what we can put into it... If we instead parse and read the output of a tool, we are much more flexible. One reason why a static file is not enough is the usecase of a relocatable GAP installation, which can be installed anywhere; right now one can kinda do this by regeneratingsysinfo.gap
as needed, but that only works if one has an opportunity to do so before something accesses that file.(In addition to a
gap-config
script one could also as add agap.pc
pkg-config file; but no GAP package is able to use such a file right now, and adding support for parsing them (for those packages which don't use autoconf, which are quite a few) is considerably more work, with no immediate benefit to us. (Yes, pkg-config could be nice to specify further dependency, e.g. that of thefloat
package onmpfr
and more; but again, for this to be useful, the build systems of our packages would have to be able to deal with all that, which is not a given. As such, while I wouldn't mind pkg-config support, it's a much lower priority for me).The
gap-config
script would complement or replacesysinfo.gap
, and also likelygac
would use it / share code with it.Of courrse these files are only useful if scripts can find them, which typically would mean that the user has to "install" GAP first, say via a to-be-implemented "make install". But once that is done, it would allow the build systems of packages to automatically "discover" the GAP installation and all relevant flags.
In particular, packages which also use GMP or readline could use this to ensure they link against the exact same GMP / readline as GAP did, which is quite important.
To support multiple "configs" (32bit, 64bit, HPC-GAP...) one would ensure that each GAP build (i.e. including out-of-tree builds) gets its own
gap-config
(just like they all have their ownsysinfo.gap
); then to build a package, just point it at the desiredgap-config
resp. the directory containing the desiredgap-config
.The text was updated successfully, but these errors were encountered: