@@ -84,21 +84,21 @@ As noted in the TensorFlow
8484guide, the <a href =" https://bazel.build/ " class =" external " >Bazel</a >
8585build system will be required.
8686
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:
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:
8888
8989<!-- common_typos_disable -->
9090<pre class =" devsite-click-to-copy " >
9191 <code class =" devsite-terminal " >sudo apt-get remove bazel</code >
9292</pre >
9393<!-- common_typos_enable -->
9494
95- Download and install ` bazel ` version 3.7.2 :
95+ Download and install ` bazel ` version 5.1.0 :
9696
9797<!-- common_typos_disable -->
9898<pre class =" devsite-click-to-copy " >
99- <code class =" devsite-terminal " >wget https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel_3.7.2 -linux-x86_64.deb
99+ <code class =" devsite-terminal " >wget https://github.com/bazelbuild/bazel/releases/download/5.1.0/bazel_5.1.0 -linux-x86_64.deb
100100</code >
101- <code class =" devsite-terminal " >sudo dpkg -i bazel_3.7.2 -linux-x86_64.deb</code >
101+ <code class =" devsite-terminal " >sudo dpkg -i bazel_5.1.0 -linux-x86_64.deb</code >
102102</pre >
103103<!-- common_typos_enable -->
104104
@@ -122,7 +122,7 @@ Finally, confirm installation of the correct `bazel` version:
122122### 4. Build TensorFlow from source
123123
124124Here 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.7 .0.
125+ guide, see the link for further details. TensorFlow Quantum is compatible with TensorFlow version  ; 2.11 .0.
126126
127127Download the
128128<a href =" https://github.com/tensorflow/tensorflow " class =" external " >TensorFlow source code</a >:
@@ -131,7 +131,7 @@ Download the
131131<pre class =" devsite-click-to-copy " >
132132 <code class =" devsite-terminal " >git clone https://github.com/tensorflow/tensorflow.git</code >
133133 <code class =" devsite-terminal " >cd tensorflow</code >
134- <code class =" devsite-terminal " >git checkout v2.7 .0</code >
134+ <code class =" devsite-terminal " >git checkout v2.11 .0</code >
135135</pre >
136136
137137Be sure the virtual environment you created in step 2 is activated. Then, install the TensorFlow dependencies:
@@ -142,6 +142,7 @@ Be sure the virtual environment you created in step 2 is activated. Then, instal
142142 <code class =" devsite-terminal " >pip install -U keras_applications --no-deps</code >
143143 <code class =" devsite-terminal " >pip install -U keras_preprocessing --no-deps</code >
144144 <code class =" devsite-terminal " >pip install numpy==1.19.5</code >
145+ <code class =" devsite-terminal " >pip install packaging requests</code >
145146</pre >
146147<!-- common_typos_enable -->
147148
@@ -153,11 +154,11 @@ Configure the TensorFlow build. When asked for the Python interpreter and librar
153154</pre >
154155<!-- common_typos_enable -->
155156
156- Build the TensorFlow package:
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 ` ) :
157158
158159<!-- common_typos_disable -->
159160<pre class =" devsite-click-to-copy " >
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 >
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 >
161162</pre >
162163<!-- common_typos_enable -->
163164
@@ -193,7 +194,7 @@ Build the TensorFlow Quantum pip package and install:
193194<!-- common_typos_disable -->
194195<pre class =" devsite-click-to-copy " >
195196 <code class =" devsite-terminal " >./configure.sh</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 >
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 >
197198 <code class =" devsite-terminal " >bazel-bin/release/build_pip_package /tmp/tfquantum/</code >
198199 <code class =" devsite-terminal " >python3 -m pip install /tmp/tfquantum/<var >name_of_generated_wheel</var >.whl</code >
199200</pre >
0 commit comments