fo40225 / tensorflow-windows-wheel

Tensorflow prebuilt binary for Windows
3.65k stars 1.53k forks source link

Possibility of specifying configure file to build. #161

Closed MegaPanchamZ closed 3 years ago

MegaPanchamZ commented 3 years ago

I'm asking this so that I can know exactly what settings are needed in the ./configure file so that users can build the pip package themselves. After following googles build from source instructions, It became apparent that the configuration settings for building are very vague.

Is it possible to explain the configure file and put it in the readme or inside the repo what settings were used specifically to build the wheel?

Thanks

fo40225 commented 3 years ago

https://www.tensorflow.org/install/source_windows#expandable-1

MegaPanchamZ commented 3 years ago

Are those settings accurate to what you use to build without AVX instructions?

fo40225 commented 3 years ago

https://github.com/fo40225/tensorflow-windows-wheel/issues/128#issuecomment-595645185

MegaPanchamZ commented 3 years ago

Does that mean I just have to do a vanilla build command like bazel build..... With no options?

fo40225 commented 3 years ago

https://www.tensorflow.org/install/source_windows#gpu_support

No special parameters are required.

No need to modify the source code.

MegaPanchamZ commented 3 years ago

So, to put it simply I just need to run bazel build //tensorflow/tools/pip_package:build_pip_package ? and this will build a package with no AVX and no GPU support? Or do I need to add /nologo when it asks for optimisation flags to make a CPU only build without AVX.

fo40225 commented 3 years ago

Prepare the build environment according to the instructions of official documents.

Answer /nologo if you don't need AVX when asked for optimization parameters.

bazel build --config=opt --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package to build the source code.

bazel-bin\tensorflow\tools\pip_package\build_pip_package C:/tmp/tensorflow_pkg to generate whl file to C:\tmp\tensorflow_pkg

MegaPanchamZ commented 3 years ago

@fo40225 Thanks, I'll run the build today and see if it works.

I will be using the command bazel build --config=opt --define=no_tensorflow_py_deps=true --jobs 6 --local_ram_resources=HOST_RAM*0.5 //tensorflow/tools/pip_package:build_pip_package

Do you want the wheel later to include in the repo? It is a py3.8 and tf2.3.0 whl

sonfire186 commented 3 years ago

@MegaPanchamZ version bazel?

MegaPanchamZ commented 3 years ago

Bazel Version 3.5.0

sonfire186 commented 3 years ago

@MegaPanchamZ I tried bazel 3.1.0 and 3.5.0, it`s bad. My error

`ERROR: G:/tensorflow/tensorflow/core/grappler/BUILD:168:1: C++ compilation of rule '//tensorflow/core/grappler:grappler_item_builder' failed (Exit 2): python.exe failed: error executing command`
`Target //tensorflow/tools/pip_package:build_pip_package failed to build`
MegaPanchamZ commented 3 years ago

@fo40225 quick question, in the build command what does --define=no_tensorflow_py_deps=true mean?