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
[ML] Upgrade to gcc 10.3 for Linux compilation (#2028)
gcc 10.3 contains the fix for the bug that hinders
compilation of PyTorch on aarch64.
The binutils package used for compiling the final
distribution is also upgraded, from version 2.34 to
version 2.37, and the version used for bootstrapping
the cross compiler from version 2.25 to version 2.27.
patchelf is upgraded from version 0.10 to version
0.13.
# Only required if building the C++ code directly using make - adjust depending on the location of your Git clone
22
22
export CPP_SRC_HOME=$HOME/ml-cpp
23
23
```
@@ -53,22 +53,22 @@ These environment variables only need to be set when building tools on Linux. Th
53
53
54
54
We have to build on old Linux versions to enable our software to run on the older versions of Linux that users have. However, this means the default compiler on our Linux build servers is also very old. To enable use of more modern C++ features, we use the default compiler to build a newer version of gcc and then use that to build all our other dependencies.
55
55
56
-
Download `gcc-9.3.0.tar.gz` from <http://ftpmirror.gnu.org/gcc/gcc-9.3.0/gcc-9.3.0.tar.gz>.
56
+
Download `gcc-10.3.0.tar.gz` from <http://ftpmirror.gnu.org/gcc/gcc-10.3.0/gcc-10.3.0.tar.gz>.
57
57
58
58
Unlike most automake-based tools, gcc must be built in a directory adjacent to the directory containing its source code, so build and install it like this:
59
59
60
60
```
61
-
tar zxvf gcc-9.3.0.tar.gz
62
-
cd gcc-9.3.0
61
+
tar zxvf gcc-10.3.0.tar.gz
62
+
cd gcc-10.3.0
63
63
contrib/download_prerequisites
64
64
sed -i -e 's/$(SHLIB_LDFLAGS)/-Wl,-z,relro -Wl,-z,now $(SHLIB_LDFLAGS)/' libgcc/config/t-slibgcc
to install the Boost headers and libraries. (Note the `env PATH="$PATH"` bit in the install command - this is because `sudo` usually resets `PATH` and that will cause Boost to rebuild everything again with the default compiler as part of the install!)
@@ -214,18 +214,18 @@ For aarch64 replace `-msse4.2 -mfpmath=sse` with `-march=armv8-a+crc+crypto`.
214
214
215
215
### patchelf
216
216
217
-
Obtain patchelf from <http://nixos.org/releases/patchelf/patchelf-0.10/> - the download file will be `patchelf-0.10.tar.bz2`.
217
+
Obtain patchelf from <https://github.com/NixOS/patchelf/releases/download/0.13/patchelf-0.13.tar.bz2>.
218
218
219
219
Extract it to a temporary directory using:
220
220
221
221
```
222
-
bzip2 -cd patchelf-0.10.tar.bz2 | tar xvf -
222
+
bzip2 -cd patchelf-0.13.tar.bz2 | tar xvf -
223
223
```
224
224
225
-
In the resulting `patchelf-0.10` directory, run the:
225
+
In the resulting `patchelf-0.13.20210805.a949ff2` directory, run the:
226
226
227
227
```
228
-
./configure --prefix=/usr/local/gcc93
228
+
./configure --prefix=/usr/local/gcc103
229
229
```
230
230
231
231
script. This should build an appropriate Makefile. Assuming it does, run:
@@ -256,46 +256,47 @@ PyTorch currently requires Python 3.6, 3.7 or 3.8, and version 3.7 appears to ca
PyTorch requires that certain Python modules are installed. Install these modules with `pip` using the same Python version you will build PyTorch with. If you followed the instructions above and built Python from source use `python3.7`:
0 commit comments