You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
or you can download a [zip file](https://github.com/python/cpython/archive/master.zip).
10
+
11
+
## Compiling
12
+
13
+
### Windows
14
+
PCbuild\build.bat -e -d
15
+
16
+
### macOS and Linux
17
+
Generate the Makefile with
18
+
19
+
./configure
20
+
21
+
Then we can build Python.
22
+
23
+
make
24
+
25
+
#### Compiling with ccache (optional)
26
+
27
+
If we're compiling on macOS or Linux, we can speed things up with ccache. Compiling with ccache lets us only compile files that have changed so that we don't have to recompile the entire project because one file changed.
28
+
29
+
##### Ubuntu
30
+
sudo apt-get install ccache
31
+
32
+
##### Arch Linux
33
+
pacman -S ccache
34
+
35
+
##### macOS (requires Homebrew)
36
+
37
+
brew install ccache
38
+
39
+
To use ccache when we compile Python, we just have to make two changes to the Makefile.
40
+
We need to replace the following lines
41
+
42
+
CC= gcc -pthread
43
+
CXX= g++ -pthread
44
+
45
+
with the following.
46
+
47
+
CC= ccache gcc -pthread
48
+
CXX= ccache g++ -pthread
49
+
50
+
Now everytime running `make` after the first, the compilation will be much quicker.
51
+
52
+
## Our first change
53
+
In Python, we have to `import` modules before we can use them,
54
+
55
+
but we've decided we don't like the word `import` and want to `require` modules instead.
0 commit comments