@@ -74,19 +74,9 @@ cipd install fuchsia/sysroot/linux-amd64 latest -root ${SYSROOT_DIR}/linux-x64
74
74
## Set up the correct package versions
75
75
76
76
We need to make sure the git revision of llvm is one that works with the version
77
- of the Fuchsia tree. Note that Fuchsia frequently updates their llvm dependency,
78
- which should mean you could try working at HEAD for both, but the method here is
79
- safe.
77
+ of the Fuchsia tree.
80
78
81
- * Optionally, you can get Fuchsia to the version we used we wrote this guide:*
82
-
83
- ```
84
- cd ${FUCHSIA_SRCDIR}
85
- jiri update -gc ~/ml-compiler-opt/docs/demo/fuchsia.xml
86
- ```
87
-
88
- Either way - i.e. you can skip the step above to be at Fuchsia HEAD - to get the
89
- git hash at which we know this version of Fuchsia will build, do:
79
+ To get the git hash at which we know this version of Fuchsia will build, do:
90
80
91
81
```
92
82
cd ${FUCHSIA_SRCDIR}
@@ -108,20 +98,11 @@ This is this repository.
108
98
109
99
### Tensorflow dependencies
110
100
111
- See also [ the build bot script] ( ../../buildbot/buildbot_init.sh )
101
+ We need to install all of the Python dependencies for this repository, setup
102
+ some environment variables for the AOT compiler, and also build the TFLite
103
+ dependency to compile LLVM in MLGO development mode.
112
104
113
- ** NOTE:** The versioning of Tensorflow is pretty important in order to get a
114
- functioning build with the demo setup. Building with a Tensorflow pip
115
- package above v2.7.0 will cause the build to fail as well as building with
116
- a libtensorflow version above v1.15.x. Versions of the Tensorflow pip package
117
- under v2.8.0 don't have any available wheels for Python 3.10, so if you
118
- are on a more recent distro (eg Ubuntu 22.04) that has Python 3.10, you will
119
- run into version compatibility issues between the required Tensorflow version
120
- and the available Python version (pip will refuse to install Tensorflow) trying
121
- to install the required python packages from ` ml-compiler-opt/requirements.txt ` .
122
- To mitigate this, either use a distro with a compatible python version
123
- (eg Ubuntu 20.04), or your preferred flavor of python virtual environment
124
- to utilize a compatible Python version.
105
+ See also [ the build bot script] ( ../../buildbot/buildbot_init.sh )
125
106
126
107
``` shell
127
108
cd
@@ -133,18 +114,18 @@ TF_PIP=$(python3 -m pip show tensorflow | grep Location | cut -d ' ' -f 2)
133
114
134
115
export TENSORFLOW_AOT_PATH=" ${TF_PIP} /tensorflow"
135
116
136
- mkdir ~ /tensorflow
137
- export TENSORFLOW_C_LIB_PATH= ~ /tensorflow
138
- wget --quiet https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz
139
- tar xfz libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz -C " ${TENSORFLOW_C_LIB_PATH} "
117
+ export TFLITE_PATH= ~ /tflite
118
+ mkdir ${TFLITE_PATH}
119
+ cd ${TFLITE_PATH}
120
+ ~ /ml-compiler-opt/buildbot/build_tflite.sh
140
121
```
141
122
142
123
## Build LLVM
143
124
144
125
Build LLVM with the 'development' ML mode, and additional
145
126
Fuchsia-specific settings:
146
127
147
- ```
128
+ ``` shell
148
129
cd ${LLVM_SRCDIR}
149
130
mkdir build
150
131
cd build
@@ -154,9 +135,9 @@ cmake -G Ninja \
154
135
-DLINUX_aarch64-unknown-linux-gnu_SYSROOT=${SYSROOT_DIR} /linux-arm64 \
155
136
-DFUCHSIA_SDK=${IDK_DIR} \
156
137
-DCMAKE_INSTALL_PREFIX= \
157
- -DTENSORFLOW_C_LIB_PATH=${TENSORFLOW_C_LIB_PATH} \
158
138
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=On \
159
139
-C ${LLVM_SRCDIR} /clang/cmake/caches/Fuchsia-stage2.cmake \
140
+ -C ${TFLITE_PATH} /tflite.cmake \
160
141
${LLVM_SRCDIR} /llvm
161
142
162
143
ninja distribution
0 commit comments