public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Wileam Yonatan Phan <wileamyp@outlook.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
	"fortran@gcc.gnu.org List" <fortran@gcc.gnu.org>
Subject: Re: GSoC Blog Post 0 - GCCprefab build system
Date: Mon, 13 Jun 2022 13:12:10 -0400	[thread overview]
Message-ID: <BY5PR14MB3911B04CD26ECA2A546EBCC8CEAB9@BY5PR14MB3911.namprd14.prod.outlook.com> (raw)
In-Reply-To: <CAH6eHdQ7tif+5-SaME5JC4ftaT5mLcMxvatj-_Bzoi91CZuXqg@mail.gmail.com>

Hi Jonathan,

Your build script is really impressive! I'm definitely not at that level yet
when it comes to Bash shell scripting. I'll start deciphering it and improve my
script accordingly.

By "relatively easy", I refer to the end-user of the script being able to
customize the build as s/he sees fit through the config file, and simply
running

$ ./build.sh config.cfg

substituting `config.cfg` with said build config file. So, one single line of
shell command instead of nine lines.

I also pepper my code with plenty of comments and strategically-placed
linebreaks for readability, which adds to the script length.

To be fair, most of the ~300 lines of the script belongs to the config file
interpreter function readcfg() because it uses if..elif..fi blocks instead of
case..esac blocks, and the bulk of the function is mostly for adding configure
flags, languages to compile, etc. (I plan to extend the script even further
once I start building GCC with GPU offloading support.)

Actually, the very first version of the script takes in a version string (like
your script) instead of a config file. You can access it here as a GitHub gist:
<
https://gist.github.com/wyphan/e2672336b80253a813abb795a5db567c/86eee347a8d26881a91356d9007790c5cff6654f
>
I later realized that relying on just the version string is insufficient for my
needs, specifically for adding configure flags like `--disable-bootstrap`,
which is hard-coded in that early version of the script.

Yes, you are correct that the script currently uses the tip of the
`releases/gcc-[version]` branches. Is that not the same as using the published
tarballs on the FTP server? I _do_ notice that these branches only get pushed
whenever a minor version or a patchlevel is released.

Thanks,
Wil

On Mon, 2022-06-13 at 16:26 +0100, Jonathan Wakely wrote:
> On Mon, 13 Jun 2022 at 14:34, Wileam Yonatan Phan wrote:
> > Hi Jonathan,
> > 
> > Thanks for the feedback. Regarding the linked page <
> > https://gcc.gnu.org/wiki/InstallingGCC
> > >
> > if you're referring to the part that tells you to use your distro's package
> > manager, yes that's indeed the simplest way to install GCC, but from pre-
> > built
> > binaries, not building directly from sources. But if you're referring to
> > the
> > example at the bottom of the page,
> 
> Yes, that's what I mean.
> 
> > this script does exactly that, but the build
> > process is automated based on the build configuration file.
> 
> Yes, it does that, but takes 400 lines of shell script to do so.
> 
> If you want "relatively easy ways to build GCC painlessly" then you
> can do it with nine lines of shell commands.
> 
> Or in about 80, for any non-prehistoric version, with no config file
> needed (just a single option to the script, the release number or
> snapshot name to build):
> https://gist.github.com/jwakely/95b3a790157f55d75e18f577e12b50d7#file-build_gcc_versions-sh
> 
> 
> My point is just that there are already easier ways to do it, not only
> by using spack or the OpenCoarrays build script.
> 
> N.B. your 
> https://github.com/wyphan/gccprefab/blob/main/gcc12.cfg
> 
> config file says "Latest GCC 12 Release" but actually builds from the
> tip of the branch, not a release.
> 


  reply	other threads:[~2022-06-13 17:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13  1:50 Wileam Yonatan Phan
2022-06-13 11:59 ` Jonathan Wakely
2022-06-13 13:34   ` Wileam Yonatan Phan
2022-06-13 15:26     ` Jonathan Wakely
2022-06-13 17:12       ` Wileam Yonatan Phan [this message]
2022-06-13 17:38         ` Jonathan Wakely
2022-06-14  0:37       ` Damian Rouson
2022-06-14  8:53         ` Jonathan Wakely
2022-06-14 11:16           ` Damian Rouson
2022-06-14 13:52             ` Wileam Yonatan Phan
2022-06-17 18:45       ` Bernhard Reutner-Fischer
2022-06-17 19:55         ` Jakub Jelinek
2022-06-18 19:24           ` Bernhard Reutner-Fischer
2022-06-17 20:07         ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BY5PR14MB3911B04CD26ECA2A546EBCC8CEAB9@BY5PR14MB3911.namprd14.prod.outlook.com \
    --to=wileamyp@outlook.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).