From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10olkn2056.outbound.protection.outlook.com [40.92.40.56]) by sourceware.org (Postfix) with ESMTPS id 2D7323857C49; Mon, 13 Jun 2022 17:12:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D7323857C49 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l3af1omY//Gbc1/ohdmRoj129tXRtCGiC1emy4JlUwjcJhGk3+ThW0CjqXwMGDRFA5iblgOysBro2BIv/uFhAzQepF3XajzahCugw9Q3+4dQTXw/J3GiodJfO0IppJjti6iBL5guzaFWwyrh2/NN2Pc4Xpbe6rXko8fLnPcdR2VU/sAQQGqrlrZq9VomJahyCniq4SP0n+tYtZcmo7sGrLBZXA5f/f5+Dm+TNGLRH7/NRevBFfewJpQEgdbWidpwRmyI56k6Il91c5GdYy0bVY41ZI0Aibefm9M6VEI3aQUl2Avad5W6KLXISmR46naXFrZaJKuJjpZ6FEUh6ynObg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0ZEOl2PyLMO/hYbMQxuO9rYGRuQDiNfRqdKKKYU9jxU=; b=fKn7wJiT95cTkyME+56Wc2A5L9WSrKY8z7dP51x+3mfQ69L9B1VA8nRbDPlyrnChNb7otjXd+lNv36Pumru7dREbO24ciNYlofsd2UKtJzO3vpRMLoOkNIIt4qaRlk8uWq6A7MH5p8QVC1fpu3UvPDmm1r8FgrgYiLomTRrTJuD5VA3qIAgTMuHzHr3iZ+ZfOSv1AEletOwOi/Rp+xprrK8gkgVUj22n6Fo3xx/wiGyCLj8pAv0onZ3Xum+YV9pcwX3ceEbRuRRfEN+W7x1OVFqmJ+zs/Z2d7hXTD2ctlXITk+cErn5u/5+B/o8z+/b2hVnybGfAfIWCoB/kJShVuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from BY5PR14MB3911.namprd14.prod.outlook.com (2603:10b6:a03:1d7::12) by CO6PR14MB4227.namprd14.prod.outlook.com (2603:10b6:5:340::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Mon, 13 Jun 2022 17:12:15 +0000 Received: from BY5PR14MB3911.namprd14.prod.outlook.com ([fe80::df3:fcae:17ad:2513]) by BY5PR14MB3911.namprd14.prod.outlook.com ([fe80::df3:fcae:17ad:2513%6]) with mapi id 15.20.5332.020; Mon, 13 Jun 2022 17:12:15 +0000 Message-ID: Subject: Re: GSoC Blog Post 0 - GCCprefab build system From: Wileam Yonatan Phan To: Jonathan Wakely Cc: "gcc@gcc.gnu.org" , "fortran@gcc.gnu.org List" Date: Mon, 13 Jun 2022 13:12:10 -0400 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 Content-Transfer-Encoding: 7bit X-TMN: [FG+iSni3p3i6LS2ZL05MmXM7CiLysPDj] X-ClientProxiedBy: BN6PR13CA0030.namprd13.prod.outlook.com (2603:10b6:404:13e::16) To BY5PR14MB3911.namprd14.prod.outlook.com (2603:10b6:a03:1d7::12) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d537d72d-fa9e-4675-5bf6-08da4d5fdd09 X-MS-TrafficTypeDiagnostic: CO6PR14MB4227:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eYQXavf4aTE8tGI6ARsaILJYqhgejx17g42H7B6f3K/LngHj4haob0opnWZivo8hrufVNXW4i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YmM3UURONVFXSEJxSURHNE44RFhTczR2S21SNDNxMnB2VndKODJ2?= =?utf-8?B?YjkzRCtzemcwUEUzQmsxaWdydXZJVUNFR2dxYXluS1ZLSlZLQWJtS3V2d2ZU?= =?utf-8?B?NnZtYzBFeUE3d3hDWVRWVm1BRG9EcGdPS3Z4M08vblpaSW42Ny84Um5CZ1lQ?= =?utf-8?B?VEVUMzBlaEpsaDFBMGlSWE8xL1FZUTd5RndOczJkcG5HemRZRHR3WHVDem1V?= =?utf-8?B?VEkvbmtRRzJvZWErb2NFMGFwNDlYT1VONXdEazVIZERVNEozNWFLa1FMdml3?= =?utf-8?B?NlNoTDFXN2F0YzVuR2xleWpWYmZtb2FXYnhqalp3OFNvQ3pNeHZ2eEZnOVly?= =?utf-8?B?c2szZHMwTWZYeG5SSHRSRVRTOTRGQzV3eXpDNVFEd0J5MXZvTW9zT0lmZVNJ?= =?utf-8?B?ZWMrWDBEWXlrZFJBMm1UeXlXQmtmZk43dFg2TlJlUU1vQUxEeXZVdlJTVGFU?= =?utf-8?B?QUprM0g3VlhMUjdXM0tHaG1NMXVCZjVrNVV5TldzYjYwam83VnBqSXIvYWRR?= =?utf-8?B?T1ZUTDk5bStGNUhGN3NMNkY5UzlHOGwvOUFmNmNhNXdjVzVHNHhiRnhXM3BD?= =?utf-8?B?WnJyMXU0MXJ4bkw5UzBVSGF0N1hTZFNsL25EZEJZNUdIRzBhbVpNRytKUmp5?= =?utf-8?B?YmlwdWc5dXZQZ0NwUERzL3RzZ01vbG1XL1BoYjBiN1Z2OWJGajlNZG5UUlZ0?= =?utf-8?Q?LNoFgWDQSJQ=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d537d72d-fa9e-4675-5bf6-08da4d5fdd09 X-MS-Exchange-CrossTenant-AuthSource: BY5PR14MB3911.namprd14.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2022 17:12:15.9155 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR14MB4227 X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2022 17:12:19 -0000 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. >