1
0
Fork 0
cl-sites/ecl.common-lisp.dev/static/manual/Building-ECL.html

369 lines
13 KiB
HTML
Raw Normal View History

2024-12-24 19:15:49 +01:00
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.0.3, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Building ECL (ECL Manual)</title>
<meta name="description" content="Building ECL (ECL Manual)">
<meta name="keywords" content="Building ECL (ECL Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Indexes.html" rel="index" title="Indexes">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="User_0027s-guide.html" rel="up" title="User's guide">
<link href="Invoking-ECL.html" rel="next" title="Invoking ECL">
<style type="text/css">
<!--
/* colors */
div.example {margin-left: 3.2em}
span.r {font-family: initial; font-weight: normal; font-style: normal}
@media (prefers-color-scheme: dark) {
/* dark theme */
html { color: seashell;
background: #1A1A1A; }
body { background: #1A1A1A; }
th { border-bottom: 2px solid lightgray; }
h1, h2, h3, h4, h5 { background-image: linear-gradient(to left, #202020, #3A3A3A); }
code, var, code a { color: darkorange;
background: #2A2A2A; }
a { color: seashell; }
pre { background: #2A2A2A;
color: seashell;
/* mark longer code block with stripe on the left */
border-left: 5px solid darkorange;
padding-left: 10px; }
pre.screen { background: #2A2A2A;
border: 1px solid lightgray; }
pre.programlisting { background: #2A2A2A;
border-left: 1px solid lightgray;
border-top: 1px solid lightgray; }
/* we need a light background in order for the images to be readable */
img { background: white }
}
@media (prefers-color-scheme: light) {
/* light theme */
html { background: white }
body { background: white }
th { border-bottom: 2px solid gray; }
h1, h2, h3, h4, h5 { background: lightgray; }
code, var, code a { color: darkred;
background: whitesmoke; }
a { color: #000; }
pre { background: whitesmoke;
color: black;
/* mark longer code block with stripe on the left */
border-left: 5px solid darkred;
padding-left: 10px; }
pre.screen { background: #EEE;
border: 1px solid black; }
pre.programlisting { background: #EEEEEE;
border-left: 1px solid black;
border-top: 1px solid black; }
}
body {
margin: 1em 125px 0 10%;
line-height: 1.5em;
padding: 0 2em 1em 2em;
font: 13px Verdana,Arial, sans-serif
}
ul, dd, dl, dt { margin-top: 0; margin-bottom: 0; }
p, code, td, dl, dt {
line-height: 1.5em;
}
table {
font: inherit;
border-collapse: collapse;
}
th, td {
vertical-align: top;
}
h1, h2, h3 { padding-left: 15px; }
h4, h5 { padding-left: 5px; }
code, pre {
font-size: 1em;
font-family: monospace;
}
var {
font-size: 1em;
}
/* links inside code appear the same as the code itself */
code a {
font-weight: normal;
text-decoration: none;
}
/* but get an underline when hovering */
code a:hover {
text-decoration: underline;
}
/* ordinary links appear in bold */
a { font-weight: bold; }
pre.verbatim {
margin: 0 0 0 0;
}
pre {
overflow: auto;
}
pre.screen {
font-weight: bold;
padding: 0.5em;
}
pre.programlisting {
padding: 0.5em;
}
div p { padding: 0 2em }
li p { padding: 0; margin: 0 }
hr { display: none; }
div.funcsynopsis p {
text-indent: -2em;
}
div.variablelist {
padding: 0 2em;
}
.type, .funcsynopsis, .symbol {
font-family: monospace;
}
.type, .symbol, .replaceable {
white-space: nowrap;
}
-->
</style>
</head>
<body lang="en">
<div class="section-level-extent" id="Building-ECL">
<div class="nav-panel">
<p>
Next: <a href="Invoking-ECL.html" accesskey="n" rel="next">Entering and leaving <b class="b"><span class="r">Embeddable Common Lisp</span></b></a>, Up: <a href="User_0027s-guide.html" accesskey="u" rel="up">User&rsquo;s guide</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="Building-ECL-1">1.1 Building ECL</h3>
<p>Due to its portable nature, ECL works on every (at least) 32-bit
architecture which provides a proper C99 compliant compiler.
</p>
<p>Operating systems on which ECL is reported to work: Linux, Darwin (Mac
OS X), Solaris, FreeBSD, NetBSD, OpenBSD, DragonFly BSD, Windows and
Android. On each of them ECL supports native threads.
</p>
<p>In the past Juanjo José García-Ripoll maintained a test farm which
performed ECL tests for each release on number of platforms and
architectures. Due to lack of the resources we can&rsquo;t afford such doing,
however each release is tested by volunteers with an excellent package
<a class="uref" href="https://common-lisp.net/project/cl-test-grid">cl-test-grid</a> created
and maintained by Anton Vodonosov.
</p>
<ul class="mini-toc">
<li><a href="Building-ECL.html#Autoconf-based-configuration" accesskey="1">Autoconf based configuration</a></li>
<li><a href="Building-ECL.html#Platform-specific-instructions" accesskey="2">Platform specific instructions</a></li>
</ul>
<div class="subsection-level-extent" id="Autoconf-based-configuration">
<h4 class="subsection">1.1.1 Autoconf based configuration</h4>
<p>ECL, like many other FOSS programs, can be built and installed with a
GNU tool called Autoconf. This is a set of automatically generated
scripts that detect the features of your machine, such as the compiler
type, existing libraries, desired installation path, and configures ECL
accordingly. The following procedure describes how to build ECL using
this procedure and it applies to all platforms except for the Windows
ports using Microsoft Visual Studio compilers (however you may build ECL
with cygwin or mingw using the autoconf as described here).
</p>
<p>To build <b class="b"><span class="r">Embeddable Common Lisp</span></b> you need to
</p>
<ol class="enumerate">
<li> Extract the source code and enter it&rsquo;s directory
<div class="example">
<pre class="example-preformatted">$ tar -xf ecl-xx.x.x.tgz
$ cd ecl-xx.x.x
</pre></div>
</li><li> Run the configuration file, build the program and install it
<div class="example">
<pre class="example-preformatted">$ ./configure --prefix=/usr/local
$ make # -jX if you have X cores
$ make install
</pre></div>
</li><li> Make sure the program is installed and ready to run:
<div class="example">
<pre class="example-preformatted">$ /usr/local/bin/ecl
ECL (Embeddable Common-Lisp) 16.0.0
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
Copyright (C) 2015 Daniel Kochmanski
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.
Top level in: #&lt;process TOP-LEVEL&gt;.
&gt;
</pre></div>
</li></ol>
</div>
<div class="subsection-level-extent" id="Platform-specific-instructions">
<h4 class="subsection">1.1.2 Platform specific instructions</h4>
<ul class="mini-toc">
<li><a href="Building-ECL.html#MSVC-based-configuration" accesskey="1">MSVC based configuration</a></li>
<li><a href="Building-ECL.html#Android" accesskey="2">Android</a></li>
<li><a href="Building-ECL.html#iOS" accesskey="3">iOS</a></li>
</ul>
<div class="subsubsection-level-extent" id="MSVC-based-configuration">
<h4 class="subsubsection">1.1.2.1 MSVC based configuration</h4>
<p>You need Microsoft Visual Studio 2015 or better to compile ECL,
which flavor(Professional, Community, etc) does not matter.
</p>
<p>You also need <a class="uref" href="http://yasm.tortall.net">yasm</a> optionally to build gmp,
fetch yasm-1.3.0-win64.exe and yasm-1.3.0-win32.exe,
and put them in your system PATH directory.
</p>
<p>In the Visual Studio&rsquo;s startup menu, click
<a class="uref" href="https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs">Developer
Command Prompt for Visual Studio</a> to open the console
window. Alternatively, open the developer console from the start menu
through &quot;Visual Studio 20xx&quot; -&gt; &quot;Visual Studio Tools&quot; -&gt; &quot;VC&quot; and
select &quot;x64 Native Tools Command Prompt for VS 20xx&quot; or &quot;x86 Native
Tools Command Prompt for VS 20xx&quot;, depending on whether you want to
build 32 or 64bit versions of ECL.
</p>
<ol class="enumerate">
<li> Change to the msvc directory.
</li><li> Run nmake to build ECL.
</li><li> Run nmake install prefix=d:\Software\ECL where the prefix is the
directory where you want to install ECL.
</li><li> If you want to build debug version, add ECL_DEBUG=1 to nmake command line.
</li><li> If you want to build 64bit version, add ECL_WIN64=1 to nmake command line,
you can also set GMP_TYPE=AMD64 to use specific assembly codes.
</li><li> Optionally, if you want to build a self-installing executable, you can
install NSIS and run nmake windows-nsi.
</li></ol>
</div>
<div class="subsubsection-level-extent" id="Android">
<h4 class="subsubsection">1.1.2.2 Android</h4>
<p>Cross compiling ECL for Android requires first building the host ECL
program. At present this host ECL needs to have the same word size and
same optional capabilities (e.g. threads, C99 complex floats) as
the target system. Therefore, to build the host ECL for a 32 bit ARM
system, use the following commands:
</p>
<div class="example">
<pre class="example-preformatted"># C99 complex numbers are not fully supported on Android
./configure ABI=32 CFLAGS=&quot;-m32 -g -O2&quot; LDFLAGS=&quot;-m32 -g -O2&quot;\
--prefix=`pwd`/ecl-android-host \
--disable-c99complex
make -j9
make install
rm -r build
export ECL_TO_RUN=`pwd`/ecl-android-host/bin/ecl
</pre></div>
<p>The next step is to configure the cross compilation toolchain. This
requires the Android NDK version 15 or higher.
</p>
<div class="example">
<pre class="verbatim">export NDK_PATH=/opt/android-ndk
export ANDROID_API=23
export TOOLCHAIN_PATH=`pwd`/android-toolchain
${NDK_PATH}/build/tools/make_standalone_toolchain.py --arch arm --install-dir ${TOOLCHAIN_PATH} --api ${ANDROID_API}
export SYSROOT=${TOOLCHAIN_PATH}/sysroot
export PATH=${TOOLCHAIN_PATH}/bin:$PATH
</pre></div>
<p>Here, <code class="code">ANDROID_API</code> is the minimum Android API version ECL will
run on. Finally, we can build and install the target ECL:
</p>
<div class="example">
<pre class="verbatim"># boehm GC is not compatible with ld.gold linker, force use of ld.bfd
export LDFLAGS=&quot;--sysroot=${SYSROOT} -D__ANDROID_API__=${ANDROID_API} -fuse-ld=bfd&quot;
export CPPFLAGS=&quot;--sysroot=${SYSROOT} -D__ANDROID_API__=${ANDROID_API} -isystem ${SYSROOT}/usr/include/arm-linux-androideabi&quot;
export CC=arm-linux-androideabi-clang
./configure --host=arm-linux-androideabi \
--prefix=`pwd`/ecl-android \
--disable-c99complex \
--with-cross-config=`pwd`/src/util/android-arm.cross_config
make -j9
make install
</pre></div>
<p>Library and assets are installed in the &quot;ecl-android&quot; directory
and are ready to run on the Android system.
</p>
</div>
<div class="subsubsection-level-extent" id="iOS">
<h4 class="subsubsection">1.1.2.3 iOS</h4>
<p>The cross-compilation steps for iOS are similar to those for Android.
</p>
<p>Build the host ECL:
</p><div class="example">
<pre class="verbatim">./configure --prefix=`pwd`/ecl-iOS-host --disable-c99complex
make -j9
make install
rm -r build
export ECL_TO_RUN=`pwd`/ecl-iOS-host/bin/ecl
</pre></div>
<p>Configure the toolchain:
</p><div class="example">
<pre class="verbatim">export IOS_VERSION_MIN=&quot;8.0&quot;
export IOS_SDK_DIR=&quot;`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/&quot;
export CC=&quot;clang&quot;
export CXX=&quot;clang++&quot;
export CFLAGS=&quot;-arch arm64 -miphoneos-version-min=${IOS_VERSION_MIN} -isysroot ${IOS_SDK_DIR}&quot;
export CFLAGS=&quot;$CFLAGS -pipe -Wno-trigraphs -Wreturn-type -Wunused-variable&quot;
export CFLAGS=&quot;$CFLAGS -fpascal-strings -fasm-blocks -fmessage-length=0 -fvisibility=hidden&quot;
export CFLAGS=&quot;$CFLAGS -O2 -DNO_ASM&quot;
export LD=&quot;ld&quot;
export LDFLAGS=&quot;-arch arm64 -pipe -std=c99 -gdwarf-2 -isysroot ${IOS_SDK_DIR}&quot;
export LIBS=&quot;-framework Foundation&quot;
</pre></div>
<p>Build and install the target library:
</p><div class="example">
<pre class="verbatim">export CFLAGS=&quot;$CFLAGS -DGC_DISABLE_INCREMENTAL -DECL_RWLOCK&quot;
export CXXFLAGS=&quot;$CFLAGS&quot;
./configure --host=aarch64-apple-darwin \
--prefix=`pwd`/ecl-iOS \
--disable-c99complex \
--disable-shared \
--with-cross-config=`pwd`/src/util/iOS-arm64.cross_config
make -j9
make install
</pre></div>
<p>Library and assets in the &quot;ecl-iOS&quot; directory are ready to run on the iOS system.
</p></div>
</div>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Invoking-ECL.html" accesskey="n" rel="next">Entering and leaving <b class="b"><span class="r">Embeddable Common Lisp</span></b></a>, Up: <a href="User_0027s-guide.html" accesskey="u" rel="up">User&rsquo;s guide</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>