Skip to content

Commit b6ffbeb

Browse files
timholygiordano
andauthored
Add devdocs on 32-bit docker builds (#44300)
Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
1 parent 163c032 commit b6ffbeb

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

doc/src/devdocs/build/build.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Notes for various architectures:
139139

140140
* [ARM](https://github.com/JuliaLang/julia/blob/master/doc/src/devdocs/build/arm.md)
141141

142-
## Required Build Tools and External Libraries
142+
## [Required Build Tools and External Libraries](@id build-tools)
143143

144144
Building Julia requires that the following software be installed:
145145

@@ -282,3 +282,24 @@ LLVM_ASSERTIONS=1
282282
```
283283

284284
Please note that assert builds of Julia will be slower than regular (non-assert) builds.
285+
286+
## Building 32-bit Julia on a 64-bit machine
287+
288+
Occasionally, bugs specific to 32-bit architectures may arise, and when this happens it is useful to be able to debug the problem on your local machine. Since most modern 64-bit systems support running programs built for 32-bit ones, if you don't have to recompile Julia from source (e.g. you mainly need to inspect the behavior of a 32-bit Julia without having to touch the C code), you can likely use a 32-bit build of Julia for your system that you can obtain from the [official downloads page](https://julialang.org/downloads/).
289+
However, if you do need to recompile Julia from source one option is to use a Docker container of a 32-bit system. At least for now, building a 32-bit version of Julia is relatively straightforward using [ubuntu 32-bit docker images](https://hub.docker.com/r/i386/ubuntu). In brief, after setting up `docker` here are the required steps:
290+
291+
```sh
292+
$ docker pull i386/ubuntu
293+
$ docker run --platform i386 -i -t i386/ubuntu /bin/bash
294+
```
295+
296+
At this point you should be in a 32-bit machine console (note that `uname` reports the host architecture, so will still say 64-bit, but this will not affect the Julia build). You can add packages and compile code; when you `exit`, all the changes will be lost, so be sure to finish your analysis in a single session or set up a copy/pastable script you can use to set up your environment.
297+
298+
From this point, you should
299+
300+
```sh
301+
# apt update
302+
```
303+
(Note that `sudo` isn't installed, but neither is it necessary since you are running as `root`, so you can omit `sudo` from all commands.)
304+
305+
Then add all the [build dependencies](@ref build-tools), a console-based editor of your choice, `git`, and anything else you'll need (e.g., `gdb`, `rr`, etc). Pick a directory to work in and `git clone` Julia, check out the branch you wish to debug, and build Julia as usual.

0 commit comments

Comments
 (0)