Opened 3 years ago

Closed 3 years ago

#27016 closed task (fixed)

DESTDIR support for gcc, improvements to gfortran

Reported by: embray Owned by:
Priority: major Milestone: sage-8.7
Component: build Keywords: destdir gcc
Cc: vbraun, dimpase, jdemeyer, Konrad127123 Merged in:
Authors: Erik Bray Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: a1d8ce9 (Commits, GitHub, GitLab) Commit: a1d8ce92b02596d9291e0a58f2376b53c628acdc
Dependencies: Stopgaps:

Status badges

Description

This does a few things:

  • Updates the gcc SPKG to support DESTDIR installation so that it can now be uninstalled as well
  • This includes a patch (adapted from Debian) to make gcc install libraries to ${prefix}/lib instead of ${prefix}/lib64 on Linux (this does not appear to be a problem on Cygwin, macOS, or FreeBSD that I'm aware of).
  • Additional refactoring to reduce duplication between the gcc and gfortran SPKGs: This includes the patches from gcc as the can also be relevant to gfortran.

I've tested this a good bit on Linux (being able to uninstall gcc now is nice), but it needs more testing on other platforms, particularly macOS since it's the primary case for installing this package in the first place, and involves additional workarounds.

This would also fix #26996 for the case of installing gfortran on Linux.

Change History (19)

comment:1 Changed 3 years ago by embray

  • Status changed from new to needs_review

comment:2 Changed 3 years ago by embray

  • Cc vbraun dimpase jdemeyer jhpalmieri added

Pinging a few people who might be interested in reviewing this ticket. If not, sorry for the noise--you can remove yourself from the CC field.

comment:3 Changed 3 years ago by jhpalmieri

  • Cc jhpalmieri removed

comment:4 Changed 3 years ago by dimpase

test, please ignore

comment:5 follow-up: Changed 3 years ago by jhpalmieri

I only have access to OS X, so I have removed myself.

By the way, once you are on the cc list, there is no apparent way to remove yourself. I removed myself and asked Dima to send a test message, which I received. (Thanks, Dima!) I don't mind, I can handle a few extra email messages. But I wonder if there is a way to fix this aspect of trac's configuration for those who are actually bothered by extra trac messages.

I suppose one other thing to try is to have someone else do the removal from the cc list: it may be that once someone displays any activity on the ticket, they are automatically cc'ed after that, even if their only activity was to remove their name from the cc list. If someone else has to do it, that's a lot of effort to be removed from the cc list.

Last edited 3 years ago by jhpalmieri (previous) (diff)

comment:6 in reply to: ↑ 5 ; follow-up: Changed 3 years ago by embray

Replying to jhpalmieri:

I only have access to OS X, so I have removed myself.

Actually that's a large part of why I pinged you. Although this was motivated by fixing an issue on Linux, OSX is the primary reason we package gcc and gfortran at all. And since this reworks those packages a bit it needs OSX testing. Plus, whatever disagreements we've had in the past, your reviews are always thorough and thoughtful. If you don't have time though no problem--I have SSH access to an OSX machine now too (10.14 I believe).

By the way, once you are on the cc list, there is no apparent way to remove yourself. I removed myself and asked Dima to send a test message, which I received. (Thanks, Dima!) I don't mind, I can handle a few extra email messages. But I wonder if there is a way to fix this aspect of trac's configuration for those who are actually bothered by extra trac messages.

Hmm, that is annoying. I believe that once you comment on a trac ticket you're "subscribed" to it, even if your only interaction was to remove yourself from the CC list.

Notification settings are on https://trac.sagemath.org/prefs/notification and you want to make sure to not have "Ticket that I previously updated is modified" selected. Unfortunately I don't think there's otherwise a built-in way to "unsubscribe" from a specific ticket.

comment:7 Changed 3 years ago by slelievre

The un-cc-ing problem has been discussed before.

I just opened a wiki page here with pointers to relevant pages on Trac's Trac:

comment:8 in reply to: ↑ 6 Changed 3 years ago by jhpalmieri

Replying to embray:

Replying to jhpalmieri:

I only have access to OS X, so I have removed myself.

Actually that's a large part of why I pinged you. Although this was motivated by fixing an issue on Linux, OSX is the primary reason we package gcc and gfortran at all. And since this reworks those packages a bit it needs OSX testing. Plus, whatever disagreements we've had in the past, your reviews are always thorough and thoughtful. If you don't have time though no problem--I have SSH access to an OSX machine now too (10.14 I believe).

Sorry, I misread something in the ticket description so I thought it didn't apply.

I don't know if I will have the time. I have installed gfortran on all of my OS X machines precisely so I don't have to build Sage's gcc each time I build Sage, so I would have to temporarily hide gfortran, build with and without this branch, making sure everything works as advertised. If I stumble on some free time soon I will try to do it, but it may not happen.

comment:9 Changed 3 years ago by embray

I've tested this on OSX and had success. As I had hoped it doesn't ultimately change anything about how gcc is built and installed on OSX. In other words, nothing changed functionality-wise as intended. This is just mostly refactoring.

comment:10 follow-up: Changed 3 years ago by dimpase

I found out I cannot really test this on FreeBSD 12.0, as building of gfortran fails due to some cryptic linker-related problem I don't want to look into (it's not a problem for that platform per se, as it has a luxurious choice of two free fortran compilers, gfortran and flang).

comment:11 in reply to: ↑ 10 ; follow-up: Changed 3 years ago by embray

Replying to dimpase:

I found out I cannot really test this on FreeBSD 12.0, as building of gfortran fails due to some cryptic linker-related problem I don't want to look into (it's not a problem for that platform per se, as it has a luxurious choice of two free fortran compilers, gfortran and flang).

Is that true, I'm guessing, even without this patch?

comment:12 in reply to: ↑ 11 Changed 3 years ago by dimpase

Replying to embray:

Replying to dimpase:

I found out I cannot really test this on FreeBSD 12.0, as building of gfortran fails due to some cryptic linker-related problem I don't want to look into (it's not a problem for that platform per se, as it has a luxurious choice of two free fortran compilers, gfortran and flang).

Is that true, I'm guessing, even without this patch?

Correct. Sorry for not saying this right.

comment:13 Changed 3 years ago by embray

That's okay, I just wanted to make sure that was the case. Even if FreeBSD support is still not 100% I wouldn't want to make it worse somehow.

comment:14 Changed 3 years ago by dimpase

  • Reviewers set to Dima Pasechnik

let me check that you don't break using FC=flang

comment:15 Changed 3 years ago by embray

Hahah ; should that work at all in the first place? When you say "using FC=flang" do you mean just export FC=flang to the environment?

To be clear, I don't think this changes anything in what happens when you run ./configure. It does mainly two things:

  • Refactors the spkg-build/spkg-install for the gfortran package so that it does not duplicate much effort from the gcc SPKG.
  • Adds the Debian-inspired patch for gcc so that it doesn't install libraries to ${prefix}/lib64 on Linux

comment:16 Changed 3 years ago by Konrad127123

  • Cc Konrad127123 added

comment:17 Changed 3 years ago by dimpase

Lgtm

comment:18 Changed 3 years ago by dimpase

  • Status changed from needs_review to positive_review

comment:19 Changed 3 years ago by vbraun

  • Branch changed from u/embray/build/destdir-gcc to a1d8ce92b02596d9291e0a58f2376b53c628acdc
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.