]> git.eshelyaron.com Git - emacs.git/commitdiff
Update INSTALL for native compilation of Lisp files
authorStephen Berman <stephen.berman@gmx.net>
Mon, 8 Apr 2024 11:56:56 +0000 (13:56 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 10 Apr 2024 20:28:16 +0000 (22:28 +0200)
* INSTALL: Add section "Native compilation of Lisp files" under
ADDITIONAL DISTRIBUTION FILES and correspondingly augment item 6
of DETAILED BUILDING AND INSTALLATION.  In the latter also note
differences between in-source-tree and out-of-tree builds for
running 'src/emacs' uninstalled.

(cherry picked from commit b9b2bc7192e75e0208c064e44cb4afc418ec3d28)

INSTALL

diff --git a/INSTALL b/INSTALL
index 90ae622f34096bfe25dfbf3de9bd61193e8f3fcf..59a8063ba192e7aaf6bc7d585d04d2af4d7aae2f 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -273,6 +273,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=aot'.  If you do not want natively compiled
+Lisp code even if your system satisfies the build requirements, use the
+'configure' option '--with-native-compilation=no'.
+
 DETAILED BUILDING AND INSTALLATION:
 
 (This is for a Unix or Unix-like system.  For GNUstep and macOS,
@@ -568,10 +587,18 @@ need to create them if you have nothing to put in them.
 wish to add to various termcap entries.  (This is unlikely to be necessary.)
 
 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
@@ -589,6 +616,13 @@ 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.  If the build used the
+               'configure' option '--with-native-compilation=aot', then
+               this directory holds all natively compiled Lisp files.
+
+'~/.emacs.d/eln-cache/' holds the just-in-time 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.