Skip to content
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

set rpath for external libsemigroups #954

Merged
merged 2 commits into from
Sep 16, 2023

Conversation

dimpase
Copy link
Contributor

@dimpase dimpase commented Sep 13, 2023

set rpath for external libsemigroups, so that LD_LIBRARY_PATH is not needed if libsemigroups is installed to a non-standard location

@dimpase dimpase mentioned this pull request Sep 13, 2023
@dimpase
Copy link
Contributor Author

dimpase commented Sep 13, 2023

I've left m4/ax_check_libsemigroups.m4 largely as it was, no refactoring. I only split two very long strings into two, and
added the necessary stuff.

@james-d-mitchell james-d-mitchell added bug-fix A label for PRs that fix a bug. build-system A label for issues or PRs related to the build system labels Sep 14, 2023
@james-d-mitchell
Copy link
Collaborator

Thanks @dimpase

Copy link
Collaborator

@james-d-mitchell james-d-mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to do exactly what is desired, happy to approve. @fingolfin could you please also have a quick look at this if you have the time?

Copy link
Contributor

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The principle seems fine to me, but I have some minor remarks on details.

@@ -53,6 +55,8 @@ AC_DEFUN([AX_CHECK_LIBSEMIGROUPS], [
else
LIBSEMIGROUPS_VERSION="$(pkg-config --modversion libsemigroups)"
AC_MSG_NOTICE([using external libsemigroups $LIBSEMIGROUPS_VERSION])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation looks odd here (maybe tabs versus spaces), but that was of course already there before this PR, so not an objection to this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Indeed, this whole file mixes tabs and spaces liberally. Probably best to ignore this for this PR)

Comment on lines 18 to 19
[AC_MSG_NOTICE([ignoring flag --with-external-libsemigroups, the Semigroups configure file
was created on a system without m4 macros for pkg-config available...])])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be undone, it causes the error to change from

...
checking for awk... awk
configure: using included libsemigroups...
configure: error: libsemigroups is required, clone or download the repo from https://github.com/libsemigroups/libsemigroups into this directory

which is sensibly wrapped in my terminal, to

checking for awk... awk
configure: using included libsemigroups...
configure: error: libsemigroups is required, clone or download the repo from
                                  https://github.com/libsemigroups/libsemigroups into this directory

which is rather weird.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I think this change should be undone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no two equal terminals, besides, such long lines of code aren't helping.
I can try to make sure the output is formatted better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested the message? It was perfectly legible for me before your changes but not anymore afterwards. Was the experience different for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to avoid extra-long lines in the source, most of all.

Comment on lines 31 to 32
[AC_MSG_ERROR([libsemigroups is required, clone or download the repo from
https://github.com/libsemigroups/libsemigroups into this directory])])])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also be undone, IMHO

Comment on lines +58 to +59
PKG_CHECK_VAR([LIBSEMIGROUPS_RPATH], [libsemigroups], [libdir],
[AC_SUBST([LIBSEMIGROUPS_RPATH],[-Wl,-rpath,${LIBSEMIGROUPS_RPATH}])])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the core of the change. Looks OK to me.

@@ -138,7 +138,7 @@ gen/%.$(GAP_OBJEXT): %.s Makefile
# build rule for linking all object files together into a kernel extension
$(KEXT_SO): $(KEXT_OBJS)
@mkdir -p $(@D)
$(QUIET_GAC)$(GAP_CXX) -o $@ $(GAP_LDFLAGS) $(GAC_LDFLAGS) $(KEXT_OBJS) $(KEXT_LDFLAGS)
$(QUIET_GAC)$(GAP_CXX) -o $@ $(GAP_LDFLAGS) $(GAC_LDFLAGS) $(KEXT_OBJS) $(KEXT_LDFLAGS) $(LIBSEMIGROUPS_RPATH)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say this should rather be added to KEXT_LDFLAGS, that'll be better in the long run. But for now, either works shrug

@james-d-mitchell
Copy link
Collaborator

Thanks @fingolfin, @dimpase I just rebased onto main I can make Max's suggested changes if you want?

@dimpase
Copy link
Contributor Author

dimpase commented Sep 16, 2023

Thanks @fingolfin, @dimpase I just rebased onto main I can make Max's suggested changes if you want?

It's up to you. I'd rather move the 2nd lines of these long error messages a bit to the left,
to reduce the unfortunate indentation.

@dimpase
Copy link
Contributor Author

dimpase commented Sep 16, 2023

You can also wrap the messages in m4_normalize(), this will remove any new lines and extra spaces/tabs, I think - but keep short lines in the source.

@fingolfin
Copy link
Contributor

which terminals do you know that do not wrap long too lines?

In any case, I am sure the message can be improved, but the current form in this PR isn't an improvement anywhere: on terminals that do wrap around it is worse, on terminals that don't it would also be worse, as they still couldn't see most of the second line.

@dimpase
Copy link
Contributor Author

dimpase commented Sep 16, 2023

I think with the change I just pushed they will be again printed as one line - but split in the source.

Copy link
Contributor

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks!

@james-d-mitchell james-d-mitchell merged commit 5473b4c into semigroups:main Sep 16, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix A label for PRs that fix a bug. build-system A label for issues or PRs related to the build system
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants