@@ -84,21 +84,21 @@ As noted in the TensorFlow
84
84
guide, the <a href =" https://bazel.build/ " class =" external " >Bazel</a >
85
85
build system will be required.
86
86
87
- Our latest source builds use TensorFlow 2.11 .0. To ensure compatibility we use ` bazel ` version 5.1.0 . To remove any existing version of Bazel:
87
+ Our latest source builds use TensorFlow 2.7 .0. To ensure compatibility we use ` bazel ` version 3.7.2 . To remove any existing version of Bazel:
88
88
89
89
<!-- common_typos_disable -->
90
90
<pre class =" devsite-click-to-copy " >
91
91
<code class =" devsite-terminal " >sudo apt-get remove bazel</code >
92
92
</pre >
93
93
<!-- common_typos_enable -->
94
94
95
- Download and install ` bazel ` version 5.1.0 :
95
+ Download and install ` bazel ` version 3.7.2 :
96
96
97
97
<!-- common_typos_disable -->
98
98
<pre class =" devsite-click-to-copy " >
99
- <code class =" devsite-terminal " >wget https://github.com/bazelbuild/bazel/releases/download/5.1.0/bazel_5.1.0 -linux-x86_64.deb
99
+ <code class =" devsite-terminal " >wget https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel_3.7.2 -linux-x86_64.deb
100
100
</code >
101
- <code class =" devsite-terminal " >sudo dpkg -i bazel_5.1.0 -linux-x86_64.deb</code >
101
+ <code class =" devsite-terminal " >sudo dpkg -i bazel_3.7.2 -linux-x86_64.deb</code >
102
102
</pre >
103
103
<!-- common_typos_enable -->
104
104
@@ -122,7 +122,7 @@ Finally, confirm installation of the correct `bazel` version:
122
122
### 4. Build TensorFlow from source
123
123
124
124
Here we adapt instructions from the TensorFlow [ build from source] ( https://www.tensorflow.org/install/source )
125
- guide, see the link for further details. TensorFlow Quantum is compatible with TensorFlow version  ; 2.11 .0.
125
+ guide, see the link for further details. TensorFlow Quantum is compatible with TensorFlow version  ; 2.7 .0.
126
126
127
127
Download the
128
128
<a href =" https://github.com/tensorflow/tensorflow " class =" external " >TensorFlow source code</a >:
@@ -131,7 +131,7 @@ Download the
131
131
<pre class =" devsite-click-to-copy " >
132
132
<code class =" devsite-terminal " >git clone https://github.com/tensorflow/tensorflow.git</code >
133
133
<code class =" devsite-terminal " >cd tensorflow</code >
134
- <code class =" devsite-terminal " >git checkout v2.11 .0</code >
134
+ <code class =" devsite-terminal " >git checkout v2.7 .0</code >
135
135
</pre >
136
136
137
137
Be sure the virtual environment you created in step 2 is activated. Then, install the TensorFlow dependencies:
@@ -141,8 +141,7 @@ Be sure the virtual environment you created in step 2 is activated. Then, instal
141
141
<code class =" devsite-terminal " >pip install -U pip six numpy wheel setuptools mock 'future>=0.17.1'</code >
142
142
<code class =" devsite-terminal " >pip install -U keras_applications --no-deps</code >
143
143
<code class =" devsite-terminal " >pip install -U keras_preprocessing --no-deps</code >
144
- <code class =" devsite-terminal " >pip install numpy==1.24.2</code >
145
- <code class =" devsite-terminal " >pip install packaging requests</code >
144
+ <code class =" devsite-terminal " >pip install numpy==1.19.5</code >
146
145
</pre >
147
146
<!-- common_typos_enable -->
148
147
@@ -154,11 +153,11 @@ Configure the TensorFlow build. When asked for the Python interpreter and librar
154
153
</pre >
155
154
<!-- common_typos_enable -->
156
155
157
- Build the TensorFlow package (Since TF v2.8, ` _GLIBCXX_USE_CXX11_ABI ` is set to 1, and the c++ codes are all compiled with ` -std=c++17 ` ) :
156
+ Build the TensorFlow package:
158
157
159
158
<!-- common_typos_disable -->
160
159
<pre class =" devsite-click-to-copy " >
161
- <code class =" devsite-terminal " >bazel build -c opt --cxxopt="-O3" --cxxopt="-march=native" --cxxopt="-std=c++17" --cxxopt="- D_GLIBCXX_USE_CXX11_ABI=1 " //tensorflow/tools/pip_package:build_pip_package</code >
160
+ <code class =" devsite-terminal " >bazel build -c opt --cxxopt="-O3" --cxxopt="-march=native" --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0 " //tensorflow/tools/pip_package:build_pip_package</code >
162
161
</pre >
163
162
<!-- common_typos_enable -->
164
163
@@ -194,7 +193,7 @@ Build the TensorFlow Quantum pip package and install:
194
193
<!-- common_typos_disable -->
195
194
<pre class =" devsite-click-to-copy " >
196
195
<code class =" devsite-terminal " >./configure.sh</code >
197
- <code class =" devsite-terminal " >bazel build -c opt --cxxopt="-O3" --cxxopt="-march=native" --cxxopt="-std=c++17" --cxxopt="- D_GLIBCXX_USE_CXX11_ABI=1 " release:build_pip_package</code >
196
+ <code class =" devsite-terminal " >bazel build -c opt --cxxopt="-O3" --cxxopt="-march=native" --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0 " release:build_pip_package</code >
198
197
<code class =" devsite-terminal " >bazel-bin/release/build_pip_package /tmp/tfquantum/</code >
199
198
<code class =" devsite-terminal " >python3 -m pip install /tmp/tfquantum/<var >name_of_generated_wheel</var >.whl</code >
200
199
</pre >
0 commit comments