Delete build_caffe2.sh, replace with build_libtorch.py#10508
Delete build_caffe2.sh, replace with build_libtorch.py#10508anderspapitto wants to merge 1 commit intopytorch:masterfrom
Conversation
5f5eb70 to
d0bdaef
Compare
as suggested by peter (and copy-pasted from his draft PR). This ensures that all consumers of the torch CMake file go through as unified a path as possible. In order to change the surrounding infrastructure as little as possible, I made some tweaks to enable build_pytorch_libs.sh to generate the test binaries relative to the current directory, rather than hardcoding to pytorch/build.
d0bdaef to
3c5ee4f
Compare
|
@ezyang @goldsborough this is ready for your attention |
| my_env["BUILD_TORCH"] = "ON" | ||
|
|
||
| if subprocess.call(build_libs_cmd + libs, env=my_env) != 0: | ||
| try: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| build_libs_cmd = ['tools\\build_pytorch_libs.bat'] | ||
| else: | ||
| build_libs_cmd = ['bash', 'tools/build_pytorch_libs.sh'] | ||
| build_libs_cmd = ['bash', os.path.join('..', 'tools', 'build_pytorch_libs.sh')] |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| WERROR=1 VERBOSE=1 tools/cpp_build/build_caffe2.sh "$CPP_BUILD" | ||
| mkdir -p $CPP_BUILD/caffe2 | ||
|
|
||
| BUILD_LIBTORCH_PY=$PWD/tools/build_libtorch.py |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| except OSError: | ||
| pass | ||
|
|
||
| kwargs = {'cwd': 'build'} if not IS_WINDOWS else {} |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
see also #10562 to track some related future improvements |
facebook-github-bot
left a comment
There was a problem hiding this comment.
anderspapitto is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
| WERROR=1 VERBOSE=1 tools/cpp_build/build_caffe2.sh "$PWD/../cpp-build" | ||
| BUILD_LIBTORCH_PY=$PWD/tools/build_libtorch.py | ||
| mkdir -p ../cpp-build/caffe2 | ||
| pushd ../cpp-build/caffe2 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
delete build_caffe2.sh, replace with build_libtorch.py as suggested by peter (and copy-pasted from his draft PR). This ensures that all consumers of the torch CMake file go through as unified a path as possible.
In order to change the surrounding infrastructure as little as possible, I made some tweaks to enable build_pytorch_libs.sh to generate the test binaries relative to the current directory, rather than hardcoding to pytorch/build.