-
Notifications
You must be signed in to change notification settings - Fork 14
Building Ironclad 3.4 on Linux
Ironclad 3.4 only builds as a 64-bit package. 32-bit builds are not supported.
File debian.Dockerfile
in directory misc
contains Docker instructions to create a Docker image suitable to run a Linux Docker container with all tools necessary for the build of the main branch of Ironclad.
If using Docker Desktop on Windows, before creating the image, make sure that Docker Desktop is set to use Linux containers: after starting Docker Desktop, right-click on the Docker whale icon in the status area of the Windows taskbar and make sure the popup menu entry reads Switch to Windows containers…. Otherwise, if it is Switch to Linux containers…, select that option.
To build the container image and then run the container, change the current directory to the project root directory and, using PowerShell or Bash:
docker build -f misc/debian.Dockerfile -t ironclad-build-debian:v3.4 -m 2GB .
docker run -it -v ${PWD}:/usr/src/ironclad --name ironclad-build-debian-v3.4 ironclad-build-debian:v3.4
Subsequent re-runs of the created container can be done with:
docker start -ai ironclad-build-debian-v3.4
For building outside of a Docker container, install the following prerequisites:
-
.NET 6.0 SDK. Make sure that
~/.dotnet/tools
is added to env variablePATH
. -
Required deb packages. See
misc/debian.Dockerfile
forapt-get install
commands and install the listed packages (some may be already present, that’s OK) -
Clang toolset. Ironclad is being compiled using Clang-16, but any newer version should be OK too.
apt-get install clang-16
Official distro repos are usually behind with Clang releases so it’s best to install Clang and lld directly from the LLVM project site if they support your distro. Download file https://apt.llvm.org/llvm.sh and execute it as root with a single argument being the version number of LLVM to install:
sudo bash llvm.sh 16
The installer installs all LLVM files in
/usr/lib/llvm-16
, so add/usr/lib/llvm-16/bin
to the PATH env variable. -
IronPython 3.4 console app:
dotnet tool install --global IronPython.Console --version 3.4.1
Despite the name of the flag
--global
, it installs for the current user only. -
CPython 3.4 64-bit. This one is a bit tricky as most (if not all) distros that are not end-of-live do not carry Python 3.4 anymore. There are two options:
-
Build Python 3.4 from sources:
-
download sources from https://www.python.org/ftp/python/3.4.4/Python-3.4.4.tgz
-
unpack this archive in
/usr/src
-
with the currect directory set to
Python-3.4.4
, run:-
./configure
-
make
-
make altinstall
(as root). Python 3.4 wil be installed in/usr/local/lib
and/usr/local/bin/python3.4
.
-
-
-
Install the Anaconda3 distribution. Version 2.3.0 comes with Python 3.4.3 in the root environment. Download file https://repo.anaconda.com/archive/Anaconda3-2.3.0-Linux-x86_64.sh and execute as root with option
-p /opt/anaconda3
. The installation prefix (-p /opt/anaconda3
) can be anywhere but this wiki assumes this location.
-
Note that Ironclad built for Anaconda3 can only be used with Anaconda packages, and when built for CPython "Core", it can only be used with regular packages (installed using pip
or built from sources).
Clone Ironclad using Git:
cd
git clone https://github.com/IronLanguages/ironclad.git
sudo mv ironclad /usr/src
cd /usr/src/ironclad
Ironclad’s build process is configured by main.scons
in the project root directory. Go to the section marked PLATFORM-SPECIFIC GLOBALS,
and change anything that looks wrong for your system. The values provided in current main.scons
are known to work with the Docker container created with misc/debian.Dockerfile
.
Having done the above, running scons
in the project root directory (/usr/src/ironclad
in the Docker container), in your favourite shell, should build everything required by Ironclad. By default, it will build a release configuration targeting the .NET 6.0 (the only one framework supported currently). To build for other configurations, use SCons build parameters (variables) on the scons
command line, like scons configuration=debug
. To avoid typing it on the command line, set shell environment variable SCONSFLAGS
to a string containing all scons
parameters to be automatically added to the command line; they can still be overriden on commandline.
The final build output is placed in directory 'out/«configuration»/«framework»'. Intermediate build artifacts are placed in 'build/«configuration»/«framework»'. Run scons -h
for info about supported build parameters and options, their accepted values, and where the final build artifacts are placed. Note that build parameters on the command line are placed without leading dashes and with an equal sign.
Run scons --clean
or scons -c
. Again, by default it will only clean the release configuration. To clean other builds, run scons -c
with the same build parameters as used to create those builds.
Sometimes, after some tests have been run, running scons -c
may complains that it cannot remove some test files because they are "in use". In such case run scons -c
the second time.
It is also possible to purge all artifacts created by any build run, by deleting the whole trees build
and out
in the project root directory.
Run scons test
with the relevant build parameters on command line. This will execute the whole test suite for the selected configuration/framework. E.g. to run all tests for all builds:
scons test configuration=all
To run a specific test, first set IRONPYTHONPATH
to the lib-dynload
and site-packages
directories of CPython 3.4. E.g. in Bash, assuming the Anaconda3 installation of CPython (like the one in the Docker container):
export IRONPYTHONPATH="/opt/anaconda3/lib/python3.4/lib-dynload:/opt/anaconda3/lib/python3.4/site-packages"
Then run the test with:
ipy runtests.py tests.«testtfile».«testcase» «configuration»/net6.0
If .«testcase»
is omitted, all tests in module «testtfile»
are run.