gap icon indicating copy to clipboard operation
gap copied to clipboard

why is gap-install linked with libgap?

Open dimpase opened this issue 11 months ago • 2 comments

In Makefile.rules one has

# build rule for the gap executable used by the `install-bin` target
build/gap-install: libgap$(SHLIB_EXT) cnf/GAP-LDFLAGS cnf/GAP-LIBS cnf/GAP-OBJS build/obj/build/main.c.o
        $(QUIET_LINK)$(LINK) $(GAP_LDFLAGS) build/obj/build/main.c.o $(GAP_LIBS) -L${abs_builddir} -lgap -o $@

endif

Does this mean that gap as installed by make install is using libgap, unlike ./gap produced by make ?

And so, in particular, packages producing GAP kernel extensions might need to be linked to libgap (we observe errors on a recent arm64 macOS to this extent). @culler

dimpase avatar Jan 30 '25 01:01 dimpase

Does this mean that gap as installed by make install is using libgap, unlike ./gap produced by make ?

Yes exactly.

And so, in particular, packages producing GAP kernel extensions might need to be linked to libgap

Yup. As a general rule, you need to link a kernel extension against the kernel it is supposed to be used with, and using the sysinfo.gap resp. gac that was built / installed with that kernel, as only that is guaranteed (well, up to mistakes on our part of course) to have the correct compiler and linker flags.

fingolfin avatar Feb 01 '25 23:02 fingolfin

I am not sure I understand what "link a kernel extension against the kernel" means. As I try the current master branch on arm64 macOS, with cd bar && ./configure --prefix=foo && make && make install, I then configure/build, say, crypting package with

./configure foo/lib/gap # sysroot.gap is there
make && make install

Then I fake installing the packages by

ln -s bar/pkg foo/share/gap/

and foo/bin/gap runs and successfully loads crypting (and runs its tests). However, crypting.so isn't linked to anything except a system library, i.e.

% otool -L bin/aarch64-apple-darwin24-default64-kv10/crypting.so 
bin/aarch64-apple-darwin24-default64-kv10/crypting.so:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)
% 

dimpase avatar Feb 02 '25 03:02 dimpase

I see nothing actionable here, in particular no concrete error or issue that we could potentially reproduce and address.

If you have a concrete issue & reproducer please file a new issue.

fingolfin avatar Jun 23 '25 20:06 fingolfin

(see also https://github.com/gap-system/gap/pull/5780 which might or might not be relevant to you)

fingolfin avatar Jun 23 '25 20:06 fingolfin