From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70246: 30.0.50; Update INSTALL for native compilation Date: Sun, 07 Apr 2024 21:14:08 +0200 Message-ID: <87frvxouin.fsf@gmx.net> References: <87plv29pro.fsf@gmx.net> <86il0t1z96.fsf@gnu.org> <87r0fhpf52.fsf@gmx.net> <86v84tz0ma.fsf@gnu.org> Reply-To: Stephen Berman Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19577"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 70246@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 07 21:15:09 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rtXyu-0004sC-UC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Apr 2024 21:15:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtXyi-0005h8-BT; Sun, 07 Apr 2024 15:14:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtXyh-0005gu-HN for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2024 15:14:55 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rtXyh-0008Lj-8L for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2024 15:14:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rtXyo-0002DI-5Z for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2024 15:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Apr 2024 19:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70246 X-GNU-PR-Package: emacs Original-Received: via spool by 70246-submit@debbugs.gnu.org id=B70246.17125172648278 (code B ref 70246); Sun, 07 Apr 2024 19:15:02 +0000 Original-Received: (at 70246) by debbugs.gnu.org; 7 Apr 2024 19:14:24 +0000 Original-Received: from localhost ([127.0.0.1]:44664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtXyC-00029R-3R for submit@debbugs.gnu.org; Sun, 07 Apr 2024 15:14:24 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:54087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtXy9-00029C-LC for 70246@debbugs.gnu.org; Sun, 07 Apr 2024 15:14:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1712517248; x=1713122048; i=stephen.berman@gmx.net; bh=GJNmts8iN2Vb78RV3wdgub6pwSEPSanPG4qB1fMrM/Q=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=Vgfc+2yrNwaC1oprvzTCzUfiFsgrbJY2juEL2fjP7TklPrIXIOh1C7rlZ62/AQrG lsjhEG4fQEDuP4O2e42HTVQZYhZI2Dh5C7IcIGtc9fJxp2kVTrT/KLiiv58G+CD5J z5TC55gOMiZ1uhV0YWgnHG5E6PgoH3+zKGgaiw8di4bu46HMNwWu4OckVTO+LcGrx ZAJZ3YDg6n4+i6NzvqKm8FvFgY798ertmGPWE10y9ehP+s4EKq+WtLbGvbBa7GtqX ef4gyvlK8aIezHgHo5zNbsEeQm1IgWkCMpq1+gQ8zUnklPTsJZR3smIxvbXWisB2X 2xteY52BgOgQkIKX7A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs ([94.134.95.232]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MEm2D-1rzpdr1rh5-00GG93; Sun, 07 Apr 2024 21:14:08 +0200 In-Reply-To: <86v84tz0ma.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 07 Apr 2024 17:52:13 +0300") X-Provags-ID: V03:K1:swDbnKwFdXfQtRc/6dEzKVLOUuYwRIZfwzrtoUz5+bnFm9QJB9c wjvalxggee7jOhmrQqRAqLAqdj99AGH/ulCgo+4gBQJUH2rI3WvBIpc7rFBP7z84+DVETEa usEuS1b0XNgVCheJyundj3o4vm4KQYtQditH6dMSsyJ4+e34THs9I2IPRgRubxSUoeRKn0B 9hMh7E+u6bQwOdkrt7njw== UI-OutboundReport: notjunk:1;M01:P0:uVNeQULbtJo=;IjQZ306Pid1guKMWp/nlPGQQqJN PZ745UcTBiMz9R5hpudxLOebWiy4xqeJUmJ1ZBgxJSnK5eq1lQP+2mFD56ok4Q/JYSfBVd9XI 3s5p7Poa+zzQwjkTmw4mVaezqdT4KHzMplX68vxTVy8aZLhKNMvu7OYp5Tu44uCwdOUHa2MpH N3/dcVfZXJ4nc38YvcGlzfcorTrDQTKhnhfCcfNy99GmJYvd61DLYozfFvHSoTNjNJzVYc/28 OmRRZ6jQbABU8joLZCHSIegMhtIzD5dVIeUorYRpwrxbtwj7+3DM2GT+zgQMFqqJsEr1HLpgZ NxKnjCo8wT3Rymd7noPdTYAqe/n4A692fcAjTPRAt9gAR9z88SQzDjFDaa+w80mW+SylFTuKp TbYNX4MXMdEwywgruWMUPzNa+oik330U+rY/RJvNxK5LQ/T1SAZaeKFsOxOuU+pMOgkmZXrke MeHZsZZ9vmmcIW2dz5KmO6bLqzUjdjYuLznQMrOfZuHpr4XGnIK+/CoUVseK4w52LMlvnfJGb 9rZT6N7ISlZkXMaCDtEJaOMqeN69EHD7TpqbrO59W6PbTVCKp8aLBzIIgs69jZculsz8eo5Qi KFBBm5HG+bngHLN0U41dyNc5LeLT082IDqL7PY7yNigizmjEUCQaSR/MF3jS60mp9vvOnYVY4 985052LUV8pbvCKoPfkfJtWa/y/8Q6hJvoYMK9bUiHgZfhyToYexTT1W+FbG2GAkIar8jk957 jrQ1/35UK8TGtsJ+KgS2wKuJYNMGkoptwWZa74EiqqdvJDatXjSOROKvSXoi0TP2uILnEMRc X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282891 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 07 Apr 2024 17:52:13 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: 70246@debbugs.gnu.org >> Date: Sun, 07 Apr 2024 13:48:41 +0200 >> >> On Sun, 07 Apr 2024 09:08:05 +0300 Eli Zaretskii wrote: >> >> > Thanks. This LGTM, except the changes to item 6: there, I would only >> > mention the possibility of building out of the source tree. Whether >> > running uninstalled is possible in this case depends where is the >> > build tree relative to the source tree, so I'd rather not describe al= l >> > the gory details there because they are too complex to explain (what >> > you wrote is inaccurate); >> >> There was a mistake at the end of 6b; what I meant to write is "but the >> ../lib-src and ../native-lisp directories in the build directory >> (because the compiled files in these directories are >> machine-dependent)." If there were any other inaccuracies in what I >> wrote, can you please point them out to me (for my own edification)? > > See below. > >> > I'd just say that running uninstalled is >> > fully supported only when Emacs is built in the source tree. >> >> So instead of having 6{a,b,c} as in my patch, are the following >> additions to the current version (at the end of the first paragraph of >> 6) ok? >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> , ../native-lisp (if built with support for native compilation). >> >> If you build Emacs in a directory separate from the source directory >> ("out-of-tree"), run 'make' in the build directory. Then you can >> execute the 'src/emacs' file under that directory "in place". However, >> running Emacs uninstalled is fully supported only when it is built in >> the source tree. >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Yes, but see below. > >> But, again for my own edification, can you elaborate what "fully >> supported" means here? > > It means that (a) Emacs will find all the files it needs for running, > which includes programs and files in lib-src/, Lisp *.el/*.elc/*.eln > files, Info files, and files in the etc/ subdirectory in the tree from > which it is run; and (b) when any of the source files are edited and > Emacs is rebuilt, the next invocation will use the updated files, > including recompiling the *.eln files as needed. AFAIK all that happens with my uninstalled out-of-tree builds, but maybe there's some subtlety I'm not aware of. >> I've been running Emacs uninstalled from a build >> directory outside of the source tree for many years, and that statement >> suggests my builds are deficient (though perhaps only in unobvious ways >> that are not crucial for using Emacs), and if so, I'd like to know how >> and why. > > What Emacs does at startup to decide where its files are installed is > complex and hard to explain without describing the entire algorithm > (which is both inappropriate for INSTALL and subject to change without > notice). Yes, INSTALL is certainly not the place for such details. > If you are interested, look in emacs.c:init_cmdargs and > lread.c:load_path_default. Ok, thanks for the pointers. > The bottom line is that the Lisp and Info files will be taken from the > source tree, not from the build tree. So if you have more than one > build from the same source tree, then they all share the Lisp and Info > files. Therefore, if you modify anything in the source tree, you must > rebuild all the out-of-tree builds, otherwise those you don't rebuild > will be inconsistent with the modified sources. Yes, but if you instead make copies of the sources (or different repo branches) to build different configurations and make changes that you want to test in all configurations, then you have to make those changes in each copy or branch and rebuild them all, too. So there are trade-offs in both procedures. >> >> +'/usr/local/share/emacs/VERSION/native-lisp' holds the natively com= piled >> >> + pre-loaded Emacs Lisp files. >> > >> > This is incorrect: native-lisp is installed under /usr/lib/emacs/VERS= ION, >> > not under /usr/share/emacs/VERSION. >> >> I guess you meant /usr/local/lib/emacs/VERSION for the default location= ? > > Yes. > >> +By default, Emacs natively compiles only pre-loaded Lisp files during >> +the build process; other Lisp files are natively compiled >> +"just-in-time", i.e, when they are loaded in the running Emacs. If yo= u > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > "when they are first time loaded into the running Emacs". > >> 6) Run 'make' in the top directory of the Emacs distribution to finish >> -building Emacs in the standard way. The final executable file is >> -named 'src/emacs'. You can execute this file "in place" without >> -copying it, if you wish; then it automatically uses the sibling >> -directories ../lisp, ../lib-src, ../info. >> +building Emacs in the standard way. The final executable file is name= d >> +'src/emacs'. You can execute this file "in place" without copying it, >> +if you wish; then it automatically uses the sibling directories ../lis= p, >> +../lib-src, ../info, ../native-lisp (if built with support for native >> +compilation). >> + >> +If you build Emacs in a directory separate from the source directory >> +("out-of-tree"), run 'make' in the build directory. Then you can >> +execute the 'src/emacs' file under that directory "in place". However= , >> +running Emacs uninstalled is fully supported only when it is built in >> +the source tree. > > I think the last sentence should be better phrased as > > However, running Emacs uninstalled in this case will still use the > ../lisp and ../info subdirectories of the source tree, while using > the ../lib-src and ../native-lisp subdirectories from the build tree. > >> +'/usr/local/lib/emacs/VERSION/native-lisp' holds the natively compiled >> + pre-loaded Emacs Lisp files. > > The above also contains the other Lisp files if using the > "--with-native-compilation=3Daot" configure-time option. > >> +'~/.emacs.d/eln-cache/' holds the remaining natively compiled Lisp fil= es. > > Instead of "remaining" I'd say "just-in-time natively compiled Lisp > files". > > Thanks. Thanks again for the review and suggestions, which I've incorporated into the attached patch, and if you confirm it's good to go, I'll commit it to master. Steve Berman --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: INSTALL patch Content-Transfer-Encoding: quoted-printable diff --git a/INSTALL b/INSTALL index 2aaa02f37d7..32802d428d2 100644 =2D-- a/INSTALL +++ b/INSTALL @@ -264,6 +264,25 @@ to force GTK+ to run under Broadway, start Emacs like= this: The GNUstep build also supports the Wayland window system. If that is what you want, see nextstep/INSTALL. +* Native compilation of Lisp files + +In addition to byte-compiling files of Lisp code, Emacs can also produce +"native code", which usually runs several times faster than the +corresponding byte-compiled code. To build Emacs with this feature, +your system must have not only GCC (the C compiler) and Binutils (the +assembler and linker) but also the 'libgccjit' shared library, which is +part of the GCC distribution. If these components are available, +building Emacs will automatically produce natively compiled Lisp code. + +By default, Emacs natively compiles only pre-loaded Lisp files during +the build process; other Lisp files are natively compiled +"just-in-time", i.e., the first time they are loaded into the running +Emacs. If you want Emacs to natively compile all Lisp files during the +build ("ahead of time"), use the 'configure' option +'--with-native-compilation=3Daot'. If you do not want natively compiled +Lisp code even if your system satisfies the build requirements, use the +'configure' option '--with-native-compilation=3Dno'. + DETAILED BUILDING AND INSTALLATION: (This is for a Unix or Unix-like system. For GNUstep and macOS, @@ -553,10 +572,18 @@ need to create them if you have nothing to put in th= em. wish to add to various termcap entries. (This is unlikely to be necessar= y.) 6) Run 'make' in the top directory of the Emacs distribution to finish -building Emacs in the standard way. The final executable file is -named 'src/emacs'. You can execute this file "in place" without -copying it, if you wish; then it automatically uses the sibling -directories ../lisp, ../lib-src, ../info. +building Emacs in the standard way. The final executable file is named +'src/emacs'. You can execute this file "in place" without copying it, +if you wish; then it automatically uses the sibling directories ../lisp, +../lib-src, ../info, ../native-lisp (if built with support for native +compilation). + +If you build Emacs in a directory separate from the source directory +("out-of-tree"), run 'make' in the build directory. Then you can +execute the 'src/emacs' file under that directory "in place". However, +in this case the Emacs executable, while still using the ../lisp and +../info subdirectories of the source tree, will use the ../lib-src and +../native-lisp subdirectories from the build tree. Or you can "install" the executable and the other files into their installed locations, with 'make install'. By default, Emacs's files @@ -574,6 +601,11 @@ are installed in the following directories: at the same time; in particular, you don't have to make Emacs unavailable while installing a new version. +'/usr/local/lib/emacs/VERSION/native-lisp' holds the natively compiled + pre-loaded Emacs Lisp files. + +'~/.emacs.d/eln-cache/' holds the remaining natively compiled Lisp files. + '/usr/local/share/emacs/VERSION/etc' holds the Emacs tutorial, the DOC file, and other architecture-independent files Emacs might need while running. --=-=-=--