Set Windows specific build options.
(environ_cp)
| 1262 | |
| 1263 | |
| 1264 | def set_windows_build_flags(environ_cp): |
| 1265 | """Set Windows specific build options.""" |
| 1266 | # The non-monolithic build is not supported yet |
| 1267 | write_to_bazelrc('build --config monolithic') |
| 1268 | # Suppress warning messages |
| 1269 | write_to_bazelrc('build --copt=-w --host_copt=-w') |
| 1270 | # Fix winsock2.h conflicts |
| 1271 | write_to_bazelrc( |
| 1272 | 'build --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN ' |
| 1273 | '--copt=-DNOGDI --host_copt=-DNOGDI') |
| 1274 | # Output more verbose information when something goes wrong |
| 1275 | write_to_bazelrc('build --verbose_failures') |
| 1276 | # The host and target platforms are the same in Windows build. So we don't |
| 1277 | # have to distinct them. This avoids building the same targets twice. |
| 1278 | write_to_bazelrc('build --distinct_host_configuration=false') |
| 1279 | |
| 1280 | if get_var( |
| 1281 | environ_cp, 'TF_OVERRIDE_EIGEN_STRONG_INLINE', 'Eigen strong inline', |
| 1282 | True, ('Would you like to override eigen strong inline for some C++ ' |
| 1283 | 'compilation to reduce the compilation time?'), |
| 1284 | 'Eigen strong inline overridden.', 'Not overriding eigen strong inline, ' |
| 1285 | 'some compilations could take more than 20 mins.'): |
| 1286 | # Due to a known MSVC compiler issue |
| 1287 | # https://github.com/tensorflow/tensorflow/issues/10521 |
| 1288 | # Overriding eigen strong inline speeds up the compiling of |
| 1289 | # conv_grad_ops_3d.cc and conv_ops_3d.cc by 20 minutes, |
| 1290 | # but this also hurts the performance. Let users decide what they want. |
| 1291 | write_to_bazelrc('build --define=override_eigen_strong_inline=true') |
| 1292 | |
| 1293 | |
| 1294 | def config_info_line(name, help_text): |
no test coverage detected