From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by sourceware.org (Postfix) with ESMTPS id B87413858CDB for ; Wed, 18 Oct 2023 16:04:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B87413858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B87413858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697645098; cv=none; b=FRG8WCH+H7J9Q8r8EUTQuK1FJ3XnuGlCOn9wdr+sF3Zlt+GrbJnMXtlJV4Lfiz8rdah+tAguKtlCVdDMa6A93sySY8r29GpppxyWPCkVuMeUhzwfRPvwGwGCpMOXLAZGZNQYbRhM1l6L8/o2Mr+AQBBbJA4QY5VosJjzBu/GfMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697645098; c=relaxed/simple; bh=Qzy3tgFLWKKEDUYCGTxlY7y3JYANSU+ozvr67MfE01o=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=ml+ojNReh9NISq4y+NPxEA3Np/olIU8DkUYvJe5anL2bYW2IFyyfheNMIL60F5pEr4JMz+TnhsNrIMiVvXcaFoTsnSqhXKKSDVsDtfP3bhD9SUqT4RW+vHTDv+9ifjfvPx6W8QwSgVmE7zUqzI3mxPJTMX+iN7BfB6AZ2zh+Rwo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1ea48ef2cbfso2171104fac.2 for ; Wed, 18 Oct 2023 09:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697645096; x=1698249896; darn=gcc.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Qzy3tgFLWKKEDUYCGTxlY7y3JYANSU+ozvr67MfE01o=; b=Yok7hxUEdbeokLMoClqDlMFbizstK5nz7d/1SGbq9gok3eXozWhS6neAMUU26dUwAy ZYQs13ajAXKJ3f4LljCNX6akTjhA/U9YKRIKxVMm5sA7p8uCf57//uXZkyJpmu6V517n /ouuQnRbKRjSIF54OQ2ZoV2NBxJOSVOYGmBgIVuS57FnV8Z75O7RXa0mA8xu2PUkNU4x VEaHsZyVXbFTJs0157W54Sk7961PNXnwoKztuJd4k6RnfPcgzqF/aFAq24s7sc+r5YhL TlPd8s5RTA7ex0rwQ8WtErzGnXjE77Bw4bSnaeKbdBl/R8F8vxFmyv+uEAaWGEkQf9Ty RxlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697645096; x=1698249896; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Qzy3tgFLWKKEDUYCGTxlY7y3JYANSU+ozvr67MfE01o=; b=nriSYne2oryf+tJIRwNhAzOtZAQE3QdPHgdM2H8NTmTeebPQEdaayltw7vhSSyKKbf A8LGZcyrsBkn8NUK9J7g1bU0bMuXX6lTC30eQZbB9IPtZ7f+hv8/mkXW1lEiQqj80rS5 /s6FIzPrY07GDExoakT6UWbtyWwOFaBnu+im+vdVvhe57vwJVbpVZsPc8An+5cZx/QNX CBjs4SzPVgZDZoFNcuwBfv2dH+NLSqYiZtXGMxW/j+YCCg2gt9qsoPYJVzkNwM/JD6Cr TsMsLl7GDMyiWqvLbH+VdjVK7LDzUmbGa4HuPrwysin16etC9B+Y1bD25M8PPhu7cD3s e23A== X-Gm-Message-State: AOJu0YyRqxh3n2PGGjwvQrBwWiYYYf8t6UHF7IkznZ6Xer4feEf7cxKb cmCiar55+hYC9GjGKBfOplYEq4hC8mu8YE0Koq6NRqb1Ux4= X-Google-Smtp-Source: AGHT+IGu0Fyg5lrX3lrtJby5kc4AmDlovMqa2L7yNnEnQVzk2nmM5hzuCSHZZGylG9Wt8sB1kBUf5SPKq3ecIp/vIW8= X-Received: by 2002:a05:6870:9a99:b0:1e9:907b:1642 with SMTP id hp25-20020a0568709a9900b001e9907b1642mr6612573oab.16.1697645095661; Wed, 18 Oct 2023 09:04:55 -0700 (PDT) MIME-Version: 1.0 From: Kai Song Date: Wed, 18 Oct 2023 18:04:46 +0200 Message-ID: Subject: Compilation of lengthy C++ Files To: gcc-help@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000e1b2bd0607ffcc32" X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000e1b2bd0607ffcc32 Content-Type: text/plain; charset="UTF-8" Dear GCC Developers, I am unsuccessfully using g++ 12.0.4 to compile lengthy c++ codes. Those codes are automatically generated from my own code-generator tools that depend on parameters p. Typical applications are: - Taylor series of order p inserted into consistency conditions of numerical schemes, to determine optimal method parameters (think of, e.g., Runge-Kutta methods) - recursive automatic code transformation (think of adjoints of adjoints of adjoints...) of recursion level p - Hilbert curves or other space-filling curves to generate code that simulates cache utilization in a Monte-Carlo context I verify that for small p the codes compile and execute to the expected result. However, there is always a threshold for p so that the generated cpp file is so long that the compiler will just terminate after ~10min without monitor output but return the value +1. My cpp files range from 600k LOC up to 1Bio LOC. Often, the file comprises of one single c++ template class member function definition that relies on a few thousand lines of template-classes. I would like to know: 1) Am I doing something wrong in that GCC should be able to compile lengthy codes? 2) Is it known that GCC is unable to compile lengthy codes? 3) Is it acknowledged that a compiler's ability to compile large files is relevant? 4) Are possible roots known for this inability and are these deliberate? To give just one glimpse at the relevance: I analyzed methods for solving F(x)=0 by using k stages -DF(x)*vk= F(x+sum_i bki*vi). Compiling a Taylor series code with p=3, I was able to verify that three iterations of the Chord method converge of fourth order, thus surpassing Newton's method (same cost, but only quadratic order). Checking whether any four-stage method exists that converges of fifth order necessitates the compilation of a single cpp file function that is 1.2Mio lines of code long. Since 2018 I am occasionally trying to find a way to compile it. I also used this code to automatically generate Butcher-type tableaus for generalizations to initial-value problem solvers. One could really only dream of what scientific leaps become possible only if lengthy codes were compilable. Right now, whenever a situation of this kind occurs, I have to give up, cut my (possibly months of work) losses, and move on to working on something else -- because it seems there is nothing I can do about it. Even spitting a code of 1Bio LOC into chunks of 100k LOC and then automating to compile and link these in turn seems hopeless; and probably the linker has limitations as well.. But since this problem is to frequent to my life, I would really like to find out how to fix it once and for all. This is a problem that I have been suffering from severely for years because it basically cripples how I can put my mathematical expertise to use. Thank you for getting in touch. Kind regards, Kai --000000000000e1b2bd0607ffcc32--